> 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

# QueryContactTaxDetails

# Package: tax

# Namespace: ContactTaxDetailsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/tax/contact-tax-details/query-contact-tax-details.md

## Permission Scopes:
Read eCommerce - all read permissions: SCOPE.DC-ECOM-MEGA.READ-ECOM

## Introduction

Retrieves a list of up to 100 contact tax details, given the provided paging, filtering, and sorting.

Query Contact Tax Details runs with these defaults, which you can override:

- `createdDate` is sorted in `DESC` order
- `paging.limit` is `50`

To include each contact's name, email, and VAT ID in the response, pass `CONTACT_DETAILS` in the `fields` array.

To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).

---

## REST API

### Schema

```
 Method: queryContactTaxDetails
 Description: Retrieves a list of up to 100 contact tax details, given the provided paging, filtering, and sorting.  Query Contact Tax Details runs with these defaults, which you can override:  - `createdDate` is sorted in `DESC` order - `paging.limit` is `50`  To include each contact's name, email, and VAT GUID in the response, pass `CONTACT_DETAILS` in the `fields` array.  To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).
 URL: https://www.wixapis.com/billing/v1/contact-tax-details/query
 Method: POST
 Method parameters:
   param name: fields | type: array<fields> | description: Additional fields to return in the response.  Supported values: `CONTACT_DETAILS`  | validation: maxItems 10
                 - enum:
                 -     CONTACT_DETAILS: Returns the contact's details, including first name, last name, company, email, and VAT ID.
   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.  | validation: minimum 0, maximum 100, format int32
        - 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.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: id | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: taxExemptGroupId | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: tags | operators: $eq, $ne, $exists, $in, $hasSome | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QueryContactTaxDetailsResponse
  - name: contactTaxDetails | type: array<ContactTaxDetails> | description: List of retrieved contact tax details.  
     - name: id | type: string | description: Contact GUID. Also serves as the GUID of the contact tax details, since each contact has a single set of tax details.  | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the contact tax details are updated.  | validation: format int64
     - name: createdDate | type: string | description: Date and time the contact tax details were created.  | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the contact tax details were updated.  | validation: format date-time
     - name: taxExemptGroupId | type: string | description: GUID of the tax exempt group the contact is associated with. Setting this value makes the contact eligible for the group's tax exemption at checkout.  | validation: format GUID
     - name: contactDetails | type: ContactDetails | description: The contact's details, such as name, email, and VAT GUID.  Returned only when `CONTACT_DETAILS` is passed to the `fields` array in the request.  
        - name: firstName | type: string | description: Contact's first name.  | validation: maxLength 100
        - name: lastName | type: string | description: Contact's last name.  | validation: maxLength 100
        - name: company | type: string | description: Contact's company name.  | validation: maxLength 100
        - name: email | type: string | description: Contact's email address.  | validation: format EMAIL
        - name: vatId | type: string | description: Contact's VAT GUID. Read from the contact's `invoices.vatId` extended field, so it's empty unless that field is set on the contact.  | validation: maxLength 100
     - name: extendedFields | type: ExtendedFields | description: Custom field data for the contact tax details.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
     - name: tags | type: Tags | description: Tags associated with the contact tax details.  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in current page.  | validation: format int32
     - 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.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - 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 Contact Tax Details
Queries contact tax details based on the provided query options. For example, retrieve all contacts in a given tax exempt group. Pass CONTACT_DETAILS in the fields array to enrich each result.

```curl
curl -X POST \
    'https://www.wixapis.com/billing/v1/contact-tax-details/query' \
    -H 'Authorization: <AUTH>' \
    -H 'Content-Type: application/json' \
    -d '{
    "query": {
      "filter": {
        "taxExemptGroupId": "8046df3c-7575-4098-a5ab-c91ad8f33c47"
      },
      "cursorPaging": {
        "limit": 100
      }
    },
    "fields": ["CONTACT_DETAILS"]
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.contactTaxDetails.queryContactTaxDetails(query, options)
 Description: Retrieves a list of up to 100 contact tax details, given the provided paging, filtering, and sorting.  Query Contact Tax Details runs with these defaults, which you can override:  - `createdDate` is sorted in `DESC` order - `paging.limit` is `50`  To include each contact's name, email, and VAT GUID in the response, pass `CONTACT_DETAILS` in the `fields` array.  To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging.md), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection.md).
 # 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: options | type: QueryContactTaxDetailsOptions  none  
        - name: fields | type: array<ContactTaxDetailsRequestedFields> | description: Additional fields to return in the response.  Supported values: `CONTACT_DETAILS`  | validation: maxItems 10
             - enum:
             -     CONTACT_DETAILS: Returns the contact's details, including first name, last name, company, email, and VAT ID.
   param name: query | type: ContactTaxDetailsQuery   | 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.  | validation: minimum 0, maximum 100, format int32
        - 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.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: _id | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: taxExemptGroupId | operators: $eq, $ne, $exists, $in, $hasSome, $startsWith, $gt, $lt, $lte, $gte | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: tags | operators: $eq, $ne, $exists, $in, $hasSome | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QueryContactTaxDetailsResponse>
  - name: contactTaxDetails | type: array<ContactTaxDetails> | description: List of retrieved contact tax details.  
     - name: _id | type: string | description: Contact GUID. Also serves as the GUID of the contact tax details, since each contact has a single set of tax details.  | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the contact tax details are updated.  | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the contact tax details were created.  
     - name: _updatedDate | type: Date | description: Date and time the contact tax details were updated.  
     - name: taxExemptGroupId | type: string | description: GUID of the tax exempt group the contact is associated with. Setting this value makes the contact eligible for the group's tax exemption at checkout.  | validation: format GUID
     - name: contactDetails | type: ContactDetails | description: The contact's details, such as name, email, and VAT GUID.  Returned only when `CONTACT_DETAILS` is passed to the `fields` array in the request.  
        - name: firstName | type: string | description: Contact's first name.  | validation: maxLength 100
        - name: lastName | type: string | description: Contact's last name.  | validation: maxLength 100
        - name: company | type: string | description: Contact's company name.  | validation: maxLength 100
        - name: email | type: string | description: Contact's email address.  | validation: format EMAIL
        - name: vatId | type: string | description: Contact's VAT GUID. Read from the contact's `invoices.vatId` extended field, so it's empty unless that field is set on the contact.  | validation: maxLength 100
     - name: extendedFields | type: ExtendedFields | description: Custom field data for the contact tax details.  [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions.md) must be configured in the app dashboard before they can be accessed with API calls.  
        - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured.  You can only access fields for which you have the appropriate permissions.  Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md).  | validation: format map
     - name: tags | type: Tags | description: Tags associated with the contact tax details.  
        - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors.  
           - name: tagIds | type: array<string> | description: List of tag GUIDs.  | validation: maxItems 100, maxLength 5
        - name: publicTags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors.  
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in current page.  | validation: format int32
     - 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.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - 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

### queryContactTaxDetails
```javascript
import { contactTaxDetails } from '@wix/ecom';

async function queryContactTaxDetails(query,options) {
  const response = await contactTaxDetails.queryContactTaxDetails(query,options);
};
```

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

async function myQueryContactTaxDetailsMethod(query,options) {
  const elevatedQueryContactTaxDetails = auth.elevate(contactTaxDetails.queryContactTaxDetails);
  const response = await elevatedQueryContactTaxDetails(query,options);
}
```

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

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


async function queryContactTaxDetails(query,options) {
  const response = await myWixClient.contactTaxDetails.queryContactTaxDetails(query,options);
};
```

---