With the Orders Settings API, you can retrieve and update settings that apply to a site’s eCommerce orders. These settings include adding or removing customer email notifications about order status, defining when to update the store inventory, and creating invoices.
The default orders settings are provided when you first create a Wix eCommerce site.
It’s important to note the following points before starting to code:
This article presents possible use cases and corresponding sample flows that your app can support. It provides a useful starting point as you plan your app's implementation.
If you have several Wix eCommerce sites that use your app you might need to apply the same orders settings to those sites. For example, if now the store inventory is updated only after an order is paid, this change also needs to be reflected on other sites.
To update the orders settings across all sites:
inventoryUpdateTrigger
field value.Defines when to update the store inventory:
ON_ORDER_PAID
: Stock quantities will update only after the payment is approved.ON_ORDER_PLACED
: Stock quantities will update while the payment is being processed. If the payment did not go through, items will restock.Default: ON_ORDER_PLACED
Whether to automatically create invoices for every new order paid online.
Default: false
Note: The issued invoice for an order is not a tax invoice and doesn't reflect refunds. You are responsible for ensuring that invoices you issue conform to any relevant legal requirements.
Date and time the orders settings were created.
Date and time the orders settings were updated.
{
"ordersSettings": {
"inventoryUpdateTrigger": "ON_ORDER_PLACED",
"createInvoice": false
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves the site's order settings.
Orders settings.
curl -X GET \
'https://www.wixapis.com/ecom/v1/orders-settings' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>'
{
"ordersSettings": {
"inventoryUpdateTrigger": "ON_ORDER_PLACED",
"createInvoice": false,
"createdDate": "2024-07-04T15:10:46.070Z",
"updatedDate": "2024-07-04T15:10:46.070Z"
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Updates the site's orders settings.
You can only call this method when authenticated as a Wix app or Wix user identity.
Orders settings to update.
The updated orders settings.
curl -X PATCH \
'https://www.wixapis.com/ecom/v1/orders-settings' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
-d '{
"ordersSettings": {
"createInvoice": true
}
}'
{
"ordersSettings": {
"inventoryUpdateTrigger": "ON_ORDER_PLACED",
"createInvoice": true,
"createdDate": "2024-07-04T15:10:46.070Z",
"updatedDate": "2024-07-04T15:10:46.070Z"
}
}
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Triggered when orders settings are updated.
Unique event ID. Allows clients to ignore duplicate webhooks.
Fully qualified domain name of the entity associated with the event. Expected wix.ecom.v1.orders_settings
.
Event name. Expected updated
.
ID of the entity associated with the event.
Event timestamp.
Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
If present, indicates the action that triggered the event.
Event information.
The data payload will include the following as an encoded JWT:
{
"data": {
"eventType": "wix.ecom.v1.orders_settings_updated",
"instanceId": "<app-instance-id>",
"data": "<stringified-JSON>",
// The identity field is sent as a stringified JSON
"identity": {
"identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
"anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR
"memberId": "<memberId>", // in case of MEMBER
"wixUserId": "<wixUserId>", // in case of WIX_USER
"appId": "<appId>" // in case of APP
}
}
}
{
"id": "9be4e9be-8dfe-11ee-b9d1-0242ac120002",
"entityFqdn": "wix.ecom.v1.orders_settings",
"slug": "updated",
"entityId": "df9b0d5a-8dfe-11ee-b9d1-0242ac120002",
"updatedEvent": {
"currentEntity": {
"ordersSettings": {
"inventoryUpdateTrigger": "ON_ORDER_PLACED",
"createInvoice": true
}
}
},
"eventTime": "2023-11-28T17:01:59.036159Z",
"triggeredByAnonymizeRequest": false
}