> 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 # QueryTaxRegions # Package: tax # Namespace: TaxRegionsService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/tax/tax-regions/query-tax-regions.md ## Permission Scopes: Manage Orders: SCOPE.DC-STORES.MANAGE-ORDERS ## Introduction Retrieves a list of tax regions, given the provided paging, filtering, and sorting. To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection). --- ## REST API ### Schema ``` Method: queryTaxRegions Description: Retrieves a list of tax regions, given the provided paging, filtering, and sorting. To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection). URL: https://www.wixapis.com/billing/v1/tax-regions/query Method: POST Method parameters: param name: query | type: CursorQuery - name: cursorPaging | type: CursorPaging | description: Cursor paging options. Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging). - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object. Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). - name: sort | type: array | description: Sort object. Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: QueryTaxRegionsResponse - name: taxRegions | type: array | description: Retrieved tax regions. - name: id | type: string | description: Tax region 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. - 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. - 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. - 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. - name: createdDate | type: string | description: Date and time the tax region was created. - name: updatedDate | type: string | description: Date and time the tax region was last updated. - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata. - name: count | type: integer | description: Number of items returned in current page. - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page. + `true`: Another page of results can be retrieved. + `false`: This is the last page. ``` ### Examples ### Query Tax Regions Returns all existing tax regions with basic info ```curl curl -X POST \ 'https://www.wixapis.com/billing/v1/tax-regions/query' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "query": { "cursorPaging": {}, "sort": [ { "fieldName": "createdDate", "order": "DESC" } ] } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.tax.TaxRegionsService.queryTaxRegions(query) Description: Retrieves a list of tax regions, given the provided paging, filtering, and sorting. To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language), [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/sorting-and-paging), and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection). # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: query Method parameters: param name: query | type: TaxRegionQuery | required: true - name: cursorPaging | type: CursorPaging | description: Cursor paging options. Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging). - name: limit | type: integer | description: Maximum number of items to return in the results. - name: cursor | type: string | description: Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. - name: filter | type: object | description: Filter object. Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters). - name: sort | type: array | description: Sort object. Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#sorting). - name: fieldName | type: string | description: Name of the field to sort by. - name: order | type: SortOrder | description: Sort order. - enum: ASC, DESC Return type: PROMISE - name: taxRegions | type: array | description: Retrieved tax regions. - name: _id | type: string | description: Tax region 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. - 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. - 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. - 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. - 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: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata. - name: count | type: integer | description: Number of items returned in current page. - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both. - name: next | type: string | description: Cursor string pointing to the next page in the list of results. - name: prev | type: string | description: Cursor pointing to the previous page in the list of results. - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page. + `true`: Another page of results can be retrieved. + `false`: This is the last page. ``` ### Examples ### queryTaxRegions ```javascript import { taxRegions } from '@wix/ecom'; async function queryTaxRegions(query) { const response = await taxRegions.queryTaxRegions(query); }; ``` ### queryTaxRegions (with elevated permissions) ```javascript import { taxRegions } from '@wix/ecom'; import { auth } from '@wix/essentials'; async function myQueryTaxRegionsMethod(query) { const elevatedQueryTaxRegions = auth.elevate(taxRegions.queryTaxRegions); const response = await elevatedQueryTaxRegions(query); } ``` ### queryTaxRegions (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 queryTaxRegions(query) { const response = await myWixClient.taxRegions.queryTaxRegions(query); }; ``` ---