Zoey REST API reference ยท Interactive version: apidocs.zoey.com

Tax

Tax: Rate

Get All

GET https://container-url.zoeysite.com/api/rest/tax/rate/?filter[0][attribute]=tax_country_id&filter[0][eq]=US

Tax rates (Admin > Settings > Tax > Tax Zones and Rates). Takes the usual limit, page, order, dir and filter[0][attribute] / filter[0][eq].

A tax rate is a country + region + zip code (or zip range) with a rate percent. It does nothing until a tax rule uses it (Tax / Rule).

Field Type Description
tax_calculation_rate_id integer Rate ID
code string Tax identifier
tax_country_id string Two-letter country code
tax_region_id integer Region (state) ID. 0 means every region.
tax_postcode string Zip code, * for every zip, or from-to for a range
zip_is_range integer 1 when the rate covers a zip range
zip_from string Start of the zip range
zip_to string End of the zip range
rate number Rate percent
titles array Store titles: [{"store_id": 1, "title": "NY Sales Tax"}]

Query parameters:

NameExampleNotes
filter[0][attribute]tax_country_id
filter[0][eq]USTwo-letter country code

Get

GET https://container-url.zoeysite.com/api/rest/tax/rate/:tax_rate_id

One tax rate, with the same fields as Get All.

Create

POST https://container-url.zoeysite.com/api/rest/tax/rate/

Creates a tax rate. It does nothing until a tax rule uses it (Tax / Rule / Create).

Field Type Required Description
code string Yes Tax identifier, e.g. "US-NY-10001"
tax_country_id string Yes Two-letter country code
rate number Yes Rate percent, 0 or more
tax_region_id integer No Region (state) ID. Leave out or 0 for every region.
tax_postcode string No Zip code, or * for every zip
zip_is_range integer No 1 to use a zip range instead of tax_postcode
zip_from string With zip_is_range Start of the range (digits, max 9)
zip_to string With zip_is_range End of the range (digits, max 9, not less than zip_from)
titles array No Store titles: [{"store_id": 1, "title": "NY Sales Tax"}]

Example request body:

{
    "code": "US-NY-10001",
    "tax_country_id": "US",
    "tax_region_id": 43,
    "tax_postcode": "10001",
    "rate": 8.875,
    "titles": [
        {
            "store_id": 1,
            "title": "NY Sales Tax"
        }
    ]
}

Update

PUT https://container-url.zoeysite.com/api/rest/tax/rate/:tax_rate_id

Only the fields sent change. titles replaces all store titles when sent and is kept when left out.

Field Type Required Description
code string No Tax identifier
tax_country_id string No Two-letter country code
tax_region_id integer No Region (state) ID, 0 for every region
tax_postcode string No Zip code, or * for every zip
zip_is_range integer No 1 to use a zip range
zip_from string No Start of the range
zip_to string No End of the range
rate number No Rate percent
titles array No Store titles: [{"store_id": 1, "title": "NY Sales Tax"}]

Example request body:

{
    "rate": 8.5
}

Delete

DELETE https://container-url.zoeysite.com/api/rest/tax/rate/:tax_rate_id

Deletes a tax rate. A rate used by a tax rule can't be deleted: remove it from the rule first (Tax / Rule / Update).