> To build a Wix site agentically, or add Wix features like bookings or a store to a site you already have, follow https://www.wix.com/headless/skill.md
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - 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: settings

# Namespace: OrdersSettingsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/settings/orders-settings/get-orders-settings.md

## Permission Scopes:
Manage eCommerce - all permissions: SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
Read eCommerce - all read permissions: SCOPE.DC-ECOM-MEGA.READ-ECOM
Manage Stores - all permissions: SCOPE.DC-STORES-MEGA.MANAGE-STORES
Read Stores - all read permissions: SCOPE.DC-STORES-MEGA.READ-STORES
Manage Orders: SCOPE.DC-STORES.MANAGE-ORDERS
Read Orders: SCOPE.DC-STORES.READ-ORDERS
Manage Base44 Payments                                                                                          : SCOPE.PAYMENTS.BASE44
Manage Restaurants - all permissions: SCOPE.RESTAURANTS.MEGA-SCOPES
Manage Stores: SCOPE.STORES.MANAGE-STORES

## 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. <br> Default: `false` <br> **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.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the orders settings were updated.  | read-only: true | validation: format date-time


```

### Examples

### Get orders settings
Retrieves the site's orders settings.

```curl
curl -X GET \
  'https://www.wixapis.com/ecom/v1/orders-settings' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.ordersSettings.getOrdersSettings()
 Description: Retrieves the site's order settings.
 Return type: PROMISE<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. <br> Default: `false` <br> **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.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the orders settings were updated.  | read-only: true 


```

### 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-managed)
Self-managed 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();
};
```

---