Purchase Order Status Payload
The overall response from any of the Order Status endpoints in the OrderSync API have the following shape (see Responses):
{
"data": [ /* Purchase Order Status record */]
"meta": {
...
}
}
An array of Purchase Order Status records are always returned in the 'data' field of the response. This array may be empty or contain only one record, depending on the availability of the data and the request that was made. The Purchase Order Status records have the following fields:
Key | Type | Description |
po_number | string | Purchase order number. In this system, there is only ever one Purchase Order record with a given PO Number. Each record may contain one or more "items" which represent the order lines (products) within the Purchase Order as a whole. |
order_date | ISO 8601 string | Order creation date. |
request_date | ISO 8601 string | Order request date. This date may be set in the future for orders that placed but are not meant to be fulfilled until a future time. |
status | One of the order status values: 'pending', 'review', 'internal review', 'cancelled', 'invalid', 'submitted', 'confirmed', 'processing', 'shipped', 'in transit', 'complete', 'delivered' | |
customer_name | string | Customer name. |
customer_email | string (optional) | Customer email if one was provided in or synced from the original order. |
shipping_address | string | The complete address to which the order was (or will be) shipped |
suppliers | string array | Supplier/OEM/Vendor name(s) where the order was placed. Since a given PO Number can contain order line items through multiple suppliers, this is an array of one or more values. |
total | number | Total cost of the order and all its lines. Note: this number may not take shipping/freight and taxes into account. |
quantity | number | Total quantity of all the items in this Purchase Order across all order lines. |
drop_ship | boolean | True, if the order is being shipped to a customer address. False, if the order is being shipped to a store location. |
items | Purchase Order Line Status array | An array of Purchase Order Line Status items (see below), one for each item within the Purchase Order as a whole. |
conditions | string array | "Conditions" are strings attached to a Purchase Order depanding on different factors. Possible values are: 'multiple_statuses', 'multiple_suppliers', 'no_carrier_events', 'drop_ship', 'delayed' |
invoices | Invoice array (optional) | An array of Invoice items for the Purchase Order (see below). |
Purchase Order Line Status Payload
The Purchase Order Status record will contain one or more Purchase Order Line Status items in its "items" array. These represent all the products/items that are contained under the PO number that was requested in the API call.
Key | Type | Description |
supplier_order_id | string | Supplier/OEM order identifier. |
product_name | string | Name of the product in this order line as it appears in the supplier's portal. |
product_details | JSON object (optional) | Product details synced from the supplier's portal. This is a raw JSON object and may take a different shape depending on which portal it was synced from. May contain customization specs and more.
|
status | One of the order status values: 'pending', 'review', 'internal review', 'cancelled', 'invalid', 'submitted', 'confirmed', 'processing', 'shipped', 'in transit', 'complete', 'delivered' | |
supplier_name | string | Supplier/OEM/Vendor name. |
price | number | Base price of the product(s) in this line. |
discount | number | Discount applied to this line. |
total | number | Total cost of the order line's product(s). |
quantity | number | Total quantity of all the items in this order line. |
estimated_delivery_date | ISO 8601 string | Order's estimated delivery date. |
tracking | Tracking Data (optional) | For order lines that have been shipped, this is an object containing tracking details about the line (see below). |
invoice_line | Invoice Line Data (optional) | For order lines that match to one of the lines of an Invoice attached to the Purchase Order, this object will contain the Invoice Line Data for this item. The invoice_line value will only be set once an Invoice has been "processed". (see the Invoice "processing_status" below). |
original_items | Original Sale Line array (optional) | Only applicable for Purchase Orders that were fulfilled by OrderSync. These items correspond to the original raw sale items that were fulfilled that match to this particular Purchase Order Line Status item.
Note: more than one original_item may match to a single Purchase Order Line Status and a single original_item may map to multiple Purchase Order Line Statuses. If no original item match can confidently be made to this Purchase Order Line Status, this field may be missing. |
Original Sale Line Item
Key | Type | Description |
product_name | string | Product name from the original fulfilled sale line |
Tracking Data
Key | Type | Description |
tracking_number | string | Tracking number for the shipment containing the item in the order line. |
tracking_url | string | Shipping carrier URL for the tracking number/details. |
carrier | string | Slug representing the shipping carrier for this shipment, e.g. 'fedex'. |
actual_delivery_date | ISO 8601 string (optional) | For items that have already been delivered, the date that the item was delivered. |
shipped_date | ISO 8601 string | Date that the item was shipped. |
latest_checkpoint | JSON | An object containing information about the last checkpoint in the shipping journey. Possible properties in this object include: {
|
Fulfillment Line
For order lines fulfilled by OrderSync, the product name of the raw sale item may appear differently than its fulfilled and synced version pulled from the supplier portal. For this reason, these Fulfillment Line items are included to show a record of what the items in this Purchase Order were originally called when they were fulfilled.
Key | Type | Description |
product_name | string | Name of the product as it appeared in the raw sale line. |
supplier_name | string | Supplier/OEM/Vendor name. |
Invoice
An Invoice contains information about any invoices that have been obtained for the Purchase Order.
Key | Type | Description |
invoice_number | string | Invoice identifier. |
supplier_order_id | string | Supplier/OEM order identifier. |
supplier_name | string | Supplier/OEM/Vendor name. |
invoice_date | ISO 8601 string | Invoice creation date. |
due_date | ISO 8601 string | Due date for the Invoice. |
payment_terms | string | Payment terms of the Invoice, e.g. 'Net 60 Days'. |
terms_days | number (optional) | Number of days in the Invoice term. |
subtotal_amount | number | Subtotal amount of the invoice. |
tax_amount | number | Tax amount of the invoice. |
shipping_amount | number | Shipping amount of the Invoice. |
total_amount | number | Total of the Invoice. |
currency | string | A string representing the currency used in the Invoice, e.g. 'USD'. |
status | string | Status of the Invoice, e.g. 'paid'. |
download_url | string | A presigned URL that can be used to download the full PDF invoice. Note: this URL expires within 1 hour of generation and should not be shared with anyone as it is a pre-authenticated URL. |
processing_status | string | The string value will determine whether the Invoice Line data for this Invoice has been processed already and if it is ready to be attached to any matching Purchase Order Lines yet. The possible values are:
null, 'in progress', 'complete'
If null, there is no PDF for the invoice in question to process the lines for.
If "in progress" then the Invoice was not processed yet and has just been queued for processing. If you receive an "in progress", capture the PO Number for this request and retry the API request for the captured PO Number at a later time when the Invoice processing has been completed. Typically, waiting 5 minutes should be enough.
If "complete", then the Invoice Line data has already been process and is attached to any matching Purchase Order Lines already (see Purchase Order Line Status Payload) |
updated_at | ISO 8601 string | Last date this invoice's status was updated. |
Invoice Line
An Invoice Line is the invoice data for a particular item on an Invoice.
Key | Type | Description |
line_number | number | The line number of this line within the Invoice. |
item_code | string | The SKU of the item as it appears on the Invoice. |
product_name | string | The product name (or name of other item such as "Freight") as it appears on the Invoice. |
quantity_ordered | number | The quantity of this item that was ordered as it appears on the Invoice. |
quantity_shipped | number | The quantity of this item that was shipped as it appears on the Invoice. |
unit_price | number | The unit price of this item. This value reflects the price before any discounts. |
discount_pct | number | The percent discount on this item's unit price. |
discount_amount | number | The calculated unit discount amount on this item's unit price. |
extended_total | number | The discounted total price of this line as it appears on the Invoice. |
