Tax Management API
Overview
The Tax Management API provides endpoints for managing tax rules in your EverShop store. Tax rules are essential for calculating and applying taxes to orders based on various criteria such as customer location, product type, and more.
Endpoints
Create A Tax Class
Creates a new tax class in the system. You can specify the class name, and associated tax rules.
| Field Name | Field Type | Required |
|---|---|---|
| name | string | Yes |
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/tax/classes
fetch('https://<your domain>/api/tax/classes', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"tax_class_id": 1,
"uuid": "e15da567a66c11edb46b60d819134f39",
"name": "Taxable Goods"
}
}
Update A Tax Class
Updates an existing tax class with new information.
| Field Name | Field Type | Required |
|---|---|---|
| name | string | No |
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/tax/classes/433ba97f-8be7-4be9-be3f-a9f341f2b89f
fetch('https://<your domain>/api/tax/classes/433ba97f-8be7-4be9-be3f-a9f341f2b89f', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"tax_class_id": 1,
"uuid": "e15da567a66c11edb46b60d819134f39",
"name": "Taxable Goods"
}
}
Create A Tax Rate
Creates a new tax rate in the system. You can specify the rate amount, associated tax class, and other details.
| Field Name | Field Type | Required |
|---|---|---|
| name | string | Yes |
| country | string | No |
| provnice | string | No |
| postcode | string | No |
| rate | string or number | Yes |
| is_compound | string or number (0, 1, '0', '1') | No |
| priority | string or number | No |
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/tax/classes/:class_id/rates
fetch('https://<your domain>/tax/classes/:class_id/rates', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"tax_rate_id": 1,
"uuid": "433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"name": "Taxable Goods",
"tax_class_id": 1,
"country": "US",
"provnice": "CA",
"postcode": "90001",
"rate": "7.25",
"is_compound": 0,
"priority": 1
}
}
Update A Tax Rate
Updates an existing tax rate in the system. You can specify the new rate amount, associated tax class, and other details.
| Field Name | Field Type | Required |
|---|---|---|
| name | string | Yes |
| country | string | No |
| provnice | string | No |
| postcode | string | No |
| rate | string or number | Yes |
| is_compound | string or number (0, 1, '0', '1') | No |
| priority | string or number | No |
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/tax/rates/:id
fetch('https://<your domain>/tax/rates/:id', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"tax_rate_id": 1,
"uuid": "433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"name": "Taxable Goods",
"tax_class_id": 1,
"country": "US",
"provnice": "CA",
"postcode": "90001",
"rate": "7.25",
"is_compound": 0,
"priority": 1
}
}
Delete A Tax Rate
Deletes an existing tax rate from the system.
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/tax/rates/:id
fetch('https://<your domain>/tax/rates/:id', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
{
"data": {
"tax_rate_id": 1,
"uuid": "433ba97f-8be7-4be9-be3f-a9f341f2b89f",
"name": "Taxable Goods",
"tax_class_id": 1,
"country": "US",
"provnice": "CA",
"postcode": "90001",
"rate": "7.25",
"is_compound": 0,
"priority": 1
}
}
Get Tax Data with GraphQL
EverShop uses GraphQL for querying tax data. For detailed information on how to query tax data, refer to the GraphQL API documentation.