> 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

# CountContactTaxDetails

# Package: tax

# Namespace: ContactTaxDetailsService

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

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

## Introduction

Counts the contact tax details that match the provided filter.

For example, count the number of contacts associated with a specific tax exempt group.

---

## REST API

### Schema

```
 Method: countContactTaxDetails
 Description: Counts the contact tax details that match the provided filter.  For example, count the number of contacts associated with a specific tax exempt group.
 URL: https://www.wixapis.com/billing/v1/contact-tax-details/count
 Method: POST
 Method parameters:
   param name: filter | type: filter | description: Filter object. 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) for more information.  
 Return type: CountContactTaxDetailsResponse
  - name: count | type: integer | description: Number of contact tax details that match the filter.  

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: TOO_MANY_TO_COUNT | Description: Number of contact tax details exceeds the server's limit.


```

### Examples

### Count Contact Tax Details
Counts the contact tax details that match the provided filter, for example the number of contacts in a tax exempt group.

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

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.ecom.contactTaxDetails.countContactTaxDetails(options)
 Description: Counts the contact tax details that match the provided filter.  For example, count the number of contacts associated with a specific tax exempt group.
 Method parameters:
   param name: options | type: CountContactTaxDetailsOptions  none  
        - name: filter | type: object | description: Filter object. 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) for more information.  
 Return type: PROMISE<CountContactTaxDetailsResponse>
  - name: count | type: integer | description: Number of contact tax details that match the filter.  

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: TOO_MANY_TO_COUNT | Description: Number of contact tax details exceeds the server's limit.


```

### Examples

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

async function countContactTaxDetails(options) {
  const response = await contactTaxDetails.countContactTaxDetails(options);
};
```

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

async function myCountContactTaxDetailsMethod(options) {
  const elevatedCountContactTaxDetails = auth.elevate(contactTaxDetails.countContactTaxDetails);
  const response = await elevatedCountContactTaxDetails(options);
}
```

### countContactTaxDetails (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 countContactTaxDetails(options) {
  const response = await myWixClient.contactTaxDetails.countContactTaxDetails(options);
};
```

---