> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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?apiView=SDK.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. <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();
};
```

---