Returns a list of Tax Categories
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://{defaultHost}/api/v2/platform/tax_categories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"id": "153",
"type": "tax_category",
"attributes": {
"name": "TaxCategory - 54232",
"description": "Velit qui dignissimos excepturi eum corrupti.",
"is_default": false,
"deleted_at": null,
"created_at": "2022-11-08T19:35:41.496Z",
"updated_at": "2022-11-08T19:35:41.496Z",
"tax_code": null
},
"relationships": {
"tax_rates": {
"data": []
}
}
},
{
"id": "154",
"type": "tax_category",
"attributes": {
"name": "TaxCategory - 100586",
"description": "Placeat nihil quaerat nostrum cumque ipsa eius perferendis.",
"is_default": false,
"deleted_at": null,
"created_at": "2022-11-08T19:35:41.497Z",
"updated_at": "2022-11-08T19:35:41.497Z",
"tax_code": null
},
"relationships": {
"tax_rates": {
"data": []
}
}
}
],
"meta": {
"count": 2,
"total_count": 2,
"total_pages": 1
},
"links": {
"self": "http://www.example.com/api/v2/platform/tax_categories?page=1&per_page=&include=&filter[name_eq]=&filter[is_default_true]=&filter[tax_code_eq]=",
"next": "http://www.example.com/api/v2/platform/tax_categories?filter%5Bis_default_true%5D=&filter%5Bname_eq%5D=&filter%5Btax_code_eq%5D=&include=&page=1&per_page=",
"prev": "http://www.example.com/api/v2/platform/tax_categories?filter%5Bis_default_true%5D=&filter%5Bname_eq%5D=&filter%5Btax_code_eq%5D=&include=&page=1&per_page=",
"last": "http://www.example.com/api/v2/platform/tax_categories?filter%5Bis_default_true%5D=&filter%5Bname_eq%5D=&filter%5Btax_code_eq%5D=&include=&page=1&per_page=",
"first": "http://www.example.com/api/v2/platform/tax_categories?filter%5Bis_default_true%5D=&filter%5Bname_eq%5D=&filter%5Btax_code_eq%5D=&include=&page=1&per_page="
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes
Was this page helpful?
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://{defaultHost}/api/v2/platform/tax_categories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"id": "153",
"type": "tax_category",
"attributes": {
"name": "TaxCategory - 54232",
"description": "Velit qui dignissimos excepturi eum corrupti.",
"is_default": false,
"deleted_at": null,
"created_at": "2022-11-08T19:35:41.496Z",
"updated_at": "2022-11-08T19:35:41.496Z",
"tax_code": null
},
"relationships": {
"tax_rates": {
"data": []
}
}
},
{
"id": "154",
"type": "tax_category",
"attributes": {
"name": "TaxCategory - 100586",
"description": "Placeat nihil quaerat nostrum cumque ipsa eius perferendis.",
"is_default": false,
"deleted_at": null,
"created_at": "2022-11-08T19:35:41.497Z",
"updated_at": "2022-11-08T19:35:41.497Z",
"tax_code": null
},
"relationships": {
"tax_rates": {
"data": []
}
}
}
],
"meta": {
"count": 2,
"total_count": 2,
"total_pages": 1
},
"links": {
"self": "http://www.example.com/api/v2/platform/tax_categories?page=1&per_page=&include=&filter[name_eq]=&filter[is_default_true]=&filter[tax_code_eq]=",
"next": "http://www.example.com/api/v2/platform/tax_categories?filter%5Bis_default_true%5D=&filter%5Bname_eq%5D=&filter%5Btax_code_eq%5D=&include=&page=1&per_page=",
"prev": "http://www.example.com/api/v2/platform/tax_categories?filter%5Bis_default_true%5D=&filter%5Bname_eq%5D=&filter%5Btax_code_eq%5D=&include=&page=1&per_page=",
"last": "http://www.example.com/api/v2/platform/tax_categories?filter%5Bis_default_true%5D=&filter%5Bname_eq%5D=&filter%5Btax_code_eq%5D=&include=&page=1&per_page=",
"first": "http://www.example.com/api/v2/platform/tax_categories?filter%5Bis_default_true%5D=&filter%5Bname_eq%5D=&filter%5Btax_code_eq%5D=&include=&page=1&per_page="
}
}