> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/api-reference/reference/accounting.md).

# Accounting

## Retrieve accounting payments list

> Extract information about accounting payments with filtering and pagination options.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/payments/":{"get":{"tags":["Accounting"],"summary":"Retrieve accounting payments list","description":"Extract information about accounting payments with filtering and pagination options.","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Status","in":"query","description":"Payment status filter. Possible values: ALL, PAID, PARTIAL_PAID, UNPAID, CANCELED","required":false,"style":"form","explode":true,"schema":{"type":"string","enum":["ALL","PAID","PARTIAL_PAID","UNPAID","CANCELED"],"default":"ALL"}},{"name":"InvoiceDate","in":"query","description":"Invoice date interval filter. Possible values: anytime, today, yesterday, last7Days, last30Days, currentMonth, lastMonth, lastYear, custom","required":false,"style":"form","explode":true,"schema":{"type":"string","enum":["anytime","today","yesterday","last7Days","last30Days","currentMonth","lastMonth","lastYear","custom"],"default":"last30Days"}},{"name":"InvoiceDateStartDate","in":"query","description":"Invoice date start date (required when InvoiceDate is \"custom\"). Format: YYYY-MM-DD","required":false,"style":"form","explode":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"InvoiceDateEndDate","in":"query","description":"Invoice date end date (required when InvoiceDate is \"custom\"). Format: YYYY-MM-DD","required":false,"style":"form","explode":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"PaidOn","in":"query","description":"Paid on interval filter. Possible values: anytime, today, yesterday, last7Days, last30Days, currentMonth, lastMonth, lastYear, custom","required":false,"style":"form","explode":true,"schema":{"type":"string","enum":["anytime","today","yesterday","last7Days","last30Days","currentMonth","lastMonth","lastYear","custom"],"default":"anytime"}},{"name":"PaidOnStartDate","in":"query","description":"Paid on start date (required when PaidOn is \"custom\"). Format: YYYY-MM-DD","required":false,"style":"form","explode":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"PaidOnEndDate","in":"query","description":"Paid on end date (required when PaidOn is \"custom\"). Format: YYYY-MM-DD","required":false,"style":"form","explode":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"TransactionType","in":"query","description":"Transaction type filter. Possible values: ALL, SALES, SERVICES, ADJUSTMENTS, DISPUTES, ROLLING_RESERVE, AFF_COMM, PO","required":false,"style":"form","explode":true,"schema":{"type":"string","enum":["ALL","SALES","SERVICES","ADJUSTMENTS","DISPUTES","ROLLING_RESERVE","AFF_COMM","PO"],"default":"ALL"}},{"name":"Page","in":"query","description":"Page number for pagination. Default value is 1.","required":false,"style":"form","explode":true,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"Limit","in":"query","description":"Number of results per page. Default value is 100. Maximum value is 200.","required":false,"style":"form","explode":true,"schema":{"type":"integer","minimum":1,"maximum":200,"default":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"Data":{"type":"array","items":{"type":"object","properties":{"InvoiceType":{"type":"string","description":"Type of invoice"},"DueDate":{"type":"string","format":"date","description":"Due date of the payment"},"PaidOn":{"type":"string","format":"date","nullable":true,"description":"Date when payment was made"},"Status":{"type":"string","description":"Payment status label"},"Amount":{"type":"number","format":"double","description":"Total amount"},"Currency":{"type":"string","description":"Currency code"},"Balance":{"type":"number","format":"double","description":"Remaining balance"},"Downloads":{"type":"object","description":"Available download links for this payment record","nullable":true,"properties":{"Html":{"type":"string","nullable":true,"description":"Download URL for the HTML invoice (Automatic invoice records only)"},"Xml":{"type":"string","nullable":true,"description":"Download URL for the XML invoice (Automatic invoice records only, excluding certain types)"},"Invoice":{"type":"string","nullable":true,"description":"Download URL for the PDF invoice"},"Orders":{"type":"string","nullable":true,"description":"Download URL for the orders CSV (RRT_FEE and CHARGEBACK_FEES types only)"}}},"Actions":{"type":"array","description":"Available actions for this payment","items":{"type":"object","properties":{"Website":{"type":"string","description":"Website URL"},"PeriodStart":{"type":"string","format":"date","description":"Period start date"},"PeriodEnd":{"type":"string","format":"date","description":"Period end date"},"PeriodCurrency":{"type":"string","description":"Period currency code"},"ConvertedAmount":{"type":"number","format":"double","description":"Converted amount"},"ConvertedCurrency":{"type":"string","description":"Converted currency code"},"DownloadLinks":{"type":"object","description":"Available download links","properties":{"ProductsOverview":{"type":"string","description":"Products overview download URL"},"ProductsReport":{"type":"string","description":"Products report download URL"},"OrdersOverview":{"type":"string","description":"Orders overview download URL"},"ChargebacksReport":{"type":"string","nullable":true,"description":"Disputed orders balance CSV download URL (CBKFUND_FREE and CBKFUND_HOLD types only)"}}}}}}}}},"Pagination":{"type":"object","properties":{"Page":{"type":"integer","description":"Current page number"},"Limit":{"type":"integer","description":"Number of results per page"},"Count":{"type":"integer","description":"Total number of payments matching the criteria"}}}}}}}},"400":{"description":"Invalid data - validation error","content":{"application/json":{"schema":{"type":"object","properties":{"error_code":{"type":"string","description":"Validation error code","enum":["ACCOUNTING_PAYMENTS_STATUS_CHOICE_VALIDATOR","ACCOUNTING_PAYMENTS_INVOICE_DATE_CHOICE_VALIDATOR","ACCOUNTING_PAYMENTS_INVOICE_DATE_START_DATE_REGEX_VALIDATOR","ACCOUNTING_PAYMENTS_INVOICE_DATE_END_DATE_REGEX_VALIDATOR","ACCOUNTING_PAYMENTS_PAID_ON_CHOICE_VALIDATOR","ACCOUNTING_PAYMENTS_PAID_ON_START_DATE_REGEX_VALIDATOR","ACCOUNTING_PAYMENTS_PAID_ON_END_DATE_REGEX_VALIDATOR","ACCOUNTING_PAYMENTS_TRANSACTION_TYPE_CHOICE_VALIDATOR","ACCOUNTING_PAYMENTS_PAID_ON_ALLOWED_FOR_STATUS_VALIDATOR"]},"message":{"type":"string","description":"Detailed validation error message"}}}}}}}}}}}
```

## Download a payment-related file

> Downloads a file associated with an accounting payment record using a signed token.\
> Tokens are obtained from the \`Downloads\` field in the \`/accounting/payments/\` response.\
> Supported download types: \`html\` (HTML invoice), \`xml\` (XML invoice), \`pdf\` (PDF invoice), \`orders\` (CSV fee details), \`file\` (static report files from Actions).<br>

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/accounting/payments/download/":{"get":{"tags":["Accounting"],"summary":"Download a payment-related file","description":"Downloads a file associated with an accounting payment record using a signed token.\nTokens are obtained from the `Downloads` field in the `/accounting/payments/` response.\nSupported download types: `html` (HTML invoice), `xml` (XML invoice), `pdf` (PDF invoice), `orders` (CSV fee details), `file` (static report files from Actions).\n","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string"},"description":"Signed download token obtained from the Downloads or DownloadLinks field of a payment record. No authentication header is required — the signed token is the sole authentication mechanism."}],"responses":{"200":{"description":"File content","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}},"text/xml":{"schema":{"type":"string","format":"binary"}},"text/html":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Missing or unsupported token","content":{"application/json":{"schema":{"type":"object","properties":{"error_code":{"type":"string","enum":["MISSING_TOKEN","UNSUPPORTED_DOWNLOAD_TYPE"]},"message":{"type":"string"}}}}}},"403":{"description":"Invalid or expired token","content":{"application/json":{"schema":{"type":"object","properties":{"error_code":{"type":"string","enum":["INVALID_TOKEN"]},"message":{"type":"string"}}}}}},"404":{"description":"Requested file not found","content":{"application/json":{"schema":{"type":"object","properties":{"error_code":{"type":"string","enum":["HTML_NOT_FOUND","FILE_ACCESS_DENIED","XML_NOT_FOUND","INVOICE_NOT_FOUND"]},"message":{"type":"string"}}}}}}}}}}}
```

## Retrieve payouts

> Retrieve list of payouts for your merchant account and their status.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/payouts/":{"get":{"tags":["Accounting"],"summary":"Retrieve payouts","description":"Retrieve list of payouts for your merchant account and their status.","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Reference","in":"query","description":"InvoicePrefix (PREFIX) + InvoiceNo (00000) will search for transfers containing an invoice with prefix + number","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"Status","in":"query","description":"Payout status. Array of strings. Possible values: PAID,PARTIALLY_PAID,CANCELED","required":false,"style":"form","explode":true,"schema":{"type":"string","enum":["PAID","PARTIALLY_PAID","CANCELED"]}},{"name":"Currency","in":"query","description":"3 letter ISO currency code","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"StartDate","in":"query","description":"Start payment date. Format: yyyy-mm-dd","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"EndDate","in":"query","description":"End payment date. Format: yyyy-mm-dd","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"PaymentType","in":"query","description":"Payment type. Can be one of \"WIRE\", \"PAYPAL\", \"CHECK\", \"PAYONEER\", \"WEBMONEY\" or \"INTERNATIONAL_WIRE\"","required":false,"style":"form","explode":true,"schema":{"type":"string","enum":["WIRE","PAYPAL","CHECK","PAYONEER","WEBMONEY","INTERNATIONAL_WIRE"]}},{"name":"OrderBy","in":"query","description":"This parameter orders payouts. The only parameter allowed is \"TransferCompletionDate\". The preceding \"-\" sign means order by DESC, ommit it for searching ASC","required":false,"style":"form","explode":true,"schema":{"type":"string","enum":["TransferCompletionDate","-TransferCompletionDate"]}},{"name":"Page","in":"query","description":"Page number","required":false,"style":"form","explode":true,"schema":{"type":"integer"}},{"name":"Limit","in":"query","description":"Number of results on a page","required":false,"style":"form","explode":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Search payouts object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchPayouts"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"SearchPayouts":{"type":"object","properties":{"Items":{"type":"array","items":{"$ref":"#/components/schemas/SearchPayoutsItems"}},"Pagination":{"$ref":"#/components/schemas/Pagination"}}},"SearchPayoutsItems":{"type":"object","properties":{"TransferCompletionDate":{"type":"string"},"PaymentType":{"type":"string"},"Amount":{"type":"number"},"TotalSales":{"type":"number"},"TotalFees":{"type":"number"},"TotalRefunds":{"type":"number"},"Currency":{"type":"string"},"Status":{"type":"string"},"Invoices":{"type":"array","items":{"$ref":"#/components/schemas/SearchPayoutsInvoices"}},"Summary":{"$ref":"#/components/schemas/SearchPayoutsItems_Summary"}}},"SearchPayoutsInvoices":{"type":"object","properties":{"Reference":{"type":"string"},"Amount":{"type":"number"},"Description":{"type":"string"},"Type":{"type":"string"},"Code":{"type":"string"},"Date":{"type":"string"},"PaidAmount":{"type":"number"},"PaidDate":{"type":"string"},"PaidCurrency":{"type":"string"},"RetainedAmount":{"type":"number"},"ReleasedAmount":{"type":"number"}}},"SearchPayoutsItems_Summary":{"type":"object","properties":{"ServicesAmount":{"type":"number"},"PurchaseOrdersAmount":{"type":"number"},"ChargeBacksAmount":{"type":"number"},"RollingReserveAmount":{"type":"number"},"PeriodNetSales":{"type":"number"},"VendorToVendor":{"type":"number"},"ChargeBackFund":{"type":"number"}}},"Pagination":{"type":"object","properties":{"Page":{"type":"integer","description":"Number of pages used for displaying the results."},"Limit":{"type":"integer","description":"Limitation of the result numbers."},"Count":{"type":"integer","description":"Total number of results."}}},"ErrorResponse":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## Retrieve account balance

> Retrieve the account balance situation for your merchant account.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/payouts/pending/":{"get":{"tags":["Accounting"],"summary":"Retrieve account balance","description":"Retrieve the account balance situation for your merchant account.","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Currency","in":"query","description":"Use this parameter to show the balance only for a single order currency. If not sent, or sent as NULL, 2Checkout sends the balance for all order currencies","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"TotalCurrency","in":"query","description":"Use this parameter to show the total account balance in the preferred currency. If not sent, or sent as NULL, 2Checkout sends the total balance in the default account currency","required":false,"style":"form","explode":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Pending payout object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingPayouts"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"PendingPayouts":{"type":"object","properties":{"Currencies":{"type":"array","items":{"$ref":"#/components/schemas/PendingPayoutsCurrencies"}},"Total":{"$ref":"#/components/schemas/PendingPayouts_Total"}}},"PendingPayoutsCurrencies":{"type":"object","properties":{"Currency":{"type":"string"},"OrdersTotal":{"$ref":"#/components/schemas/PendingPayoutsCurrencies_OrdersTotal"},"RetainedToDisputesBalance":{"type":"number","description":"Amounts retained to your dispute balance reports, in the object order currency."},"ReleasedFromDisputesBalance":{"type":"number","description":"Amounts released from your dispute balance reports, in the object order currency."},"RetainedToRollingReserveBalance":{"type":"number","description":"Amounts retained to your rolling reserve, in the object order currency."},"ReleasedFromRollingReserveBalance":{"type":"number","description":"Amounts retained to your rolling reserve, in the object order currency"},"ChargebackFees":{"type":"number","description":"Chargeback fees retained in the object order currency."},"ProcessingFees":{"type":"number","description":"Processing fees retained by 2Checkout in the object order currency."},"AffiliatesCommission":{"type":"number","description":"Affiliate commissions paid by 2Checkout in the object order currency."},"TaxCollected":{"type":"number","description":"Tax collected by 2Checkout in the object order currency."},"EstimatedTotalRevenue":{"type":"number","description":"The estimated total revenue for the object order currency."}}},"PendingPayoutsCurrencies_OrdersTotal":{"type":"object","properties":{"estore":{"type":"number"},"affilietes":{"type":"number"},"partner":{"type":"number"},"total":{"type":"number"}}},"PendingPayouts_Total":{"type":"object","properties":{"Currency":{"type":"string","description":"Currency used for expressing the account balance. If not sent in the API call, 2Checkout uses the account default currency."},"OrdersTotal":{"$ref":"#/components/schemas/PendingPayouts_Total_OrdersTotal"},"RetainedToDisputesBalance":{"type":"number","description":"Total amounts retained to your dispute balance during the current payout cycle."},"ReleasedFromDisputesBalance":{"type":"number"},"RetainedToRollingReserveBalance":{"type":"number","description":"Total amounts retained to your rolling reserve during the current payout cycle."},"ReleasedFromRollingReserveBalance":{"type":"number"},"ChargebackFees":{"type":"number","description":"Total chargeback fees retained from your account during the currency payout cycle."},"ProcessingFees":{"type":"number","description":"Total processing fees retained by 2Checkout during the current payout cycle."},"AffiliatesCommission":{"type":"number","description":"Total affiliates commissions paid by 2Checkout during the current payout cycle."},"TaxCollected":{"type":"number","description":"Total tax amount collected by 2Checkout during the current payout cycle."},"EstimatedTotalRevenue":{"type":"number","description":"Total estimated revenue for the current payout cycle."}}},"PendingPayouts_Total_OrdersTotal":{"type":"object","properties":{"estore":{"type":"number","description":"Amounts from total eStore orders during the currency payout cycle."},"affilietes":{"type":"number"},"partner":{"type":"number","description":"Amounts from total partner orders during the currency payout cycle."},"total":{"type":"number","description":"Total sales amount during the currency payout cycle."}}},"ErrorResponse":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.2checkout.com/api-reference/reference/accounting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
