Attaches one document to a B2B order, whichever sales channel the order came from. The warehouse treats the document as uploaded by the merchant, the same as a document uploaded in the merchant portal (for example, an invoice is used as the merchant's commercial invoice).
Only the new document is written: the order itself is not changed, and documents already attached to the order are kept. Sending the same document again attaches it a second time.
The url in the response can be temporary while the file is being stored; list the order's documents to get its permanent download URL.
Orders that are not B2B are rejected with 422.
A document to attach to an order. Provide either document_data_uri or document_url.
Base64-encoded data URI of the document content, for example data:application/pdf;base64,.... Provide either this or document_url.
Type of the document. gs1_label is not accepted here: GS1 labels belong to a logistic unit and are generated by the warehouse.
- Mock serverhttps://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/orders/{id}/documents
- Production APIhttps://app.hive.app/merchant_api/v2/orders/{id}/documents
- Staging APIhttps://staging.app.hive.app/merchant_api/v2/orders/{id}/documents
curl -i -X POST \
'https://hive-merchant-api.redocly.app/_mock/merchant-api-v2/mapi_v2_oas31/orders/{id}/documents' \
-H 'Authorization: Bearer <YOUR_token_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"document_type": "invoice",
"document_data_uri": "data:application/pdf;base64,JVBERi0xLjcKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9LaWRzIFszIDAgUl0gL0NvdW50IDEgPj4KZW5kb2JqCjMgMCBvYmoKPDwgL1R5cGUgL1BhZ2UgL1BhcmVudCAyIDAgUiAvTWVkaWFCb3ggWzAgMCA1OTUgODQyXSA+PgplbmRvYmoKeHJlZgowIDQKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDA5IDAwMDAwIG4gCjAwMDAwMDAwNTggMDAwMDAgbiAKMDAwMDAwMDExNSAwMDAwMCBuIAp0cmFpbGVyCjw8IC9TaXplIDQgL1Jvb3QgMSAwIFIgPj4Kc3RhcnR4cmVmCjE4NgolJUVPRgo=",
"name": "INV-1001.pdf"
}'Document attached to the order
Type of the document
{ "document_type": "delivery_slip", "id": 0, "name": "string", "url": "string" }