This API allows external systems to create an "Arrival to Supplier" document in 4ws.trade, with references to the purchase order document, the following specification includes details of the request structure and field mappings for linking with a purchase order. This API enables external systems to record goods received from a supplier and ties them to the original purchase order to streamline tracking.
Document date
All Date information within the API is expressed in the GMT time zone. API users are therefore responsible for converting dates to their desired time zone if needed. Please refer to Date Handling
The request body must include details about the goods arrival document (type ENTRY) with references to the related purchase order in documentHeader.lstConnectedHeader and in each line item’s refDocumentRow attribute in documentRows.
Document prices
The external system must ensure that prices in the documents are valued according to the following rules:
priceSale: the product's selling price is a gross VAT amount;
priceInvoice: the product's invoice price (purchase invoice) is a net VAT amount;
pricePurchase: the product's purchase price (typically purchase order) is a net VAT amount.
If the fields priceSale is mandotary instead priceInvoice, and pricePurchase are not provided, the system will attempt to retrieve prices based on the branchCode and the sale, invoice, and purchase price lists. If no matching price is found, the API will return an error, and the document will not be created.
Get Purchase Order ID and Line Item IDs: The external system calls Get Document to retrieve the unique identifiers for the purchase order (lstConnectedHeader) and its line items (refDocumentRow).
2.
Create Goods Arrival Document: The external system sends the prepared JSON request to this API, referencing the purchase order and line items.
3.
Callback Confirmation: 4ws.trade responds via the specified callback URL to confirm successful document creation.
The API Client sends a POST request containing the document header, rows, and callback URL.
2.
The 4ws.trade validates and acknowledges the request by returning a confirmation response:
success: Indicates successful receipt.
id: A unique UUID identifier for tracking the request.
3.
After processing, the platform calls the specified callback URL with the final document details:
id: The document unique UUID.
barcode: The document's barcode.
documentNumber: The generated document number.
documentStatus: The document's status
OPEN: the document can be updated or modified with new products, discounts, quantities etc... .
CLOSE: the document is ready for fulfillment and the products, quantities, discounts are final.
Document & row id must be a valid UUID
If the id field is not provided or does not contain a valid UUID, the value will be automatically generated by the suite and will overwrite the value received in the request payload.The processed document, including the generated id, will then be returned in the service response.