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

Tax

Tax: Rule

Get All

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

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

A tax rule applies its rates to orders whose customer tax class and product tax class are in the rule.

Field Type Description
tax_calculation_rule_id integer Rule ID
code string Rule name
priority integer Rules with the same priority add up; a lower priority applies first
position integer Sort order
calculate_subtotal integer 1 to calculate off the subtotal only
skip_shipping_tax integer 1 to not tax shipping
customer_tax_class_ids array Customer tax class IDs (Tax / Class, class_type CUSTOMER)
product_tax_class_ids array Product tax class IDs (Tax / Class, class_type PRODUCT)
tax_rate_ids array Tax rate IDs (Tax / Rate)

Get

GET https://container-url.zoeysite.com/api/rest/tax/rule/:tax_rule_id

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

Create

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

Creates a tax rule. Find the IDs with Tax / Class / Get All and Tax / Rate / Get All. Each rate + customer class + product class combination can be in one rule only.

Field Type Required Description
code string Yes Rule name
customer_tax_class_ids array Yes Customer tax class IDs (class_type CUSTOMER)
product_tax_class_ids array Yes Product tax class IDs (class_type PRODUCT)
tax_rate_ids array Yes Tax rate IDs
priority integer No Rules with the same priority add up; a lower priority applies first. Default 0.
position integer No Sort order. Default 0.
calculate_subtotal integer No 1 to calculate off the subtotal only. Default 0.
skip_shipping_tax integer No 1 to not tax shipping. Default 0.

Example request body:

{
    "code": "Retail - NY",
    "priority": 0,
    "position": 0,
    "calculate_subtotal": 0,
    "skip_shipping_tax": 0,
    "customer_tax_class_ids": [
        3
    ],
    "product_tax_class_ids": [
        2
    ],
    "tax_rate_ids": [
        5
    ]
}

Update

PUT https://container-url.zoeysite.com/api/rest/tax/rule/:tax_rule_id

Only the fields sent change. An ID list that is sent replaces the whole list (send every ID to keep); a list left out is kept.

Field Type Required Description
code string No Rule name
customer_tax_class_ids array No Customer tax class IDs
product_tax_class_ids array No Product tax class IDs
tax_rate_ids array No Tax rate IDs
priority integer No Priority
position integer No Sort order
calculate_subtotal integer No 1 to calculate off the subtotal only
skip_shipping_tax integer No 1 to not tax shipping

Example request body:

{
    "tax_rate_ids": [
        5,
        6
    ]
}

Delete

DELETE https://container-url.zoeysite.com/api/rest/tax/rule/:tax_rule_id

Deletes a tax rule. Its rates stay; delete them with Tax / Rate / Delete if they aren't needed.