> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneshotagent.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tax lines

> Read document lines with their tax codes and VAT from your connected accounting system

## Overview

Read-only: no filing, posting or mail. Payment cursors retain state for 24 hours; other selections store nothing.

`oneshot_ledger_tax_lines` answers one record per document line.

QuickBooks and [Xero](https://docs.oneshotagent.com/api-reference/connections/accounting/tax-lines-xero.md); others refuse before payment: `unsupported_for_system`.

## Authentication

x402 `payment-signature` required. [Pricing](https://docs.oneshotagent.com/pricing.md).

## Request

| Field | Meaning |
| - | - |
| `connection_id` | Required. |
| `select` | One: `{ document_from, document_to }`, `{ document_ids }` (≤100), or `{ paid_from, paid_to }`. Dates are inclusive; payments match recorded, effective or reversal dates regardless of document date. |
| `document_types` | Any of `invoice`, `credit_note`, `bill`, `bill_credit`, `bank`, `journal`. Default: all. |
| `limit`, `cursor` | 1–100 lines (default 100); previous `next_cursor`, with the same `select`, `document_types` and `limit`. |

```json theme={null}
{ "connection_id": "5f4a3b2c-1d0e-4f9a-8b7c-6d5e4f3a2b1c", "select": { "document_from": "2026-07-01", "document_to": "2026-09-30" } }
```

## Response

Follow `next_cursor`, even on empty pages. Payment scans have no date cutoff (`window_margin_days: null`). Missing effective-date or reversal history leaves `selection_complete: false`, even finally. Empty incomplete results prove nothing. Expired cursors require restarting.

Payment scans refuse (`not_supported`) ≥1,000 transactions per type/date; paging provides no snapshot.

| Field | Meaning |
| - | - |
| `records[].id` | `<document id>:<line>`; bundle items: `<document id>:<line>.<item>`. |
| `records[].net`, `vat`, `gross` | In the ledger's home currency; `net` is before tax. Credits are negative. |
| `records[].vat` | Recorded VAT allocated in pennies; `null` when unavailable, never estimated or assumed zero. |
| `records[].rate` | The percentage the transaction recorded, not the code's current rate. |
| `records[].tax_evidence` | Recorded total/components; `allocation`: `transaction_allocation` or `unavailable`. |
| `records[].supply` | Valid service/shipping date; otherwise `none`. |
| `records[].document.settlement_history` | ≤20 distinct ids across observations/pages. Overflow: `incomplete`, `limit`, `observed_at_least: 21`, unknown `total`. Unread references or date/id selections: `read_incomplete`. |
| `records[].document.has_attachment`, `records[].account.class`, `total_documents` | `null`. |
| `unresolved_documents[]` | Missing/deleted/voided/forbidden documents with listed settlements; unlinked: `document: null`. No invented lines. |
| `tax_codes[]` | Current `code`, `name`, `rate`, `report_type`, `status`; multiple rates: `rate: null`. |

```json theme={null}
{
  "success": true,
  "data": {
    "records": [
      {
        "id": "130:1",
        "document": { "type": "invoice", "id": "130", "number": "INV-1037", "date": "2026-09-01", "currency": "GBP" },
        "tax_code": "5", "rate": 20, "net": 100, "vat": 20, "gross": 120, "direction": "sale",
        "supply": { "date": "2026-08-20", "evidence": "service_date" },
        "tax_evidence": { "allocation": "transaction_allocation", "transaction_vat": 20 }
      }
    ],
    "unresolved_documents": [],
    "tax_codes": [{ "code": "5", "name": "20.0% S", "rate": 20, "report_type": null, "status": "active" }],
    "total_documents": null,
    "window_margin_days": 0,
    "selection_complete": true
  }
}
```

## Errors

As [Accounting](https://docs.oneshotagent.com/api-reference/connections/accounting.md#errors).

`not_supported` (400): select other `document_ids`, narrow `document_types` or the window:

* Foreign-currency documents: exchange rate missing/not 1; no conversion.
* Tax-inclusive line amounts that do not add up to recorded taxable amounts.
* Bundles missing their item lines.

## VAT summary

`ledger_reports`, `type: "vat_summary"`: QuickBooks `TaxSummary` (France only), company accounting basis. Period: `from`/`to`; pagination: `limit`/`cursor`. Monetary columns become labelled rows; percentages excluded. Other systems refuse before payment.

## Payment evidence

`settlements_listed`: window matches. `settlements`: independent document history, including outside-window payments. Listing 600/document 500 stay separate. Incomplete history proves no payment proportion.

Method matching ignores case/outer spaces; `method_raw` stays unchanged:

| QuickBooks wording | Method |
| - | - |
| Cash | `cash` |
| Check, Cheque | `cheque` |
| Credit Card, CreditCard, Debit Card | `card` |
| Direct Debit, Giro, Standing Order | `giro_standing_order_direct_debit` |
| Absent or any other wording | `null` |

Cash, bank, card and cheque dates remain null without receipt, statement, voucher or both cheque dates. Credits use application dates. Explicit bounced-cheque status keeps a null reversal date. Expense/journal links and memos prove no bounce.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.