Skip to content

OR74 - Upload documents to attach to an order

Request

Description

Documents filenames must be distinct. Only documents of the following types are supported: csv, doc, xls, xlsx, ppt, pdf, odt, ods, odp, txt, rtf, png, jpg, gif, zpl, mov, mp4.
An order can have a maximum of 50 documents. In the API output we include only documents with errors. All other documents are successfully uploaded.

For system document types, there are specific restrictions :

  • SYSTEM_DELIVERY_BILL/SYSTEM_SHIPMENT_DELIVERY_BILL : restricted to operator role.
  • SYSTEM_MESSAGE_ATTACHMENT : cannot be directly uploaded to an order.
Call Frequency
Maximum usage: At each document upload on an order
Read More
Security
Front-Bearer-Token or OAuth-2
Path
order_idstringrequired

The identifier of the order

Bodymultipart/form-data
filesArray of strings, (binary)required

The files to be uploaded. Use multipart/form-data with name 'files'. The file names must contain only US-ASCII characters.

order_documentsobjectrequired

The list of documents to be uploaded details

curl -i -X POST \
  https://your-instance.mirakl.net/api/orders/{order_id}/documents \
  -H 'Content-Type: multipart/form-data' \
  -F 'files=@path/to/file' \
  -F 'order_documents="{\"order_documents\":[{\"entity\":{\"id\":\"string\",\"type\":\"RETURN\"},\"file_name\":\"string\",\"type_code\":\"string\"}]}";type=application/json'

Responses

OK

Bodyapplication/json
errors_countinteger, (int32)

The number of documents in an error state

order_documentsArray of objectsrequired

Lists of error reports associated to each document in an error state

Response
{ "errors_count": 1, "order_documents": [ { … } ] }