> 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

# ListTaxDocuments

# Package: wixPaymentsProvider

# Namespace: TaxDocumentsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/payments/wix-payments-provider/tax-documents/list-tax-documents.md

## Permission Scopes:
Managing tax tax documents: SCOPE.PAYMENTS.MANAGE-TAX-DOCUMENTS

## Introduction

Retrieves a list of tax documents that belong to a Wix Payments account.

You must specify the `accountId` of the account whose tax documents you want to retrieve.

Tax documents are sorted in descending order by `period`, then by `createdDate`.

When `type` is omitted, tax documents of all types are returned.

---

## REST API

### Schema

```
 Method: listTaxDocuments
 Description: Retrieves a list of tax documents that belong to a Wix Payments account.  You must specify the `accountId` of the account whose tax documents you want to retrieve.  Tax documents are sorted in descending order by `period`, then by `createdDate`.  When `type` is omitted, tax documents of all types are returned.
 URL: https://www.wixapis.com/payments/platform/v1/tax-documents
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  accountId
 Method parameters: 
   query param name: accountId | type: accountId | description: GUID of the Wix Payments account whose tax documents are retrieved. | required: true | validation: format GUID
   param name: paging | type: CursorPaging    
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
   param name: type | type: TaxDocumentType | description: Type of tax document.  
      - enum:
           FORM_1099_K - US IRS Form 1099-K.
 Return type: ListTaxDocumentsResponse
  - name: taxDocuments | type: array<TaxDocument> | description: Retrieved tax documents.  
     - name: id | type: string | description: Tax document GUID.  | read-only: true | validation: format GUID
     - name: createdDate | type: string | description: Date and time the tax document was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the tax document was last updated.  | read-only: true | validation: format date-time
     - name: revision | type: string | description: Revision number, which increments by 1 each time the tax document is updated.  | read-only: true 
     - name: accountId | type: string | description: GUID of the Wix Payments account the tax document belongs to.  | validation: format GUID, immutable
     - name: type | type: TaxDocumentType | description: Type of tax document.  | validation: immutable
         - enum:
         -     FORM_1099_K: US IRS Form 1099-K.
     - name: period | type: TaxPeriod | description: Period the tax document covers.  | validation: immutable
        - ONE-OF: 
           - name: yearPeriod | type: YearPeriod | description: The tax document covers a full calendar year.  
              - name: year | type: integer | description: Calendar year the tax document covers. For example, `2024`.  
     - name: downloadable | type: boolean | description: Whether a file is available to download for the tax document. When `false`, calling Generate File Download Info returns an error.  At least one of `downloadable` and `problematic` is always `true`.  
     - name: problematic | type: boolean | description: Whether a problem was found with the tax document's file, for example incorrect data that's being corrected.  At least one of `downloadable` and `problematic` is always `true`, and both can be `true` at the same time.  
     - name: sourceType | type: SourceType | description: How the tax document's amounts are aggregated.  | read-only: true 
         - enum:
         -     PAYMENT: Amounts are aggregated by payment date.
         -     PAYOUT: Amounts are aggregated by payout date.
     - name: displayName | type: string | description: Human-readable name for the tax document's file.  | read-only: true | validation: minLength 1, maxLength 1000
  - name: pagingMetadata | type: PagingMetadataV2 | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 16000


```

### Examples

### List a Wix Payments account's tax documents
Retrieves the tax documents of a Wix Payments account, filtered by type.

```curl
curl -X GET \
'https://www.wixapis.com/payments/platform/v1/tax-documents?accountId=c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f&type=FORM_1099_K' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.payments.taxDocuments.listTaxDocuments(accountId, options)
 Description: Retrieves a list of tax documents that belong to a Wix Payments account.  You must specify the `accountId` of the account whose tax documents you want to retrieve.  Tax documents are sorted in descending order by `period`, then by `createdDate`.  When `type` is omitted, tax documents of all types are returned.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  accountId
 Method parameters: 
   param name: accountId | type: string | description: GUID of the Wix Payments account whose tax documents are retrieved. | required: true | validation: format GUID
   param name: options | type: ListTaxDocumentsOptions  none  
        - name: paging | type: CursorPaging | description: Cursor paging options.  
           - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, maximum 100, format int32
           - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  You can get the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: type | type: TaxDocumentType | description: Filters the retrieved tax documents by type. When omitted, tax documents of all types are returned.  
             - enum:
             -     FORM_1099_K: US IRS Form 1099-K.
 Return type: PROMISE<ListTaxDocumentsResponse>
  - name: taxDocuments | type: array<TaxDocument> | description: Retrieved tax documents.  
     - name: _id | type: string | description: Tax document GUID.  | read-only: true | validation: format GUID
     - name: _createdDate | type: Date | description: Date and time the tax document was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the tax document was last updated.  | read-only: true 
     - name: revision | type: string | description: Revision number, which increments by 1 each time the tax document is updated.  | read-only: true 
     - name: accountId | type: string | description: GUID of the Wix Payments account the tax document belongs to.  | validation: format GUID, immutable
     - name: type | type: TaxDocumentType | description: Type of tax document.  | validation: immutable
         - enum:
         -     FORM_1099_K: US IRS Form 1099-K.
     - name: period | type: TaxPeriod | description: Period the tax document covers.  | validation: immutable
        - ONE-OF: 
           - name: yearPeriod | type: YearPeriod | description: The tax document covers a full calendar year.  
              - name: year | type: integer | description: Calendar year the tax document covers. For example, `2024`.  
     - name: downloadable | type: boolean | description: Whether a file is available to download for the tax document. When `false`, calling Generate File Download Info returns an error.  At least one of `downloadable` and `problematic` is always `true`.  
     - name: problematic | type: boolean | description: Whether a problem was found with the tax document's file, for example incorrect data that's being corrected.  At least one of `downloadable` and `problematic` is always `true`, and both can be `true` at the same time.  
     - name: sourceType | type: SourceType | description: How the tax document's amounts are aggregated.  | read-only: true 
         - enum:
         -     PAYMENT: Amounts are aggregated by payment date.
         -     PAYOUT: Amounts are aggregated by payout date.
     - name: displayName | type: string | description: Human-readable name for the tax document's file.  | read-only: true | validation: minLength 1, maxLength 1000
  - name: pagingMetadata | type: PagingMetadataV2 | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  
     - name: cursors | type: Cursors | description: Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used.  
        - name: next | type: string | description: Cursor pointing to next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to previous page in the list of results.  | validation: maxLength 16000


```

### Examples

### listTaxDocuments
```javascript
import { taxDocuments } from '@wix/payments';

async function listTaxDocuments(accountId,options) {
  const response = await taxDocuments.listTaxDocuments(accountId,options);
};
```

### listTaxDocuments (with elevated permissions)
```javascript
import { taxDocuments } from '@wix/payments';
import { auth } from '@wix/essentials';

async function myListTaxDocumentsMethod(accountId,options) {
  const elevatedListTaxDocuments = auth.elevate(taxDocuments.listTaxDocuments);
  const response = await elevatedListTaxDocuments(accountId,options);
}
```

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

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


async function listTaxDocuments(accountId,options) {
  const response = await myWixClient.taxDocuments.listTaxDocuments(accountId,options);
};
```

---