Send an order message
const url = 'https://api.tradecloud1.com/v2/sci-connector/order';const options = { method: 'PUT', headers: {Authorization: '<Authorization>', 'Content-Type': 'text/xml'}, body: '{\n "ID": "123",\n "IssueDate": "2018-10-06",\n "Note": [\n "[Free-form text]"\n ],\n "AdditionalDocumentReference": [\n {\n "ID": "998413772",\n "DocumentType": "TPD Document",\n "VersionID": "1.0",\n "Attachment": {\n "ExternalReference": {\n "URI": "https://storage.company.com/doc/12345",\n "FileName": "[File name]",\n "Description": "[Description of the file]"\n }\n }\n }\n ],\n "Contract": {\n "ContractDocumentReference": {\n "ID": "approveWhenProposedOrReopenRequested:true"\n }\n },\n "BuyerCustomerParty": {\n "Party": {\n "PartyIdentification": {\n "ID": "[Party identifier]",\n "Person": {\n "Contact": {\n "ElectronicMail": "contact@yourcompany.com"\n }\n }\n }\n }\n },\n "SellerSupplierParty": {\n "Party": {\n "PartyIdentification": {\n "ID": "[Party identifier]",\n "Person": {\n "Contact": {\n "ElectronicMail": "contact@yourcompany.com"\n }\n }\n }\n }\n },\n "DeliveryTerms": {\n "ID": "EXW"\n },\n "PaymentTerms": {\n "SettlementPeriod": {\n "DurationMeasure": 5.5\n }\n },\n "AnticipatedMonetaryTotal": {\n "PayableAmount": 1000.4\n },\n "OrderLine": [\n {\n "LineItem": {\n "ID": "1",\n "Note": [\n "[Free-form text note on order line]"\n ],\n "LineStatusCode": "cancelled",\n "Quantity": 50.5,\n "LineExtensionAmount": 175.8,\n "Delivery": {\n "ID": "[delivery reference]",\n "Quantity": 50.5,\n "DeliveryLocation": {\n "ID": "1234567890128",\n "Description": "[Free-form description of the location]",\n "Address": {\n "StreetName": "Antoon Coolenlaan",\n "BuildingNumber": "1 B",\n "CityName": "Delft",\n "PostalZone": "2629JD",\n "Country": {\n "IdentificationCode": "NL"\n }\n }\n },\n "RequestedDeliveryPeriod": {\n "EndDate": "2018-10-11"\n }\n },\n "Price": {\n "PriceAmount": 4.5,\n "BaseQuantity": 1.5,\n "PriceType": "gross",\n "AllowanceCharge": {\n "ChargeIndicator": false,\n "MultiplierFactorNumeric": 20.5\n }\n },\n "Item": {\n "Description": "[Description of the item]",\n "Name": "[Item name]",\n "BuyersItemIdentification": {\n "ID": "AN0000123456",\n "ExtendedID": "A1"\n },\n "SellersItemIdentification": {\n "ID": "AN0000123456",\n "ExtendedID": "A1"\n },\n "AdditionalItemProperty": [\n {\n "Name": "BindingContract",\n "Value": "n-321"\n }\n ],\n "Dimension": [\n {\n "AttributeId": "Length",\n "Measure": 50.5\n }\n ]\n }\n },\n "DocumentReference": [\n {\n "ID": "998413772",\n "DocumentType": "TPD Document",\n "VersionID": "1.0",\n "Attachment": {\n "ExternalReference": {\n "URI": "https://storage.company.com/doc/12345",\n "FileName": "[File name]",\n "Description": "[Description of the file]"\n }\n }\n }\n ]\n }\n ]\n}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.tradecloud1.com/v2/sci-connector/order \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: text/xml' \ --data '{ "ID": "123", "IssueDate": "2018-10-06", "Note": [ "[Free-form text]" ], "AdditionalDocumentReference": [ { "ID": "998413772", "DocumentType": "TPD Document", "VersionID": "1.0", "Attachment": { "ExternalReference": { "URI": "https://storage.company.com/doc/12345", "FileName": "[File name]", "Description": "[Description of the file]" } } } ], "Contract": { "ContractDocumentReference": { "ID": "approveWhenProposedOrReopenRequested:true" } }, "BuyerCustomerParty": { "Party": { "PartyIdentification": { "ID": "[Party identifier]", "Person": { "Contact": { "ElectronicMail": "contact@yourcompany.com" } } } } }, "SellerSupplierParty": { "Party": { "PartyIdentification": { "ID": "[Party identifier]", "Person": { "Contact": { "ElectronicMail": "contact@yourcompany.com" } } } } }, "DeliveryTerms": { "ID": "EXW" }, "PaymentTerms": { "SettlementPeriod": { "DurationMeasure": 5.5 } }, "AnticipatedMonetaryTotal": { "PayableAmount": 1000.4 }, "OrderLine": [ { "LineItem": { "ID": "1", "Note": [ "[Free-form text note on order line]" ], "LineStatusCode": "cancelled", "Quantity": 50.5, "LineExtensionAmount": 175.8, "Delivery": { "ID": "[delivery reference]", "Quantity": 50.5, "DeliveryLocation": { "ID": "1234567890128", "Description": "[Free-form description of the location]", "Address": { "StreetName": "Antoon Coolenlaan", "BuildingNumber": "1 B", "CityName": "Delft", "PostalZone": "2629JD", "Country": { "IdentificationCode": "NL" } } }, "RequestedDeliveryPeriod": { "EndDate": "2018-10-11" } }, "Price": { "PriceAmount": 4.5, "BaseQuantity": 1.5, "PriceType": "gross", "AllowanceCharge": { "ChargeIndicator": false, "MultiplierFactorNumeric": 20.5 } }, "Item": { "Description": "[Description of the item]", "Name": "[Item name]", "BuyersItemIdentification": { "ID": "AN0000123456", "ExtendedID": "A1" }, "SellersItemIdentification": { "ID": "AN0000123456", "ExtendedID": "A1" }, "AdditionalItemProperty": [ { "Name": "BindingContract", "Value": "n-321" } ], "Dimension": [ { "AttributeId": "Length", "Measure": 50.5 } ] } }, "DocumentReference": [ { "ID": "998413772", "DocumentType": "TPD Document", "VersionID": "1.0", "Attachment": { "ExternalReference": { "URI": "https://storage.company.com/doc/12345", "FileName": "[File name]", "Description": "[Description of the file]" } } } ] } ]}'Allows a buyer to send an order message, using the SCSN format.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Send order by buyer
A document used to order goods and services
object
An identifier for this document, assigned by the sender of this message.
Example
123The date the purchase order was issued by the BuyerCustomer party.
Example
2018-10-06Zero, one or more free-form text about the order, conveying information that is not covered by other elements.
Zero, one or more references to an additional document associated with this order. The total number of documents is limited to 100 documents per order header.
A reference to a document associated with this order line.
object
An identifier for the referenced document.
Example
998413772Specifies the type of document.
Example
TPD DocumentVersion/revision number of the TPD package.
Example
1.0The referenced document as an attachment to the document from which it is referenced. NOTE: currently only external references are supported by Tradecloud.
object
A reference to an attached document that is external to the document(s) being exchanged.
object
The Uniform Resource Identifier (URI) that identifies the external object as an Internet resource.
Example
https://storage.company.com/doc/12345The filename of the document as specified by the issuer.
Example
[File name]Textual description of the content of the file.
Example
[Description of the file]A reference to a contract document. Can be used for Tradecloud indicators, such as approveWhenProposedOrReopenRequested
object
object
The contract reference identifier. When this ID equals approveWhenProposedOrReopenRequested:true, order lines are automatically confirmed when the supplier proposes changes or requests to reopen the order line.
Example
approveWhenProposedOrReopenRequested:trueThe party that purchases the goods or services.
object
object
A unique reference to the party.
object
In case of a SellerSupplierParty, this should contain the supplier account code registered in Tradecloud for this supplier.
NOTE: A schemeId attribute can be added to this field.
Example
[Party identifier]A contactable person of the organization.
object
The contact information for a person.
object
The primary email address of this contact.
Example
contact@yourcompany.comThe party that sells and delivers the goods or services. Make sure the Party > PartyIdentification > ID contains the supplier account code registered in Tradecloud for this supplier.
object
object
A unique reference to the party.
object
In case of a SellerSupplierParty, this should contain the supplier account code registered in Tradecloud for this supplier.
NOTE: A schemeId attribute can be added to this field.
Example
[Party identifier]A contactable person of the organization.
object
The contact information for a person.
object
The primary email address of this contact.
Example
contact@yourcompany.comDescribes the delivery terms, eg. INCOTERMs including additional information.
object
A formal code that communicates the tasks, costs, and risks associated with the transportation and delivery of goods.
NOTE: Attribute schemeName is required, containing the specification of the scheme/codelist used to specify the DeliveryTermsCode.
Example
EXWThe terms of payment established for this order.
object
The time period during which the payment terns apply.
object
The duration of a period, expressed as a code; ISO 8601.
NOTE: attribute unitCode is required.
Example
5.5The total amount of all items specified on the order, including allowances/charges and taxes, but excluding any payment discounts as stated in the Payment Terms.
object
The currency type that applies to the monetary amount.
NOTE: attribute currencyID is required.
Example
1000.4One or more lines associated with this order. The total number of lines is limited to 500 lines per order.
A line associated with this order and specifying a kind of item being ordered.
object
A line specifying a kind of item being ordered.
object
An identifier for the line item, assigned by the customer buyer.
Example
1Zero, one or more free-form texts conveying information about the order line that is not contained explicitly in other structures.
A code signifying the status of the order line as indicated by the seller supplier.
NOTE: Tradecloud only checks whether the line is cancelled or not.
Example
cancelledThe quantity of items.
NOTE: attribute unitCode is required.
Example
50.5The total monetary amount of all items specified on this order line, including price discounts or charges, but excluding taxes.
Example
175.8Delivery details of an order line item.
object
The reference identifier for this delivery as provided by the customer buyer.
Example
[delivery reference]The quantity of items.
NOTE: attribute unitCode is required.
Example
50.5Location of a party where delivery of the associated (set of) line item(s) is to take place.
object
The identification of a location.
NOTE: attribute schemeID is required.
Example
1234567890128A textual description of the location.
Example
[Free-form description of the location]The address associated with a location.
object
The name of the street, road, avenue, way, etc. to which the number of the building is attached.
Example
Antoon CoolenlaanNumerical identification of an address, including an (optional) suffix.
Example
1 BThe name of a city, town, or village in which this address is situated
Example
DelftThe postal identifier for this address according to the relevant national postal service, such as a ZIP code or Post Code.
Example
2629JDThe country in which this address is situated.
object
Example
NLThe period requested for delivery associated with (a set of) line item(s) as requested by the buyer customer.
object
Example
2018-10-11The price that applies to the line item.
object
The monetary amount of the price
NOTE: attribute currencyID is required.
Example
4.5The quantity to which this price applies.
NOTE: attribute unitCode is required.
Example
1.5Specification of the type of price. I.e. net or gross.
NOTE: Tradecloud only supports gross price
Example
grossAn allowance or charge associated with this price.
object
An indicator that specifies whether this AllowanceCharge is a charge (true) or a discount (false). NOTE: Tradecloud only supports discount (false).
Example
falseA percentage by which the base amount is multiplied to calculate the actual amount of this allowance or charge. NOTE: Tradecloud only supports discounts; this is the discount percentage.
Example
20.5Description of the item being traded.
NOTE: Tradecloud requires Name and BuyersItemIdentification to be defined.
object
Free-form text description of the line item.
Example
[Description of the item]Short name of item. NOTE: required by Tradecloud.
Example
[Item name]An identifier for this item, assigned by the Buyer / Customer or Seller / Supplier.
SellersItemIdentification > ExtendedID will not be used by Tradedloud.
object
The main identifier for the item.
Example
AN0000123456A revision number for the item.
Example
A1An identifier for this item, assigned by the Buyer / Customer or Seller / Supplier.
SellersItemIdentification > ExtendedID will not be used by Tradedloud.
object
The main identifier for the item.
Example
AN0000123456A revision number for the item.
Example
A1Zero, one or more custom key-value pairs
A key-value pair for custom objects
object
The key of the object
Example
BindingContractThe value of the object
Example
n-321Zero, one or more dimensions related to the item
Defines measurable dimensions (length, width, area, weight or volume) of an item
object
Measurable dimension type of item
Example
LengthMeasurement value
NOTE: attribute unitCode is required
Example
50.5Zero, one or more references to a document associated with this order line. The total number of documents is limited to 100 documents per order line.
A reference to a document associated with this order line.
object
An identifier for the referenced document.
Example
998413772Specifies the type of document.
Example
TPD DocumentVersion/revision number of the TPD package.
Example
1.0The referenced document as an attachment to the document from which it is referenced. NOTE: currently only external references are supported by Tradecloud.
object
A reference to an attached document that is external to the document(s) being exchanged.
object
The Uniform Resource Identifier (URI) that identifies the external object as an Internet resource.
Example
https://storage.company.com/doc/12345The filename of the document as specified by the issuer.
Example
[File name]Textual description of the content of the file.
Example
[Description of the file]Responses
Section titled “Responses”Successfully sent order by buyer
Bad request, the user should check the response body for more info.
Not authenticated, the user should authenticate using a valid access token, use Basic Authentication, or refresh to get a valid token.
Not authorized, the user is authenticated but does not have the necessary permission.
An unexpected error occurred, Tradecloud ops will be alerted.
Service is not healthy (bad gateway), Tradecloud ops will be alerted.
Service is unavailable (overloaded or down for maintenance), Tradecloud ops will be alerted.
Service is unavailable (gateway timeout), Tradecloud ops will be alerted.
