> 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

# UpsertTaxSettings

# Package: settings

# Namespace: TaxSettingsService

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

## Introduction

Creates or updates the site's tax settings.

If the site's tax settings don't exist yet, this method creates them. Otherwise, it updates the existing settings.

Since these settings are shared across all Wix products on the site, changes take effect immediately for all integrated products.

---

## REST API

### Schema

```
 Method: upsertTaxSettings
 Description: Creates or updates the site's tax settings.  If the site's tax settings don't exist yet, this method creates them. Otherwise, it updates the existing settings.  Since these settings are shared across all Wix products on the site, changes take effect immediately for all integrated products.
 URL: https://www.wixapis.com/billing/v1/tax-settings
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  taxSettings
 Method parameters: 
   param name: taxSettings | type: TaxSettings | description: Site-level tax settings for a Wix site. Each site has a single tax settings resource.  These settings are shared across all Wix products on the site. | required: true 
        - name: taxIncludedInItemPrices | type: boolean | description: Whether tax is already included in catalog item prices.  When `true`, checkout treats catalog prices as tax-inclusive and doesn't add tax on top. When `false`, tax is calculated and added on top of catalog prices at checkout.  This is a site-level display flag, shared by all Wix products on the site. It doesn't re-price the catalog — catalog prices are unchanged; it only controls whether checkout treats them as already including tax.  Default: `false`  
 Return type: UpsertTaxSettingsResponse
  - name: taxSettings | type: TaxSettings | description: Created or updated tax settings.  
     - name: taxIncludedInItemPrices | type: boolean | description: Whether tax is already included in catalog item prices.  When `true`, checkout treats catalog prices as tax-inclusive and doesn't add tax on top. When `false`, tax is calculated and added on top of catalog prices at checkout.  This is a site-level display flag, shared by all Wix products on the site. It doesn't re-price the catalog — catalog prices are unchanged; it only controls whether checkout treats them as already including tax.  Default: `false`  
     - name: createdDate | type: string | description: Date and time the tax settings were created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the tax settings were last updated.  | read-only: true | validation: format date-time

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EMPTY_FIELD_MASK | Description: `taxSettings` has no fields to update.
   HTTP Code: 500 | Status Code: INTERNAL | Application Code: FAILED_TO_UPSERT_TAX_SETTINGS | Description: Couldn't save the site's tax settings.


```

### Examples

### Upsert Tax Settings
Updates the site's tax settings. The first update for a site creates the tax settings; subsequent updates modify them in place.

```curl
curl -X POST \
  'https://www.wixapis.com/billing/v1/tax-settings' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: <AUTH>' \
  -d '{
    "taxSettings": {
      "taxIncludedInItemPrices": true
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.taxSettings.upsertTaxSettings(taxSettings)
 Description: Creates or updates the site's tax settings.  If the site's tax settings don't exist yet, this method creates them. Otherwise, it updates the existing settings.  Since these settings are shared across all Wix products on the site, changes take effect immediately for all integrated products.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  taxSettings
 Method parameters: 
   param name: taxSettings | type: TaxSettings | description: Site-level tax settings for a Wix site. Each site has a single tax settings resource.  These settings are shared across all Wix products on the site. | required: true 
        - name: taxIncludedInItemPrices | type: boolean | description: Whether tax is already included in catalog item prices.  When `true`, checkout treats catalog prices as tax-inclusive and doesn't add tax on top. When `false`, tax is calculated and added on top of catalog prices at checkout.  This is a site-level display flag, shared by all Wix products on the site. It doesn't re-price the catalog — catalog prices are unchanged; it only controls whether checkout treats them as already including tax.  Default: `false`  
 Return type: PROMISE<UpsertTaxSettingsResponse>
  - name: taxSettings | type: TaxSettings | description: Created or updated tax settings.  
     - name: taxIncludedInItemPrices | type: boolean | description: Whether tax is already included in catalog item prices.  When `true`, checkout treats catalog prices as tax-inclusive and doesn't add tax on top. When `false`, tax is calculated and added on top of catalog prices at checkout.  This is a site-level display flag, shared by all Wix products on the site. It doesn't re-price the catalog — catalog prices are unchanged; it only controls whether checkout treats them as already including tax.  Default: `false`  
     - name: _createdDate | type: Date | description: Date and time the tax settings were created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the tax settings were last updated.  | read-only: true 

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: EMPTY_FIELD_MASK | Description: `taxSettings` has no fields to update.
   HTTP Code: 500 | Status Code: INTERNAL | Application Code: FAILED_TO_UPSERT_TAX_SETTINGS | Description: Couldn't save the site's tax settings.


```

### Examples

### upsertTaxSettings
```javascript
import { taxSettings } from '@wix/ecom';

async function upsertTaxSettings(taxSettings) {
  const response = await taxSettings.upsertTaxSettings(taxSettings);
};
```

### upsertTaxSettings (with elevated permissions)
```javascript
import { taxSettings } from '@wix/ecom';
import { auth } from '@wix/essentials';

async function myUpsertTaxSettingsMethod(taxSettings) {
  const elevatedUpsertTaxSettings = auth.elevate(taxSettings.upsertTaxSettings);
  const response = await elevatedUpsertTaxSettings(taxSettings);
}
```

### upsertTaxSettings (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 { taxSettings } from '@wix/ecom';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { taxSettings },
  // Include the auth strategy and host as relevant
});


async function upsertTaxSettings(taxSettings) {
  const response = await myWixClient.taxSettings.upsertTaxSettings(taxSettings);
};
```

---