Search…
API Reference
Resources
List all tax categories
How to fetch a collection of tax categories via API
To fetch a collection of tax categories, send a GET request to the /api/tax_categories endpoint.

Request

GET https://yourdomain.commercelayer.io/api/tax_categories

Example

Request
Response
The following request fetches a collection of tax categories:
1
curl -g -X GET \
2
'https://yourdomain.commercelayer.io/api/tax_categories/' \
3
-H 'Accept: application/vnd.api+json' \
4
-H 'Authorization: Bearer your-access-token'
Copied!
On success, the API responds with a 200 OK status code, returning a paginated collection of resource objects:
1
{
2
"data": [
3
{
4
"id": "xYZkjABcde",
5
"type": "tax_categories",
6
"links": {
7
"self": "https://yourdomain.commercelayer.io/api/tax_categories/xYZkjABcde"
8
},
9
"attributes": {
10
"code": "31000",
11
"sku_code": "TSHIRTMM000000FFFFFFXLXX",
12
"created_at": "2018-01-01T12:00:00.000Z",
13
"updated_at": "2018-01-01T12:00:00.000Z",
14
"reference": "ANY-EXTERNAL-REFEFERNCE",
15
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
16
"metadata": {
17
"foo": "bar"
18
}
19
},
20
"relationships": {
21
"sku": {
22
"links": {
23
"self": "https://yourdomain.commercelayer.io/api/tax_categories/xYZkjABcde/relationships/sku",
24
"related": "https://yourdomain.commercelayer.io/api/tax_categories/xYZkjABcde/sku"
25
}
26
},
27
"tax_calculator": {
28
"links": {
29
"self": "https://yourdomain.commercelayer.io/api/tax_categories/xYZkjABcde/relationships/tax_calculator",
30
"related": "https://yourdomain.commercelayer.io/api/tax_categories/xYZkjABcde/tax_calculator"
31
}
32
},
33
"attachments": {
34
"links": {
35
"self": "https://yourdomain.commercelayer.io/api/tax_categories/xYZkjABcde/relationships/attachments",
36
"related": "https://yourdomain.commercelayer.io/api/tax_categories/xYZkjABcde/attachments"
37
}
38
}
39
},
40
"meta": {
41
"mode": "test"
42
}
43
},
44
{
45
"other": "... 9 tax_categories (first page)"
46
}
47
],
48
"meta": {
49
"record_count": 140,
50
"page_count": 14
51
},
52
"links": {
53
"first": "https://yourdomain.commercelayer.io/api/tax_categories?page[number]=1&page[size]=10",
54
"next": "https://yourdomain.commercelayer.io/api/tax_categories?page[number]=2&page[size]=10",
55
"last": "https://yourdomain.commercelayer.io/api/tax_categories?page[number]=14&page[size]=10"
56
}
57
}
Copied!

Sortable attributes

The list of tax categories can be sorted by the following attributes:
  • code
  • id
  • created_at
  • updated_at
  • reference
  • reference_origin
Last modified 2mo ago