Browse documentation

On this page

Split a Tax into Components

Goal: one tax that users pick on a line, made of parts that are reported and remitted separately.

Use it when the parts are filed separately (US state, county and district shares; India's CGST and SGST), or a part's rate changes on its own schedule. Otherwise keep a single-rate tax: one rate, typed in, no components.

You need: permission to manage taxes; for the API, an access token and the usual headers (setup). The rates below are illustrative.

TaxComponent
Picked on document linesYesNo
RateTyped in, or the sum of its componentsOpening rate plus dated changes
On the documentOne line, one combined rateNot shown
In the tax report—One row per component

One component can be used by many taxes. Change its rate once and every tax that uses it follows.

In the app

  1. Go to Settings > Taxes and open the Components tab.
  2. Click + Component and fill in Name, Component Code and Rate.
  3. Optional: open Tax report details to change the Kind (a suggestion such as State or Central, or your own label), Country and Region. The country starts as your company's; these only group and filter the tax report.
  4. Click Save. Repeat for each part.
  5. Open the Taxes tab and click + Tax (or edit an existing tax).
  6. Turn on Split into components, then pick each part from Add a component. With two or more parts, use the arrows to set the order: documents list the parts in that order, and of two equal rates the first takes any rounding cent. Current rate shows the combined rate; it can't be typed while the tax is split.
  7. Click Save Tax.

You can also create a component without leaving the tax form: choose New component at the top of the Add a component list (or + Component if you have none yet).

Turning Split into components off again makes it a single-rate tax with a typed Tax Rate (%).

With the API

1. Create each component

Shell
curl -X POST $BASE/v1/taxes/components \
  -H "$AUTH" -H "$PARTNER" -H "$CT" \
  -d '{
    "code": "US-CA:state",
    "name": "California state",
    "kind": "state",
    "country_code": "US",
    "region": "US-CA",
    "rates": [ { "rate": "7.25" } ]
  }'

Endpoint reference: POST /v1/taxes/components →

Repeat for each part, for example US-CA:san-francisco:county at 0.25 (kind: "county") and US-CA:sf-transit:district at 1.25 (kind: "district"). Keep each response's id.

FieldRule
codeRequired. 1–120 of letters, digits, _ . : -. Unique in the company, otherwise TAX_COMPONENT_CODE_EXISTS. Not parsed: any naming scheme works.
nameRequired. Shown in the report.
kindRequired. Free lowercase label (a-z0-9_, up to 32), e.g. state, central, levy. Used for reporting only; never changes the calculation.
country_codeOptional. ISO 3166-1 alpha-2, uppercase. Format-checked only.
regionOptional. ISO 3166-2, e.g. US-CA. Needs country_code and must start with it.
ratesRequired. Exactly one entry without effective_from (the opening rate), at most one per date, up to 50. Rates are decimal strings.

Geography is optional. These are all valid components:

JSON
{ "code": "IN:CGST", "name": "Central GST", "kind": "central", "country_code": "IN", "rates": [ { "rate": "9" } ] }
{ "code": "IN-KA:SGST", "name": "Karnataka SGST", "kind": "state", "country_code": "IN", "region": "IN-KA", "rates": [ { "rate": "9" } ] }
{ "code": "ENV-LEVY", "name": "Environmental levy", "kind": "levy", "rates": [ { "rate": "0.5" } ] }

2. Create the tax with its components

Shell
curl -X POST $BASE/v1/taxes \
  -H "$AUTH" -H "$PARTNER" -H "$CT" \
  -d '{
    "tax_name": "Sales tax · San Francisco",
    "display_label": "SF sales tax",
    "tax_category": "sale",
    "tax_value": "0",
    "component_ids": ["<state id>", "<county id>", "<district id>"]
  }'

Endpoint reference: POST /v1/taxes →

  • The tax's rate is the sum of its components: 8.75% here. tax_value is required but ignored when component_ids is non-empty.
  • The order of component_ids is the order the parts are split and listed in.
  • tax_category is sale (invoices) or purchase (bills). Purchase taxes also take is_recoverable.

3. Use it like any tax

Put the tax's id in a line's item_tax, exactly as for a single-rate tax:

JSON
"item_tax": [ { "tax_id": "<tax id>" } ]

The document shows one tax line at the combined rate. Each line's tax is calculated at the combined rate, rounded, then shared across the components in proportion to their rates. A rounding cent goes to the largest remainder, so the parts always add up to the line's tax. On $1,000.00: $87.50 tax, posted as state $72.50, county $2.50 and district $12.50.

4. Read a tax's parts

GET /v1/taxes returns each tax with a components array: the parts in split order, each with component_id, component_code, component_name, component_kind, its rate today and its rates history. A single-rate tax returns an empty array.

JSON
{ "tax_name": "Sales tax · San Francisco", "tax_value": "8.75",
  "components": [ { "component_code": "US-CA:state", "component_name": "California", "rate": "7.25" } ] }

The list is the whole answer, so a screen can show what a tax is made of without a call per row or reading the component catalog. GET /v1/taxes/{id} returns the same array.

Change the components later

PUT /v1/taxes/{id} with component_ids:

SendResult
Field left outCurrent components kept
A listComponents replaced
[]Back to a single-rate tax using tax_value

Documents already saved keep the rates and split they were saved with.

Pitfalls

  • Don't encode rates in display_label ("SF tax 8.75%"). The rate changes over time; documents already show the applied rate.
  • Archiving a component is refused while a tax uses it (tax_count > 0). Remove it from those taxes first.

Next: Schedule a tax rate change →

Evaluate Paprel

Build in sandbox, launch with a production trial

Use sandbox for developer testing with no billing. When you are ready for real workflows, start production on a monthly plan with a 14-day free trial.

API-First Delivery
Audit-Ready Controls
Sandbox And Guided Rollout
We use cookies to improve your experience.

We use cookies and local storage for essential settings and, with your choices, analytics and advertising. Online identifiers and activity can be personal data. You can reject optional categories or change your choices.

These cookies are necessary for the basic functionality of the website, ensuring a seamless user experience. They cannot be disabled.