Skip to content

Report invoices of orders paid in full

Open .md

POST/v1/api/store/{team_slug}/report/tax

v1Operation ID v1_public_report_tax

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_slugstringrequired

    Your team slug, shown as Team ID next to your API key in Profile.

    • Example your-team

Request body

application/json, required.

  • end_datestring (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_datestring (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.

Response

200Successful response.

  • dataarray of objectsrequired
    Fields of each item (25)
    • balance_duestring | null

      Balance. A decimal string, such as "0.00"; parse it as a decimal.

    • customer_emailstring | null
    • customer_namestring | null
    • customer_tax_exemptstring | null
      • One of: "TRUE", "FALSE"
    • deliverystring | null

      Shipping. A decimal string, such as "15.00"; parse it as a decimal.

    • discountstring | null

      Discount. A decimal string, such as "0.00"; parse it as a decimal.

    • invoice_idstring | null

      The invoice number.

    • issue_datestring | null

      The invoice issue date, YYYY-MM-DD.

    • jobsstring | null

      One line per job, JOB-<number> <name>, joined with \r\n; null when no line has a job.

    • last_payment_datestring | null

      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_creatorstring | null
    • YYYY-MM-DD, or empty.

    • order_idstring | null

      The order number.

    • order_issue_datestring | null

      YYYY-MM-DD in the team's time zone.

    • order_namestring | null
    • order_statusstring | null

      The order status name.

    • order_warehousestring | null
    • paidstring
      • One of: "TRUE", "FALSE"
    • paid_amountstring | null

      Paid. A decimal string, such as "339.75"; parse it as a decimal.

    • shipping_address1string | null

      Ship To fields: shipping_label, shipping_address1, shipping_address2, shipping_city, shipping_state, shipping_state_code, shipping_country, shipping_country_code, shipping_postcode.

    • subtotalstring | null

      Subtotal, 2 decimal places. A decimal string, such as "300.00"; parse it as a decimal.

    • taxstring | null

      Tax. A decimal string, such as "24.75"; parse it as a decimal.

    • tax_percentagestring | null

      The tax rate in percent, as text (for example 8.25), or null when it can't be stated.

    • totalstring | null

      Total. A decimal string, such as "339.75"; parse it as a decimal.

  • statusintegerrequired
  • successbooleanrequired

Errors

  • 401The API key is missing or wrong (unauthenticated).

  • 403You 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.
  • 404Not 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.

  • 422The 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.