Skip to main content

Add Outbound Order Document

Attach a document to a CartonCloud outbound order (Sale Order). PDF's, images, text files, or anything else you want to attach to an order.

info

At this time only sales invoices can be added to outbound orders. This is a limitation of the CartonCloud API, which currently accepts no other document type against an order.

Security

The utility can be restricted to specific API clients and the CartonCloud customers that documents can be attached to.

Third parties never need the CartonCloud API credentials themselves. The middleware holds the Self-Managed Integration Tenant ID, Client ID and Client Secret, so an integration is only ever granted the ability to attach documents, never the broad access a set of CartonCloud API credentials would give them.

API Requests

API requests are made up of a JSON body which includes properties to define the CartonCloud outbound order to attach the document to and the document itself.

The outbound order to attach the document too can be defined directly if its unique identifier is known, or defined using search criteria if the unique identifier isn't known.

JSON request properties:

  • OutboundOrderId - The unique identifier of the CartonCloud outbound order being targeted, if known, e.g. 00000000-0000-0000-0000-000000001234.
  • OutboundOrderSearchCriteria - Search criteria used to find a unique outbound order, when the unique identifier isn't known. Search criteria is made up of the following properties:
    • CustomerId: The unique identifier of the CartonCloud customer the outbound order belongs to.
    • ClientOrderId: The client's order reference held against the outbound order.
  • FileName - The file name of the document to be attached.
  • FileContent - The file content of the document to be attached. This must be a Base64 encoded string.

Direct identifier targeting example properties:

{
"OutboundOrderId": "00000000-0000-0000-0000-000000001234",
...
}

Search criteria targeting example properties:

{
"OutboundOrderSearchCriteria": {
"CustomerId": "00000000-0000-0000-0000-000000005678",
"ClientOrderId": "SO-12345"
},
...
}

Document to attach example properties:

{
...
"FileName": "invoice.pdf",
"FileContent": "Q29tcGxlY3QgZXhhbXBsZSBmaWxlLg=="
}

Full example to add an invoice document to an outbound order located using search criteria:

{
"OutboundOrderSearchCriteria": {
"CustomerId": "00000000-0000-0000-0000-000000005678",
"ClientOrderId": "SO-12345"
},
"FileName": "invoice.pdf",
"FileContent": "Q29tcGxlY3QgZXhhbXBsZSBmaWxlLg=="
}
info

Search criteria must resolve to a single outbound order. When search criteria matches more than one order, or no orders at all, the request is rejected rather than a document being attached to the wrong order.