> 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 # QueryTaxGroups # Package: tax # Namespace: TaxGroups # Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/tax/tax-groups/query-tax-groups.md ## Permission Scopes: Manage Orders: SCOPE.DC-STORES.MANAGE-ORDERS ## Introduction Retrieves a list of tax groups, given the provided paging, filtering, and sorting. Only tax groups that were created by this site will be retrieved with this query. Use [List Default Tax Groups](https://dev.wix.com/docs/rest/business-solutions/e-commerce/tax/tax-groups/list-default-tax-groups.md) or [List Default Tax Groups By App ID](https://dev.wix.com/docs/rest/business-solutions/e-commerce/tax/tax-groups/list-default-tax-groups-by-app-ids.md) to retrieve a site's default tax groups. 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: queryTaxGroups Description: Retrieves a list of tax groups, given the provided paging, filtering, and sorting. Only tax groups that were created by this site will be retrieved with this query. Use [List Default Tax Groups](https://dev.wix.com/docs/rest/business-solutions/e-commerce/tax/tax-groups/list-default-tax-groups.md) or [List Default Tax Groups By App GUID](https://dev.wix.com/docs/rest/business-solutions/e-commerce/tax/tax-groups/list-default-tax-groups-by-app-ids.md) to retrieve a site's default tax groups. 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-groups/query Method: POST # 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: QueryV2 | required: true - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. - 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 - name: fields | type: array | description: Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. - name: fieldsets | type: array | description: Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. Return type: QueryTaxGroupsResponse - name: taxGroups | type: array | description: Retrieved default tax groups. - name: id | type: string | description: Tax group GUID. - name: name | type: string | description: Tax group name. - name: revision | type: string | description: Revision number, which increments by 1 each time the tax group is updated. To prevent conflicting changes, the current revision must be passed when updating the tax group. Ignored when creating a tax group. - name: createdDate | type: string | description: Date and time the tax group was created. - name: updatedDate | type: string | description: Date and time the tax group 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 Groups Queries tax groups based on the provided query options. ```curl curl -X POST \ 'https://www.wixapis.com/billing/v1/tax-groups/query' \ -H 'Authorization: ' \ -H 'Content-type: application/json' \ -d '{ "query": { "cursorPaging": {}, "sort": [ { "fieldName": "createdDate", "order": "DESC" } ] } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.tax.TaxGroups.queryTaxGroups(query) Description: Retrieves a list of tax groups, given the provided paging, filtering, and sorting. Only tax groups that were created by this site will be retrieved with this query. Use [List Default Tax Groups](https://dev.wix.com/docs/rest/business-solutions/e-commerce/tax/tax-groups/list-default-tax-groups.md) or [List Default Tax Groups By App GUID](https://dev.wix.com/docs/rest/business-solutions/e-commerce/tax/tax-groups/list-default-tax-groups-by-app-ids.md) to retrieve a site's default tax groups. 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: TaxGroupQuery | required: true - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. - 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: taxGroups | type: array | description: Retrieved default tax groups. - name: _id | type: string | description: Tax group GUID. - name: name | type: string | description: Tax group name. - name: revision | type: string | description: Revision number, which increments by 1 each time the tax group is updated. To prevent conflicting changes, the current revision must be passed when updating the tax group. Ignored when creating a tax group. - name: _createdDate | type: Date | description: Date and time the tax group was created. - name: _updatedDate | type: Date | description: Date and time the tax group 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 ### queryTaxGroups ```javascript import { taxGroups } from '@wix/ecom'; async function queryTaxGroups(query) { const response = await taxGroups.queryTaxGroups(query); }; ``` ### queryTaxGroups (with elevated permissions) ```javascript import { taxGroups } from '@wix/ecom'; import { auth } from '@wix/essentials'; async function myQueryTaxGroupsMethod(query) { const elevatedQueryTaxGroups = auth.elevate(taxGroups.queryTaxGroups); const response = await elevatedQueryTaxGroups(query); } ``` ### queryTaxGroups (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 { taxGroups } from '@wix/ecom'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { taxGroups }, // Include the auth strategy and host as relevant }); async function queryTaxGroups(query) { const response = await myWixClient.taxGroups.queryTaxGroups(query); }; ``` ---