Send order response
const url = 'https://api.tradecloud1.com/v2/api-connector/order-response';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"order":{"companyId":"00f03b98-2511-489f-9695-13791b3f66b6","buyerAccountNumber":"12345","purchaseOrderNumber":"PO123456789","description":"Any custom text about this order","indicators":{"accepted":false,"rejected":false},"properties":[{"key":"color","value":"red"}],"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"}],"notes":["one note","another note"],"contact":{"email":"contact@yourcompany.com"}},"lines":[{"purchaseOrderLinePosition":"0001","salesOrderNumber":"SO123456789","salesOrderLinePosition":"0001","description":"Anything about this line","itemDetails":{"countryOfOriginCodeIso2":"NL","combinedNomenclatureCode":"6406 10 10","netWeight":41.241,"netWeightUnitOfMeasureIso":"KG","dangerousGoodsCodeUnece":"0060","serialNumber":"0x0000000000028000","batchNumber":"#18001"},"deliverySchedule":[{"position":"01","date":"2019-12-31","quantity":1234.56}],"chargeLines":[{"position":"001","chargeTypeCode":"FC","chargeDescription":"Additional coating","quantity":2,"price":{"priceInTransactionCurrency":{"value":1234.56,"currencyIso":"EUR"},"priceInBaseCurrency":{"value":1234.56,"currencyIso":"EUR"}},"priceUnitOfMeasureIso":"PCE"}],"prices":{"grossPrice":{"priceInTransactionCurrency":{"value":1234.56,"currencyIso":"EUR"},"priceInBaseCurrency":{"value":1234.56,"currencyIso":"EUR"}},"discountPercentage":50,"netPrice":{"priceInTransactionCurrency":{"value":1234.56,"currencyIso":"EUR"},"priceInBaseCurrency":{"value":1234.56,"currencyIso":"EUR"}},"priceUnitOfMeasureIso":"PCE","priceUnitQuantity":100},"indicators":{"accepted":false,"rejected":false},"properties":[{"key":"color","value":"red"}],"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"}],"notes":["one note","another note"],"reason":"Out of stock."}],"erpResponseDateTime":"2019-12-31T10:11:12","erpRespondedBy":{"email":"contact@yourcompany.com"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tradecloud1.com/v2/api-connector/order-response \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "order": { "companyId": "00f03b98-2511-489f-9695-13791b3f66b6", "buyerAccountNumber": "12345", "purchaseOrderNumber": "PO123456789", "description": "Any custom text about this order", "indicators": { "accepted": false, "rejected": false }, "properties": [ { "key": "color", "value": "red" } ], "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" } ], "notes": [ "one note", "another note" ], "contact": { "email": "contact@yourcompany.com" } }, "lines": [ { "purchaseOrderLinePosition": "0001", "salesOrderNumber": "SO123456789", "salesOrderLinePosition": "0001", "description": "Anything about this line", "itemDetails": { "countryOfOriginCodeIso2": "NL", "combinedNomenclatureCode": "6406 10 10", "netWeight": 41.241, "netWeightUnitOfMeasureIso": "KG", "dangerousGoodsCodeUnece": "0060", "serialNumber": "0x0000000000028000", "batchNumber": "#18001" }, "deliverySchedule": [ { "position": "01", "date": "2019-12-31", "quantity": 1234.56 } ], "chargeLines": [ { "position": "001", "chargeTypeCode": "FC", "chargeDescription": "Additional coating", "quantity": 2, "price": { "priceInTransactionCurrency": { "value": 1234.56, "currencyIso": "EUR" }, "priceInBaseCurrency": { "value": 1234.56, "currencyIso": "EUR" } }, "priceUnitOfMeasureIso": "PCE" } ], "prices": { "grossPrice": { "priceInTransactionCurrency": { "value": 1234.56, "currencyIso": "EUR" }, "priceInBaseCurrency": { "value": 1234.56, "currencyIso": "EUR" } }, "discountPercentage": 50, "netPrice": { "priceInTransactionCurrency": { "value": 1234.56, "currencyIso": "EUR" }, "priceInBaseCurrency": { "value": 1234.56, "currencyIso": "EUR" } }, "priceUnitOfMeasureIso": "PCE", "priceUnitQuantity": 100 }, "indicators": { "accepted": false, "rejected": false }, "properties": [ { "key": "color", "value": "red" } ], "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" } ], "notes": [ "one note", "another note" ], "reason": "Out of stock." } ], "erpResponseDateTime": "2019-12-31T10:11:12", "erpRespondedBy": { "email": "contact@yourcompany.com" } }'Send an order response by the supplier. Requires Integration role
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Send order response by supplier
object
The header of the purchase order response.
object
The optional Tradecloud company ID of the supplier. Only needed when the integration user is authorized for multiple companies.
Example
00f03b98-2511-489f-9695-13791b3f66b6The buyer account code or number as known in your ERP system and added to the buyer connection in the Tradecloud portal.
Example
12345The purchase order number as provided by the buyer.
Example
PO123456789An free format order description or reference
Example
Any custom text about this orderThe provided order line positions in the order response are accepted or rejected by the supplier. These indicators have precedence over responded delivery schedule and prices.
object
The provided purchase order line positions are accepted by the supplier.
Example
falseThe provided purchase order line positions are rejected by the supplier.
Example
falseKey-value based custom fields. Properties are optional.
A key-value based custom field.
object
The key of the custom field.
Example
colorThe value of the custom field. Use \n for a new line.
Example
redDocument references and meta data. The total number of documents is limited to 100 documents per supplier order header. If a document has the same code as an existing supplier order header document, the original supplier order header document is overwritten. Otherwise, the newly attached document is appended.
Either use the Tradecloud object-storage API to upload your document, or your company’s content server, or provide only document meta data.
object
Document code or number. The document code should be unique within your company and immutable.
Example
123456789Document revision (or version) code or number
Example
BDocument short name
Example
Tradecloud API ManualTradecloud object identifier which was returned by the Tradecloud object-storage API upload
Example
00f03b98-2511-489f-9695-13791b3f66b6Location of the document if is not stored in Tradecloud.
Example
https://my-company.com/storage/my_file.pdfThe type of the attached document. Eg. General, Class Product Certificate, Manual, Packing Instructions, etc…
Example
GeneralDescription of the attached document.
Example
General documentString based custom fields. Use \n for a new line. Notes are optional.
Example
[ "one note", "another note"]The employee who is responsible for or who added, updated or responded to this order.
object
Employee email as known in Tradecloud.
Example
contact@yourcompany.comThe lines of the purchase order response. You only have to send the lines which are new or updated.
A purchase order response line.
object
Required position in the purchase order as provided by the buyer.
Example
0001Supplier sales order code or number associated with this line.
Example
SO123456789Supplier sales order position associated with this line.
Example
0001An free format line description or reference.
Example
Anything about this lineThe buyer may send item details to inform the supplier about part information. The supplier may check, change and add item details if they are not correct or incomplete.
object
The country of manufacture, production, or growth where an article or product comes from
Example
NLA tool for classifying goods, set up to meet the requirements both of the Common Customs Tariff and of the EU’s external trade statistics
Example
6406 10 10Net weight of one item
Example
41.241The net weight unit of measure, passed through as-is. Mandatory when netWeight is provided. No standard is enforced; UN/ECE Recommendation N°20 (Codes for Units of Measure) is recommended if you want a standard.
Example
KGUN numbers or UN IDs are four-digit numbers that identify dangerous goods, hazardous substances and articles in the framework of international transport
Example
0060Unique identifier assigned incrementally or sequentially to an item, to uniquely identify it
Example
0x0000000000028000Identification number assigned to a particular quantity or lot of material from a single manufacturer
Example
#18001The confirmed planned delivery schedule by the supplier. Provide one or more delivery schedule lines. The total number of delivery schedule lines is limited to 100 lines per order line.
A confirmed delivery line in the delivery schedule.
object
Position in the delivery schedule. The position should be unique within the schedule and immutable. If an empty string is provided, null is used instead.
Example
01Confirmed delivery date of this delivery position. Leave empty if the date is yet unknown. Date has ISO 8601 date format.
Example
2019-12-31Confirmed quantity of this delivery position. Leave empty if the quantity is yet unknown. Quantity has a decimal format.
Example
1234.56Deprecated: Use lineType with value ‘Charge’ and chargeReasonCode on the order line instead. The confirmed charge lines for this order line.
Deprecated: Use lineType with value ‘Charge’ and chargeReasonCode on the order line instead. The Charge Line that is included in an order line.
object
The position used to identify a Charge Line.
Example
001The reason code of this Charge Line.
Example
FCThe description of this Charge Line.
Example
Additional coatingThe quantity ordered of this Charge Line
Example
2Provide a price in the transaction currency of the supplier, like CNY in China. If available provide a price in your base currency, like EUR in the EU.
object
Price value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURPrice value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURThe price unit of measure, passed through as-is. No standard is enforced; UN/ECE Recommendation N°20 is recommended if you want a standard. The purchase unit and price unit may be different.
Example
PCEPrices as provided by the supplier. Advised is to provide only netPrice or alternatively grossPrice together with discountPercentage.
object
Provide a price in the transaction currency of the supplier, like CNY in China. If available provide a price in your base currency, like EUR in the EU.
object
Price value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURPrice value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURThe discount percentage. Use together with grossPrice.
Example
50Provide a price in the transaction currency of the supplier, like CNY in China. If available provide a price in your base currency, like EUR in the EU.
object
Price value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURPrice value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURThe price unit of measure, passed through as-is. No standard is enforced; UN/ECE Recommendation N°20 is recommended if you want a standard. The purchase unit and price unit may be different. When left empty, the price unit of the buyer is applied.
Example
PCEThe item quantity at which the price applies. Typically this is 1 (unit price) or 100 (the price applies to 100 items). This number must be greater than 0. When left empty, the price unit of the buyer is applied.
Example
100This order line position in the order response is accepted or rejected by the supplier. These indicators have precedence over responded delivery schedule and prices and order header indicators.
object
This purchase order line position is accepted by the supplier.
Example
falseThis purchase order line position is rejected by the supplier.
Example
falseKey-value based custom fields. Properties are optional.
A key-value based custom field.
object
The key of the custom field.
Example
colorThe value of the custom field. Use \n for a new line.
Example
redDocument references and meta data. The total number of documents is limited to 100 documents per order line. If a document has the same code as an existing order line document, the original order line document is overwritten. Otherwise, the newly attached document is appended.
Either use the Tradecloud object-storage API to upload your document, or your company’s content server, or provide only document meta data.
object
Document code or number. The document code should be unique within your company and immutable.
Example
123456789Document revision (or version) code or number
Example
BDocument short name
Example
Tradecloud API ManualTradecloud object identifier which was returned by the Tradecloud object-storage API upload
Example
00f03b98-2511-489f-9695-13791b3f66b6Location of the document if is not stored in Tradecloud.
Example
https://my-company.com/storage/my_file.pdfThe type of the attached document. Eg. General, Class Product Certificate, Manual, Packing Instructions, etc…
Example
GeneralDescription of the attached document.
Example
General documentString based custom fields. Use \n for a new line. Notes are optional.
Example
[ "one note", "another note"]Optional reason for an accepted, rejected, reopened or cancelled order line.
Example
Out of stock.ISO local date and time at which the order was responded in your ERP system.
Example
2019-12-31T10:11:12The employee who is responsible for or who added, updated or responded to this order.
object
Employee email as known in Tradecloud.
Example
contact@yourcompany.comobject
The header of the purchase order response.
object
The optional Tradecloud company ID of the supplier. Only needed when the integration user is authorized for multiple companies.
Example
00f03b98-2511-489f-9695-13791b3f66b6The buyer account code or number as known in your ERP system and added to the buyer connection in the Tradecloud portal.
Example
12345The purchase order number as provided by the buyer.
Example
PO123456789An free format order description or reference
Example
Any custom text about this orderThe provided order line positions in the order response are accepted or rejected by the supplier. These indicators have precedence over responded delivery schedule and prices.
object
The provided purchase order line positions are accepted by the supplier.
Example
falseThe provided purchase order line positions are rejected by the supplier.
Example
falseKey-value based custom fields. Properties are optional.
A key-value based custom field.
object
The key of the custom field.
Example
colorThe value of the custom field. Use \n for a new line.
Example
redDocument references and meta data. The total number of documents is limited to 100 documents per supplier order header. If a document has the same code as an existing supplier order header document, the original supplier order header document is overwritten. Otherwise, the newly attached document is appended.
Either use the Tradecloud object-storage API to upload your document, or your company’s content server, or provide only document meta data.
object
Document code or number. The document code should be unique within your company and immutable.
Example
123456789Document revision (or version) code or number
Example
BDocument short name
Example
Tradecloud API ManualTradecloud object identifier which was returned by the Tradecloud object-storage API upload
Example
00f03b98-2511-489f-9695-13791b3f66b6Location of the document if is not stored in Tradecloud.
Example
https://my-company.com/storage/my_file.pdfThe type of the attached document. Eg. General, Class Product Certificate, Manual, Packing Instructions, etc…
Example
GeneralDescription of the attached document.
Example
General documentString based custom fields. Use \n for a new line. Notes are optional.
Example
[ "one note", "another note"]The employee who is responsible for or who added, updated or responded to this order.
object
Employee email as known in Tradecloud.
Example
contact@yourcompany.comThe lines of the purchase order response. You only have to send the lines which are new or updated.
A purchase order response line.
object
Required position in the purchase order as provided by the buyer.
Example
0001Supplier sales order code or number associated with this line.
Example
SO123456789Supplier sales order position associated with this line.
Example
0001An free format line description or reference.
Example
Anything about this lineThe buyer may send item details to inform the supplier about part information. The supplier may check, change and add item details if they are not correct or incomplete.
object
The country of manufacture, production, or growth where an article or product comes from
Example
NLA tool for classifying goods, set up to meet the requirements both of the Common Customs Tariff and of the EU’s external trade statistics
Example
6406 10 10Net weight of one item
Example
41.241The net weight unit of measure, passed through as-is. Mandatory when netWeight is provided. No standard is enforced; UN/ECE Recommendation N°20 (Codes for Units of Measure) is recommended if you want a standard.
Example
KGUN numbers or UN IDs are four-digit numbers that identify dangerous goods, hazardous substances and articles in the framework of international transport
Example
0060Unique identifier assigned incrementally or sequentially to an item, to uniquely identify it
Example
0x0000000000028000Identification number assigned to a particular quantity or lot of material from a single manufacturer
Example
#18001The confirmed planned delivery schedule by the supplier. Provide one or more delivery schedule lines. The total number of delivery schedule lines is limited to 100 lines per order line.
A confirmed delivery line in the delivery schedule.
object
Position in the delivery schedule. The position should be unique within the schedule and immutable. If an empty string is provided, null is used instead.
Example
01Confirmed delivery date of this delivery position. Leave empty if the date is yet unknown. Date has ISO 8601 date format.
Example
2019-12-31Confirmed quantity of this delivery position. Leave empty if the quantity is yet unknown. Quantity has a decimal format.
Example
1234.56Deprecated: Use lineType with value ‘Charge’ and chargeReasonCode on the order line instead. The confirmed charge lines for this order line.
Deprecated: Use lineType with value ‘Charge’ and chargeReasonCode on the order line instead. The Charge Line that is included in an order line.
object
The position used to identify a Charge Line.
Example
001The reason code of this Charge Line.
Example
FCThe description of this Charge Line.
Example
Additional coatingThe quantity ordered of this Charge Line
Example
2Provide a price in the transaction currency of the supplier, like CNY in China. If available provide a price in your base currency, like EUR in the EU.
object
Price value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURPrice value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURThe price unit of measure, passed through as-is. No standard is enforced; UN/ECE Recommendation N°20 is recommended if you want a standard. The purchase unit and price unit may be different.
Example
PCEPrices as provided by the supplier. Advised is to provide only netPrice or alternatively grossPrice together with discountPercentage.
object
Provide a price in the transaction currency of the supplier, like CNY in China. If available provide a price in your base currency, like EUR in the EU.
object
Price value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURPrice value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURThe discount percentage. Use together with grossPrice.
Example
50Provide a price in the transaction currency of the supplier, like CNY in China. If available provide a price in your base currency, like EUR in the EU.
object
Price value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURPrice value and currency fields.
object
Price value has a decimal format with any number of digits.
Example
1234.563-Letter currency code according to ISO 4217.
Example
EURThe price unit of measure, passed through as-is. No standard is enforced; UN/ECE Recommendation N°20 is recommended if you want a standard. The purchase unit and price unit may be different. When left empty, the price unit of the buyer is applied.
Example
PCEThe item quantity at which the price applies. Typically this is 1 (unit price) or 100 (the price applies to 100 items). This number must be greater than 0. When left empty, the price unit of the buyer is applied.
Example
100This order line position in the order response is accepted or rejected by the supplier. These indicators have precedence over responded delivery schedule and prices and order header indicators.
object
This purchase order line position is accepted by the supplier.
Example
falseThis purchase order line position is rejected by the supplier.
Example
falseKey-value based custom fields. Properties are optional.
A key-value based custom field.
object
The key of the custom field.
Example
colorThe value of the custom field. Use \n for a new line.
Example
redDocument references and meta data. The total number of documents is limited to 100 documents per order line. If a document has the same code as an existing order line document, the original order line document is overwritten. Otherwise, the newly attached document is appended.
Either use the Tradecloud object-storage API to upload your document, or your company’s content server, or provide only document meta data.
object
Document code or number. The document code should be unique within your company and immutable.
Example
123456789Document revision (or version) code or number
Example
BDocument short name
Example
Tradecloud API ManualTradecloud object identifier which was returned by the Tradecloud object-storage API upload
Example
00f03b98-2511-489f-9695-13791b3f66b6Location of the document if is not stored in Tradecloud.
Example
https://my-company.com/storage/my_file.pdfThe type of the attached document. Eg. General, Class Product Certificate, Manual, Packing Instructions, etc…
Example
GeneralDescription of the attached document.
Example
General documentString based custom fields. Use \n for a new line. Notes are optional.
Example
[ "one note", "another note"]Optional reason for an accepted, rejected, reopened or cancelled order line.
Example
Out of stock.ISO local date and time at which the order was responded in your ERP system.
Example
2019-12-31T10:11:12The employee who is responsible for or who added, updated or responded to this order.
object
Employee email as known in Tradecloud.
Example
contact@yourcompany.comResponses
Section titled “Responses”Successfully verified and sent order response.
Successfully queued order response. Order response has not yet been verified.
Bad request, the user should check the response body for more info.
object
Example
missing.propertyExample
Property X was missingNot 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
object
Example
Authentication failedThe number of authentication attempts left before the user is banned. Applicable when authentication through Basic Authentication fails.
Example
2Int describing the number of seconds left before the user is allowed to attempt a login with Basic Authentication again.
Example
300Not authorized, the user is authenticated but does not have the necessary permission.
object
Example
Not authorized for this actionEither buyer or order not found.
An unexpected error occurred, Tradecloud ops will be alerted. May or may not contain a structured response body.
object
Example
some.errorExample
Some error occurredThe 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.
object
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.
