tax

Description

Tax rates are determined by the customer's shipping location. If you are within the United States, you can set is_live to true to automatically calculate live tax rates based on the customer's postal code. Otherwise, you can set up global taxes which don't change based on location, country taxes which change based on the country, regional taxes which change based on the customer's state / province, and local taxes which change based on the customer's city. If the location matches, the tax rate is applied. You can also specify whether or not this tax rate should also be applied to the shipping costs.

Once a tax rate is configured, it must be applied to a item category for it to be used by creating a tax_item_category resource.

Interact with this resource

To interact with this resource and see it in the context of the API, you can utilise Postman or your Terminal/Console to perform requests. If you have a Foxy store, you can also use the API browser in the admin to interact with resources connected to your store.

Actions

GET
View a tax
PATCH
Update a tax (send only the properties you want to modify)
PUT
Replace a tax (send the entire representation)
DELETE
Delete a tax
HEAD
Get just the header response
OPTIONS
Get a response explaining which HTTP methods are supported

Properties

Property Description Type Constraints
name The name of this tax which will be displayed to the customer. String Required. 30 characters or less.
type The type of tax rate which determines when this tax will be applied. String Required. global, union, country, region, local,custom_tax_endpoint.
country The country which will be matched against the customer shipping country to determine if a country tax will be applied. String Two character ISO 3166-1-alpha-2 code countries
region The region (also known as a state or province) which will be matched against the customer shipping region to determine if a regional tax will be applied. String 2 characters if code exists, otherwise 20 characters or less. regions
city The city which will be matched against the customer shipping city to determine if a local tax will be applied. String Required when type is local. 50 characters or less.
is_live Set to true if the tax rate will be determined automatically by the postal code. Boolean true or false, 1 or 0.
service_provider If using a live tax rate service provider, this value can be set to determine which provider you would like to use. String avalara, custom_tax, taxjar, onesource or left blank.
apply_to_shipping Set to true if the tax rate will also be applied to the shipping costs. Boolean true or false, 1 or 0.
use_origin_rates For a Union tax type, set to true to use the origin country tax rates. Boolean true or false, 1 or 0.
exempt_all_customer_tax_ids Set to true to exempt all customers with a tax id Boolean true or false, 1 or 0.
rate The tax rate to be applied for this tax. For 10%, use 10. Decimal Required. Greater than 0.
date_created The date this resource was created. Date Read only
date_modified The date this resource was last modified. Date Read only

If you want to add Custom Tax Endpoint, you can set just name and type, other fields will be set automatically.

Example Representation

{
    "_links": {
        "curies": [
            {
                "name": "fx",
                "href": "https://api.foxycart.com/rels/{rel}",
                "templated": true
            }
        ],
        "self": {
            "href": "https://api.foxycart.com/taxes/31588",
            "title": "This Tax"
        },
        "fx:store": {
            "href": "https://api.foxycart.com/stores/66",
            "title": "This Store"
        },
        "fx:tax_item_categories": {
            "href": "https://api.foxycart.com/taxes/31588/tax_item_categories",
            "title": "Tax Item Category relationships"
        },
        {
        "fx:native_integrations": {
            "href": "https://api.foxycart.com/stores/66/native_integrations?provider=avalara",
            "title": "Native Integrations for this service provider"
        }
    },
    "name": "TN",
    "type": "region",
    "country": "US",
    "region": "TN",
    "city": "",
    "is_live": false,
    "service_provider": "avalara",
    "apply_to_shipping": true,
    "use_origin_rates": false,
    "exempt_all_customer_tax_ids": false,
    "rate": 1,
    "date_created": null,
    "date_modified": null
}
<?xml version="1.0" encoding="UTF-8"?>
<resource href="https://api.foxycart.com/taxes/31588" rel="https://api.foxycart.com/rels/tax">
  <link rel="self" href="https://api.foxycart.com/taxes/31588" title="This Tax"/>
  <link rel="https://api.foxycart.com/rels/store" href="https://api.foxycart.com/stores/66" title="This Store"/>
  <link rel="https://api.foxycart.com/rels/tax_item_categories" href="https://api.foxycart.com/taxes/31588/tax_item_categories" title="Tax Item Category relationships"/>
  <link rel="https://api.foxycart.com/rels/native_integrations" href="https://api.foxycart.com/stores/66/native_integrations?provider=avalara" title="Native Integrations for this service provider"/>
  <name>TN</name>
  <type>region</type>
  <country>US</country>
  <region>TN</region>
  <city></city>
  <is_live>false</is_live>
  <service_provider>avalara</service_provider>
  <apply_to_shipping>true</apply_to_shipping>
  <use_origin_rates>false</use_origin_rates>
  <exempt_all_customer_tax_ids>false</exempt_all_customer_tax_ids>
  <rate>1</rate>
  <date_created></date_created>
  <date_modified></date_modified>
</resource>
{
    "class": [
        "tax"
    ],
    "properties": {
        "name": "TN",
        "type": "region",
        "country": "US",
        "region": "TN",
        "city": "",
        "is_live": false,
        "service_provider": "avalara",
        "apply_to_shipping": true,
        "use_origin_rates": false,
        "exempt_all_customer_tax_ids": false,
        "rate": 1,
        "date_created": null,
        "date_modified": null
    },
    "links": [
        {
            "rel": [
                "self"
            ],
            "href": "https://api.foxycart.com/taxes/31588"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/store"
            ],
            "href": "https://api.foxycart.com/stores/66"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/tax_item_categories"
            ],
            "href": "https://api.foxycart.com/taxes/31588/tax_item_categories"
        },
        {
            "rel": [
                "https://api.foxycart.com/rels/native_integrations"
            ],
            "href": "https://api.foxycart.com/stores/66/native_integrations?provider=avalara"
        }
    ]
}

Conditional Link Relationships

If this Tax has a service provider, it will include a native_integrations link relationship.

Zoomable Resources

This resource has no linked resources which can be "zoomed" in on, filtered and embedded within this resource.