## List and download order documents

### List order documents

To list order's documents, use the following endpoint [GET /v1/booking/orders/{orderId}/documents](/openapi/bookingorderdocument/api_v1bookingorders_orderiddocuments_get_collection)

> Documents are downloadable on the date specified in the `downloadableAt` property.


#### Example Response

```bash
{
  "@context": "/contexts/BookingOrderDocument",
  "@id": "/v1/booking/orders/019b03b2-180a-72b4-b79e-e997874bffa9/documents",
  "@type": "Collection",
  "totalItems": 1,
  "member": [
    {
      "@id": "/v1/booking/orders/019b03b2-180a-72b4-b79e-e997874bffa9/documents/019b03d2-f237-766c-8ade-fcc8c6085b37",
      "@type": "BookingOrderDocument",
      "id": "019b03d2-f237-766c-8ade-fcc8c6085b37",
      "downloadableAt": "2025-02-12T12:00:00+00:00"
    }
  ],
  "view": {
    "@id": "/v1/booking/orders/019b03b2-180a-72b4-b79e-e997874bffa9/documents?XDEBUG_SESSION=1",
    "@type": "PartialCollectionView"
  }
}
```

In this example, the document is downloadable on 2025-02-12 from 12:00:00. If you try to download it before that date, you will get a **403** error.

### Missing Documents

If the order has no document, check if the beneficiaries are set: [see here](/how-to/beneficiary-requirements).

## Getting document download url

To get the download url of a document, you should call
the [PATCH /v1/booking/orders/{orderId}/documents/{id}](/openapi/bookingorderdocument/api_v1bookingorders_orderiddocuments_id_patch)
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

```bash
$ 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

```json
{
  "@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.