Sales Orders
Sales Orders are used to manage customer purchases within Heart.work Commerce. They represent the details of a transaction, including products, quantities, prices, and customer information.
Creating a Sales Order
Sales orders can be created through both the Core API and the Commerce API.
First, a Sales Order has to be created.
- Core API documentation for more information on how to create Sales Orders through the Core API.
- Commerce API documentation for more information on how to create Sales Orders through the Commerce API.
Adding Sales Order Lines
After having created a Sales Order, Sales Order Lines can be added to it.
- Core API documentation on how to add Sales Order Lines through the Core API.
- Commerce API documentation on how to add Sales Order Lines through the Commerce API.
Sales Order Line attributes
In some cases, it's necessary to add additional information to a Sales Order Line, for example, when a product supports has a custom text field like a colour code. Such information can be added to the attributes of a Sales Order Line, like so:
Code
Sales Order completion
Once all desired Sales Order Lines have been added to a Sales Order, it can be completed.
Completing a Sales Order can be done by updating its status to Completed.
- Core API documentation on how to complete Sales Orders through the Core API.
- Commerce API documentation on how to complete Sales Orders through the Commerce API.
Sales Order completion can be used to trigger a webhook for further processing, such as exporting the Sales Order to an external system. See Webhooks for more information.
Sales Order filtering
Sales Orders can be retrieved and filtered through both the Core API and the Commerce API.
-
Core API documentation on how to retrieve Sales Orders through the Core API.
Examples:- Retrieve Sales Orders for a specific Account using the
debtor_idsfilter query parameter:debtor_ids={accountId}. - Retrieve Sales Orders for a specific Contact using the
ordered_by_idsfilter query parameter:ordered_by_ids={contactId}.
- Retrieve Sales Orders for a specific Account using the
-
Commerce API documentation on how to retrieve Sales Orders through the Commerce API.
Sales Orders retrieved through the Commerce API will automatically be filtered to the Account the current user belongs to.