Choose attach document API
You can attach documents using two methods:
- Embedded in the order, using the
/orderAPI - Attach to an existing order, using the
/order/documentsAPI
1. Embedded in the order message using the /order API
Section titled “1. Embedded in the order message using the /order API”You can attach documents using the documents field on either order or lines level in the body of the Send order endpoint:
Issue a new orderHow to issue a new purchase order as a buyer
This will NOT create an OrderDocumentsAttachedByBuyeractivity and NO acknowledge task for the supplier.
Documents body
Section titled “Documents body”code: optional document code or number. The document code should be unique within your company and immutable.
revision: optional document revision (or version) code or numbername: optional document short (file) namedescription: optional document description or long nametype: optional document business typeobjectId: optional Tradecloud object identifier which was returned by the Tradecloud object-storage uploadurl: optional document location if it is not stored in the Tradecloud object-storage.
2. Attach to an existing order using the /order/documents API
Section titled “2. Attach to an existing order using the /order/documents API”You can attach documents to existing orders using the documents field on either order or lines level in the body of the Attach order documents endpoint.
This will create OrderDocumentsAttachedByBuyer and, if enabled, an acknowledge task for the supplier.
Order documents body
Section titled “Order documents body”companyId: the optional Tradecloud company identifier. You only have to provide a companyId when your integration user account has multiple company permissions.supplierAccountNumber: the supplier account number as known in your ERP systempurchaseOrderNumber: the purchase order number as known in your ERP systemdocuments: the documents to be attached to this order
lines: the purchase order lines having a new document attachedposition: the line position within the purchase orderdocuments: the documents to be attached to this line
Documents
Section titled “Documents”code: optional document code or number. The document code should be unique within your company and immutable.
revision: optional document revision (or version) code or numbername: optional document short (file) namedescription: optional document description or long nametype: optional document business typeobjectId: optional Tradecloud object identifier which was returned by the Tradecloud object-storage uploadurl: optional document location if it is not stored in the Tradecloud object-storage.
