The Exact Online sendSalesOrder supports send order as Order, Invoice, Direct Invoice, and Sales Invoice.
Send order as Sales Invoice
The Exact online sendSalesOrder as Sales Invoice is the Sales Entry in Exact Online. One thing to note that the Sales Entry Lines doesn’t need to check if the product exists. But the SKU or model of the line will be used as the description of the Sales Entry Line. Processing of customers, address and contacts is similar for send order as Order or Invoice. There are some required settings for processing Sales Invoice: Default Revenue Account number - default_revenue_account_id, Value to be used as the default journal id - default_journal_id, Default customer sales vat code id - default_customer_sales_vat_code_id
In case the order lines are processed the SKU’s from the order lines are collected and a filter is constructed that will include a maximum of 25 products and execute a request to retrieve them. If there are still SKUs to be processed this is repeated until the moment the last SKU has been retrieved. When the order lines are processed the Code of the product in the data will be used to lookup the Code on the products retrieved. If it is not found an exception will be thrown.
Order exists check
Before sending anything to Exact Online APIcenter is gonna check to see if the order can be found by the given order number against the YourRef field in Exact Online. This field can be changed by changing the field in the endpoint (checkOrderExists).
When the parameter YourRef in the given data is empty, the check will be skipped.
If an order is found using the reference the flow will be stopped and an error will be shown to the user that tells the user that an order has been found with the reference. It will also show the found order data.
When APIcenter can’t find an order with the reference the flow will be continued.
Invoice exists check
This works the same as the “Order exists check” the only diference is the endpoint (checkInvoiceExists). Invoice uses a different endpoint then the orders. But everything else works the same.
Endpoints used:
Endpoint | Method | Definition |
checkOrderExists | GET | /salesorder/SalesOrders?$filter=YourRef eq ‘{ordernumber}’ |
checkInvoiceExists | GET | /salesinvoice/SalesInvoices?$filter=YourRef eq ‘{ordernumber}’ |