# Report invoices of orders paid in full

```http
POST https://secure.yoprint.com/v1/api/store/{team_slug}/report/tax
```

- API version: v1
- Operation ID: `v1_public_report_tax`
- Section: Reports › [Reports](https://developer.yoprint.com/reference/reports.md)
- Web page: https://developer.yoprint.com/reference/reports/v1-report-tax/
- Authentication: `Authorization: Bearer YOUR_API_KEY`

Returns the invoices of the sales orders that were paid in full in the period, with their tax, for cash-basis tax reporting.

An order counts in the period of its last payment or refund: it is included when it is fully paid now and its latest payment or refund was recorded in the period. A later transaction of any kind on a later UTC day moves it out of this period (to that later period when it is a payment or refund, to none otherwise).

Each row is formatted like the tax CSV export: amounts are decimal strings with 2 decimal places (`"24.75"`), dates are `YYYY-MM-DD` in your team's time zone, yes/no fields are `"TRUE"` or `"FALSE"`, and `order_id` and `invoice_id` are document **numbers**, not ids.

## Permission

Needs the View Reports permission. Otherwise 403 with a bare `{ "message": "Insufficient Permission" }` (no `success` or `error` envelope).

## Business rules

- Only sales orders whose `paid_amount` is at least their invoiced total are included, and only their current (v2) invoices are listed.
- An order counts in the period of a payment or refund made on the UTC calendar day of its last transaction of any kind: a later transaction on a later day removes it from this period. If that later transaction isn't a payment or refund (for example a payment from customer credit, or a failed card refund given back), the order appears in no period.
- Payments from customer credit never put an order into a period: only gateway, manual and Customer Portal payments and refunds do, including the share of a Customer Portal payment that paid several orders.

## Path parameters

- `team_slug` (string, required): Your team slug, shown as Team ID next to your API key in Profile. Example `your-team`.

## Request body

Content type `application/json`, required.

Fields:

- `end_date` (string (date-time), required): End of the period (ISO 8601), inclusive: send `23:59:59` to include the whole last day. In UTC, like `start_date` (an offset is dropped, not applied).
- `start_date` (string (date-time), required): Start of the period (ISO 8601), inclusive, to the second: send the start of the day. Send it in UTC (`Z`): the date and time are compared with UTC as written and any offset is dropped, so `2026-10-01T00:00:00-05:00` means midnight UTC.

### Example request

```bash
curl -X POST 'https://secure.yoprint.com/v1/api/store/your-team/report/tax' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'X-Yoprint-Decimal-Format: exact-v1' \
  -H 'Content-Type: application/json' \
  -d '{
    "end_date": "2026-11-30T23:59:59Z",
    "start_date": "2026-11-01T00:00:00Z"
  }'
```

## Response

`200` Successful response.

Fields:

- `data` (array of objects, required)
  - Each item:
    - `balance_due` (string | null, optional): Balance. A decimal string, such as `"0.00"`; parse it as a decimal.
    - `customer_contact_name` (string | null, optional)
    - `customer_email` (string | null, optional)
    - `customer_name` (string | null, optional)
    - `customer_tax_exempt` (string | null, optional): One of: `"TRUE"`, `"FALSE"`.
    - `delivery` (string | null, optional): Shipping. A decimal string, such as `"15.00"`; parse it as a decimal.
    - `discount` (string | null, optional): Discount. A decimal string, such as `"0.00"`; parse it as a decimal.
    - `invoice_id` (string | null, optional): The invoice **number**.
    - `issue_date` (string | null, optional): The invoice issue date, `YYYY-MM-DD`.
    - `jobs` (string | null, optional): One line per job, `JOB-<number> <name>`, joined with `\r\n`; null when no line has a job.
    - `last_payment_date` (string | null, optional): The date of the order's latest payment (money in), `YYYY-MM-DD` in the team's time zone; null when there is none.
    - `order_creator` (string | null, optional)
    - `order_customer_in_hand_date` (string | null, optional): `YYYY-MM-DD`, or empty.
    - `order_id` (string | null, optional): The order **number**.
    - `order_issue_date` (string | null, optional): `YYYY-MM-DD` in the team's time zone.
    - `order_name` (string | null, optional)
    - `order_status` (string | null, optional): The order status name.
    - `order_warehouse` (string | null, optional)
    - `paid` (string, optional): One of: `"TRUE"`, `"FALSE"`.
    - `paid_amount` (string | null, optional): Paid. A decimal string, such as `"339.75"`; parse it as a decimal.
    - `shipping_address1` (string | null, optional): Ship To fields: `shipping_label`, `shipping_address1`, `shipping_address2`, `shipping_city`, `shipping_state`, `shipping_state_code`, `shipping_country`, `shipping_country_code`, `shipping_postcode`.
    - `subtotal` (string | null, optional): Subtotal, 2 decimal places. A decimal string, such as `"300.00"`; parse it as a decimal.
    - `tax` (string | null, optional): Tax. A decimal string, such as `"24.75"`; parse it as a decimal.
    - `tax_percentage` (string | null, optional): The tax rate in percent, as text (for example `8.25`), or null when it can't be stated.
    - `total` (string | null, optional): Total. A decimal string, such as `"339.75"`; parse it as a decimal.
- `status` (integer, required)
- `success` (boolean, required)

Example response:

```json
{
  "data": [
    {
      "balance_due": "0.00",
      "customer_contact_name": "Alex Rivera",
      "customer_email": "alex@example.com",
      "customer_name": "Northwind Apparel",
      "customer_tax_exempt": "FALSE",
      "delivery": "15.00",
      "discount": "0.00",
      "invoice_id": "998",
      "issue_date": "2026-10-28",
      "jobs": "JOB-2410 Staff hoodies",
      "last_payment_date": "2026-11-12",
      "order_creator": "Alex Rivera",
      "order_customer_in_hand_date": "2026-11-06",
      "order_id": "SO0998",
      "order_issue_date": "2026-10-28",
      "order_name": "Staff hoodies",
      "order_status": "Completed",
      "order_warehouse": null,
      "paid": "TRUE",
      "paid_amount": "339.75",
      "shipping_address1": "100 Example Street",
      "subtotal": "315.00",
      "tax": "24.75",
      "tax_percentage": "8.25",
      "total": "339.75"
    }
  ],
  "status": 200,
  "success": true
}
```

## Errors

- `401` The API key is missing or wrong (`unauthenticated`).
- `403` You are not allowed to do this. `api_access_not_in_plan`: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only `{"message": "Insufficient Permission"}`. Other refusals use the error envelope, with `unauthorized` or `user_is_not_authorized`.
  - When: Your role lacks View Reports. Fix: Ask the team owner to turn on View Reports for your permission group.
- `404` Not found. `page_not_found`: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's. `code: null`, with a message that starts "No query results for": there is no record with that id.
- `422` The request was refused and changed nothing. `validation_failed` lists what to fix in `error.fields`; other codes name a business rule, explained in `error.message`. A few checks answer with only `{"message": "..."}`. An operation that calls another service (a payment provider, a carrier, an accounting app) can answer `connect_timeout` ("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.
  - When: `start_date` or `end_date` is missing or not ISO 8601. Fix: Send both as ISO 8601 date-times.

## Notes

- There is no paging: the whole period comes back in one response. Ask for a month or less at a time.
- An order that becomes unpaid again (for example after a refund) drops out of earlier periods, so a re-run report can differ.

## Related

- [Report payments and refunds](https://developer.yoprint.com/reference/reports/v1-report-payment.md): `POST /v1/api/store/{team_slug}/report/payment`
- [List invoices (v1)](https://developer.yoprint.com/reference/invoices/v1-invoice-index.md): `GET /v1/api/store/{team_slug}/invoice`
