Products
/- Mirakl Platform
- Rest Operator APIs
- OR74 - Upload documents to attach to an order
OR04 - Patch update orders
OR11 - List orders with pagination
OR75 - List all the order taxes available on the platform
OR07 - Update order line shipping origin
OR13 - Export orders asynchronously
OR14 - Get the status of an asynchronous order export.
OR15 - Retrieve order export files once asynchronous export is complete (OR13).
OR21 - Accept or refuse order lines
OR23 - Update carrier tracking information for a specific order
OR24 - Validate the shipment of an order
OR28 - Perform refunds on order lines
OR29 - Perform a full cancelation of an order
OR30 - Perform cancelations on order lines
OR31 - Update the custom fields of an order and its order lines
OR32 - Adjust order line
OR33 - Fully cancel a list of order lines of an order
OR51 - Get the evaluation of an order
OR72 - Lists order's documents
OR73 - Download one or multiple documents attached to one or multiple orders
OR76 - Delete an order document
OR12 - Get information about an order
OR26 - Perform a refund of order lines of an order
OR41 - List messages of an order
OR74 - Upload documents t...
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
Recommended usage: At each document upload on an order
Maximum usage: At each document upload on an order
Read More
Security
Operator-Bearer-Token or OAuth-2
- URL to be replaced by your Mirakl instance URLhttps://your-instance.mirakl.net/api/orders/{order_id}/documents
/**
* Requires libcurl
*/
const orderId = "YOUR_order_id_PARAMETER";
$curl = curl_init();
$payload = array(
"files" => "["string"]",
"order_documents" => "{"order_documents":[{"entity":{"id":"string","type":"RETURN"},"file_name":"string","type_code":"string"}]}",
);
curl_setopt_array($curl, [
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <YOUR_JWT_HERE>",
"Content-Type: multipart/form-data"
],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_URL => "https://your-instance.mirakl.net/api/orders/" . orderId . "/documents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$error = curl_error($curl);
curl_close($curl);
if ($error) {
echo "cURL Error #:" . $error;
} else {
echo $response;
}