Skip to main content

Export orders

The export orders API can be used to export orders into another system

caution

If you have not already read the Introduction to Export APIs then it's recommended to start there to understand how to use the export APIs. The Export APIs is designed to keep track of what has already been exported. If you are looking for a normal API, refer to the Core Order API instead.

Get orders that have not been exported

Endpoint: GET /v10/orders/export

You can add a date+time to the query string using the parameter not_exported_since in order to re-export orders that have already been exported

Available properties for filtering: created_at, updated_at (NOTE: These filters have to be added using our Filters Syntax, however system_id and not_export_since should be added as a normal query string parameter)

Available nested resources for including: lines

The endpoint will fetch all orders that have not been exported yet

Available query parameters

ParameterData typeRequiredDefaultDescription
system_idstringYesA string identifying the system the orders should be exported to. This is used so orders can be exported to multiple systems.
not_exported_sincedatetime (UTC)Current timeAdd this to re-export orders that have already been exported. Note the timezone should be UTC
include_not_approvedinteger0Export draft orders that have not been approved yet. 0 = only export approved orders. 1 = include draft orders in export
include_cancelledinteger0Export cancelled orders in the export. 0 = do not include cancelled orders. 1 = include cancelled orders
include_archivedinteger0Export archived orders in the export. 0 = do not include archived orders. 1 = include archived orders
filter_groupsArray<Filters>Optional filters to add. See which filters are available above

Data of response

ParameterRequiredDefaultDescription
orders.*YesAn array of object order

Mark orders as exported

Endpoint: POST /v10/orders/mark-as-exported

ParameterData typeRequiredDefaultDescription
ordersArray<Orders that have been exported>YesOrders that have been exported. You can at a max mark 10 orders at a time

Orders that have been exported

ParameterData typeRequiredDefaultDescription
order_idintYesThe ID of the order that has been exported
system_idstringYesA string identifying the system the orders should be exported to. This is used so orders can be exported to multiple systems.
regulate_inventorybooleanYesShould TRAEDE regulated inventory when the order is export? Read more under Regulate Inventory on Export
notestringAny notes regarding the sync you want to add. These will be displayed in the timeline of the order

Regulate inventory on export

If you are NOT invoicing in TRAEDE

E.g. if you are using the Order Export API to build your own ERP integration. In such a case it is recommended to have TRAEDE regulate the inventory when an order is exported. The flow can be described like this

  1. In TRAEDE there is 2 types of inventory: In stock and Available. In stock is our total inventory, and available is how much we have available to sell. Let's imagine we have SKU 1000 with In stock = 10, available = 10
  2. An order is made for 1 pcs. of SKU 1000. In stock is still 10, but available is now 9
  3. The order is now exported to the ERP. If we use the POST /v10/orders/mark-as-exported endpoint with regulate_inventory=false then TRAEDE will just leave the order and inventory as-is. If you call the endpoint with regulate_inventory=true then TRAEDE will remove the pieces from In Stock and Archive the order in TRAEDE. So In Stock will be 9 and available 9.

If you are invoicing in TRAEDE

You should not use the regulate_inventory since TRAEDE will regulate the inventory once the invoice is issued. Until the invoice is issued TRAEDE will reserve the ordered quantities so that they are removed from the available inventory