Skip to content

Attach order documents

POST
/api-connector/order/documents
curl --request POST \
--url https://api.tradecloud1.com/v2/api-connector/order/documents \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "order": { "companyId": "faa3ea58-b46d-40fe-9b27-7481796717e1", "purchaseOrderNumber": "PO-12345", "documents": [ { "code": "123456789", "revision": "B", "name": "Tradecloud API Manual", "objectId": "00f03b98-2511-489f-9695-13791b3f66b6", "url": "https://my-company.com/storage/my_file.pdf", "type": "General", "description": "General document" } ] }, "lines": [ { "position": "0001", "documents": [ { "code": "123456789", "revision": "B", "name": "Tradecloud API Manual", "objectId": "00f03b98-2511-489f-9695-13791b3f66b6", "url": "https://my-company.com/storage/my_file.pdf", "type": "General", "description": "General document" } ] } ] }'

Attach documents to an order header and lines by the buyer. Requires Integration role. Attached documents are merged with existing order(line) documents. If a document for an order(line) has the same code as an existing document at that order(line), the original will be overwritten. Otherwise, the newly attached document will be appended.

Attach order documents by buyer

Media typeapplication/json
object
order
required

Documents to be attached to the purchase order header.

object
companyId

The optional Tradecloud company ID of the buyer. Only needed when the integration user is authorized for multiple companies.

string format: uuid

Example

faa3ea58-b46d-40fe-9b27-7481796717e1
purchaseOrderNumber
required

The purchase order number as known by the ERP.

string

Example

PO-12345
documents

Document references and meta data. Order header documents are optional. The total number of documents is limited to 100 documents per order header.

Array<object>

Either use the Tradecloud object-storage API to upload your document, or your company’s content server, or provide only document meta data.

object
code

Document code or number. The document code should be unique within your company and immutable.

string

Example

123456789
revision

Document revision (or version) code or number

string

Example

B
name

Document short name

string

Example

Tradecloud API Manual
objectId

Tradecloud object identifier which was returned by the Tradecloud object-storage API upload

string format: uuid

Example

00f03b98-2511-489f-9695-13791b3f66b6
url

Location of the document if is not stored in Tradecloud.

string format: url

Example

https://my-company.com/storage/my_file.pdf
type

The type of the attached document. Eg. General, Class Product Certificate, Manual, Packing Instructions, etc…

string

Example

General
description

Description of the attached document.

string

Example

General document
lines

The lines of the purchase order with documents to be attached. You only have to send the lines which have documents to be attached.

Array<object>

Documents to be attached to the purchase order line.

object
position
required

Required position in the purchase order. The position should be unique within the order and immutable.

string format: digits

Example

0001
documents
required

Document references and meta data. The total number of documents is limited to 100 documents per order line.

Array<object>

Either use the Tradecloud object-storage API to upload your document, or your company’s content server, or provide only document meta data.

object
code

Document code or number. The document code should be unique within your company and immutable.

string

Example

123456789
revision

Document revision (or version) code or number

string

Example

B
name

Document short name

string

Example

Tradecloud API Manual
objectId

Tradecloud object identifier which was returned by the Tradecloud object-storage API upload

string format: uuid

Example

00f03b98-2511-489f-9695-13791b3f66b6
url

Location of the document if is not stored in Tradecloud.

string format: url

Example

https://my-company.com/storage/my_file.pdf
type

The type of the attached document. Eg. General, Class Product Certificate, Manual, Packing Instructions, etc…

string

Example

General
description

Description of the attached document.

string

Example

General document

Successfully verified and attached order documents.

Successfully queued order documents. Documents have not yet been verified.

Bad request, the user should check the response body for more info.

Media type*/*
object
code
required
string

Example

missing.property
message
required
string

Example

Property X was missing

Not authenticated, the user should authenticate using a valid access token, use Basic Authentication, or refresh to get a valid token. May or may not contain a structured response body

Media type*/*
object
message
required
string

Example

Authentication failed
attemptsLeft

The number of authentication attempts left before the user is banned. Applicable when authentication through Basic Authentication fails.

integer

Example

2
banned

Int describing the number of seconds left before the user is allowed to attempt a login with Basic Authentication again.

integer

Example

300

Not authorized, the user is authenticated but does not have the necessary permission.

Media type*/*
object
message
required
string

Example

Not authorized for this action

Order not found.

An unexpected error occurred, Tradecloud ops will be alerted. May or may not contain a structured response body.

Media type*/*
object
code
required
string

Example

some.error
message
required
string

Example

Some error occurred
cause

The cause of this error. Free-format JSON object.

object

Service is not healthy (bad gateway), Tradecloud ops will be alerted. Will not contain a structured response body.

Service is unavailable (overloaded or down for maintenance), Tradecloud ops will be alerted. May or may not contain a structured response body.

Media type*/*
object
message
required
string

Example

Could not retrieve data from external source.

Service is unavailable (gateway timeout), Tradecloud ops will be alerted. Will not contain a structured response body.