> 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

# BulkCreateTaxRegion

# Package: tax

# Namespace: TaxRegionsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/tax/tax-regions/bulk-create-tax-region.md

## Permission Scopes:
Manage Orders: SCOPE.DC-STORES.MANAGE-ORDERS

## Introduction

Create multiple Tax Regions by Bulk

---

## REST API

### Schema

```
 Method: bulkCreateTaxRegion
 Description: Create multiple Tax Regions by Bulk
 URL: https://www.wixapis.com/billing/v1/bulk/tax-regions/create
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  taxRegions
 Method parameters: 
   param name: returnEntity | type: returnEntity | description: Whether to return the full tax region objects in the response.  Default: `true`  
   param name: taxRegions | type: array<taxRegions> | description: Tax regions to create. | required: true | validation: minItems 1, maxItems 100
              - name: country | type: string | description: 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.  | validation: minLength 2, format COUNTRY
              - name: subdivision | type: string | description: Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.  | validation: maxLength 50
              - name: appId | type: string | description: The tax calculator GUID to use to calculate tax for this region.  Call List Tax Calculators to retrieve a list of available calculators for a site.  | validation: format GUID
              - name: taxIncludedInPrice | type: boolean | description: Whether tax is included in the price.  
 Return type: BulkCreateTaxRegionResponse
  - name: results | type: array<BulkCreateTaxRegionResult> | description: Tax regions created by bulk action.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Item metadata.  
        - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
     - name: item | type: TaxRegion | description: Tax region.  This field is returned if the operation was successful and `returnEntity` is set to `true`.  
        - name: id | type: string | description: Tax region GUID.  | validation: format GUID
        - name: country | type: string | description: 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.  | validation: minLength 2, format COUNTRY
        - name: subdivision | type: string | description: Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.  | validation: maxLength 50
        - name: appId | type: string | description: The tax calculator GUID to use to calculate tax for this region.  Call List Tax Calculators to retrieve a list of available calculators for a site.  | validation: format GUID
        - name: taxIncludedInPrice | type: boolean | description: Whether tax is included in the price.  
        - name: revision | type: string | description: Revision number, which increments by 1 each time the tax region is updated. To prevent conflicting changes, the current revision must be passed when updating the tax region.  Ignored when creating a tax region.  | validation: format int64
        - name: createdDate | type: string | description: Date and time the tax region was created.  | validation: format date-time
        - name: updatedDate | type: string | description: Date and time the tax region was last updated.  | validation: format date-time
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Bulk action metadata.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: SUBDIVISIONS_NOT_SUPPORTED_FOR_COUNTRY | Description: Subdivisions aren't supported for the specified `country`.
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: ALREADY_EXISTS | Description: A tax region with this `country` and `subdivision` already exists.


```

### Examples

### Bulk Create Tax Regions
Creates multiple tax regions in a bulk operation

```curl
curl -X POST \
    'https://www.wixapis.com/billing/v1/bulk/tax-regions/create' \
    -H 'Authorization: <AUTH>' \
    -H 'Content-Type: application/json' \
    -d '{
      "taxRegions": [
        {
          "country": "IE",
          "appId": "7516f85b-0868-4c23-9fcb-cea7784243df"
        },
        {
          "country": "GB",
          "appId": "7516f85b-0868-4c23-9fcb-cea7784243df"
        }
      ],
      "returnEntity": true
    }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.taxRegions.bulkCreateTaxRegion(taxRegions, options)
 Description: Create multiple Tax Regions by Bulk
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  taxRegions
 Method parameters: 
   param name: options | type: BulkCreateTaxRegionOptions  none  
        - name: returnEntity | type: boolean | description: Whether to return the full tax region objects in the response.  Default: `true`  
   param name: taxRegions | type: array<array> | description: Tax regions to create. | required: true | validation: minItems 1, maxItems 100
              - name: country | type: string | description: 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.  | validation: minLength 2, format COUNTRY
              - name: subdivision | type: string | description: Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.  | validation: maxLength 50
              - name: appId | type: string | description: The tax calculator GUID to use to calculate tax for this region.  Call List Tax Calculators to retrieve a list of available calculators for a site.  | validation: format GUID
              - name: taxIncludedInPrice | type: boolean | description: Whether tax is included in the price.  
 Return type: PROMISE<BulkCreateTaxRegionResponse>
  - name: results | type: array<BulkCreateTaxRegionResult> | description: Tax regions created by bulk action.  | validation: minItems 1, maxItems 100
     - name: itemMetadata | type: ItemMetadata | description: Item metadata.  
        - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item).  
        - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items.  
        - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated.  
        - name: error | type: ApplicationError | description: Details about the error in case of failure.  
           - name: code | type: string | description: Error code.  
           - name: description | type: string | description: Description of the error.  
           - name: data | type: object | description: Data related to the error.  
     - name: item | type: TaxRegion | description: Tax region.  This field is returned if the operation was successful and `returnEntity` is set to `true`.  
        - name: _id | type: string | description: Tax region GUID.  | validation: format GUID
        - name: country | type: string | description: 2-letter country code in [ISO-3166 alpha-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) format.  | validation: minLength 2, format COUNTRY
        - name: subdivision | type: string | description: Subdivision (such as state, prefecture, or province) in [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format.  | validation: maxLength 50
        - name: appId | type: string | description: The tax calculator GUID to use to calculate tax for this region.  Call List Tax Calculators to retrieve a list of available calculators for a site.  | validation: format GUID
        - name: taxIncludedInPrice | type: boolean | description: Whether tax is included in the price.  
        - name: revision | type: string | description: Revision number, which increments by 1 each time the tax region is updated. To prevent conflicting changes, the current revision must be passed when updating the tax region.  Ignored when creating a tax region.  | validation: format int64
        - name: _createdDate | type: Date | description: Date and time the tax region was created.  
        - name: _updatedDate | type: Date | description: Date and time the tax region was last updated.  
  - name: bulkActionMetadata | type: BulkActionMetadata | description: Bulk action metadata.  
     - name: totalSuccesses | type: integer | description: Number of items that were successfully processed.  
     - name: totalFailures | type: integer | description: Number of items that couldn't be processed.  
     - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: SUBDIVISIONS_NOT_SUPPORTED_FOR_COUNTRY | Description: Subdivisions aren't supported for the specified `country`.
   HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: ALREADY_EXISTS | Description: A tax region with this `country` and `subdivision` already exists.


```

### Examples

### bulkCreateTaxRegion
```javascript
import { taxRegions } from '@wix/ecom';

async function bulkCreateTaxRegion(taxRegions,options) {
  const response = await taxRegions.bulkCreateTaxRegion(taxRegions,options);
};
```

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

async function myBulkCreateTaxRegionMethod(taxRegions,options) {
  const elevatedBulkCreateTaxRegion = auth.elevate(taxRegions.bulkCreateTaxRegion);
  const response = await elevatedBulkCreateTaxRegion(taxRegions,options);
}
```

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

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


async function bulkCreateTaxRegion(taxRegions,options) {
  const response = await myWixClient.taxRegions.bulkCreateTaxRegion(taxRegions,options);
};
```

---