> Portal Navigation:
>
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt
# GetOrdersSettings
# Package: orders
# Namespace: OrdersSettingsService
# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/orders-settings/get-orders-settings.md
## Permission Scopes:
Read Orders: SCOPE.DC-STORES.READ-ORDERS
## Introduction
Retrieves the site's order settings.
---
## REST API
### Schema
```
Method: getOrdersSettings
Description: Retrieves the site's order settings.
URL: https://www.wixapis.com/ecom/v1/orders-settings
Method: GET
Return type: GetOrdersSettingsResponse
- name: ordersSettings | type: OrdersSettings | description: Orders settings.
- name: inventoryUpdateTrigger | type: InventoryUpdateTrigger | description: Defines when to update the store inventory. Default: `ON_ORDER_PLACED`
- enum:
- 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.
- name: createInvoice | type: boolean | description: 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.
- name: createdDate | type: string | description: Date and time the orders settings were created.
- name: updatedDate | type: string | description: Date and time the orders settings were updated.
```
### Examples
### Get orders settings
```curl
curl -X GET \
'https://www.wixapis.com/ecom/v1/orders-settings' \
-H 'Content-Type: application/json' \
-H 'Authorization: '
```
---
## JavaScript SDK
### Schema
```
Method: wixClientAdmin.orders.OrdersSettingsService.getOrdersSettings()
Description: Retrieves the site's order settings.
Return type: PROMISE
- name: ordersSettings | type: OrdersSettings | description: Orders settings.
- name: inventoryUpdateTrigger | type: InventoryUpdateTrigger | description: Defines when to update the store inventory. Default: `ON_ORDER_PLACED`
- enum:
- 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.
- name: createInvoice | type: boolean | description: 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.
- name: _createdDate | type: Date | description: Date and time the orders settings were created.
- name: _updatedDate | type: Date | description: Date and time the orders settings were updated.
```
### Examples
### Get orders settings (with elevated permissions)
```javascript
import { ordersSettings } from '@wix/ecom';
import { auth } from '@wix/essentials';
const elevatedGetOrdersSettings = auth.elevate(ordersSettings.getOrdersSettings);
export async function myGetOrdersSettingsFunction() {
try {
const getOrdersSettings = await elevatedGetOrdersSettings();
console.log('Success! Orders settings:', getOrdersSettings);
return getOrdersSettings;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to:
* {
* "ordersSettings": {
* "inventoryUpdateTrigger": "ON_ORDER_PLACED",
* "createInvoice": false,
* "createdDate": "2024-07-04T15:10:46.070Z",
* "updatedDate": "2024-07-04T15:10:46.070Z"
* }
* }
*/
```
### Get orders settings
```javascript
import { ordersSettings } from '@wix/ecom';
export async function myGetOrdersSettingsFunction() {
try {
const settings = await ordersSettings.getOrdersSettings();
console.log('Success! OrdersSettings:', settings);
return settings;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to:
* {
* "ordersSettings": {
* "inventoryUpdateTrigger": "ON_ORDER_PLACED",
* "createInvoice": false,
* "createdDate": "2024-07-04T15:10:46.070Z",
* "updatedDate": "2024-07-04T15:10:46.070Z"
* }
* }
*/
```
### getOrdersSettings (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).
```javascript
import { createClient } from '@wix/sdk';
import { ordersSettings } from '@wix/ecom';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed
const myWixClient = createClient ({
modules: { ordersSettings },
// Include the auth strategy and host as relevant
});
async function getOrdersSettings() {
const response = await myWixClient.ordersSettings.getOrdersSettings();
};
```
---