Last updated

Download Order documents

To get the download url a document you should call the PATCH /v1/booking/orders/{orderId}/documents endpoint. Note that setting the Accept-Language header will get you the document in the desired language if available. If the desired language is not available the default catalog’s language will be used.

Request

$ curl --request PATCH \
  --url https://api.korusticket.com/v1/booking/orders/0194b132-448c-7d1b-bb13-f8e09ae5c18f/documents/0194b132-449c-79cd-9da1-50be439b6e9d \
  -H 'accept: application/ld+json' \
  -H 'Authorization: Bearer {{YOUR_JWT_TOKEN}}' \
  -H 'Accept-Language: fr' \
  -H 'Content-Type: application/merge-patch+json' \
  -d '{}'

Response

{
  "@context": "/contexts/BookingOrderDocument",
  "@id": "/v1/booking/orders/0194b132-448c-7d1b-bb13-f8e09ae5c18f/documents/0194b132-449c-79cd-9da1-50be439b6e9d",
  "@type": "BookingOrderDocument",
  "id": "0194b132-449c-79cd-9da1-50be439b6e9d",
  "temporaryUrl": "https://storage.googleapis.com/BUCKET/0194a854-daf4-78fc-aed1-b39a0867add7/0194b6c7-cbc8-7e79-b8a8-e95ffd98d08f/0194b6c7-cbc8-7e79-b8a8-e95ffe2acb49.pdf?GoogleAccessId=bucket%40bucket.iam.gserviceaccount.com&Expires=1738235339&Signature=KG27A%2Bc4z6C2McDcT4G3H70dZpp5ED7wsQawE2Q8qbeABJcWpNy7xd5fneTx%2BXLzzf0QBv8wfqVvl8tNKwyK1EFnvq%2FDwtt6OtjAwnObFZtRB4X6eHuVoVR%2FR%2FT9JznN6okNc7KC5lLTYFDUkH%2Fh7M6mQ35wrtSJ6WCFv1Zf7LaPIhubLK9%2BBEfnziLbRAph4U5XJBGf4Xa5zGJtRqArNON5Ivs0f95L6MXZ4Aft%2BhByW%2Bllq9z7T9cJJAErDWYRDQotiUGmR4AOZ3D25k1CeNf8EN3ORjYNwboxGp5S43toNxswhZlMapBqoFyNC8oHVrg7eCbwsVxEUnc%2FiTt%2Fyw%3D%3D",
  "cachedLanguage": "fr"
}

You can use the "temporaryUrl" value to download the document. As the name indicates, this URL is temporary. This means you cannot share it directly with the customer. Instead, you can either download and store the document in your own storage, or call this endpoint again to get a new URL when needed.