Update a Tax Category
Updates a Tax Category
PATCH
/
api
/
v2
/
platform
/
tax_categories
/
{id}
Update a Tax Category
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tax_category: {
name: 'Clothing',
is_default: true,
tax_code: '1257L',
description: 'Men\'s, women\'s and children\'s branded clothing'
}
})
};
fetch('http://{defaultHost}/api/v2/platform/tax_categories/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url http://{defaultHost}/api/v2/platform/tax_categories/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"tax_category": {
"name": "Clothing",
"is_default": true,
"tax_code": "1257L",
"description": "Men's, women's and children's branded clothing"
}
}
EOF{
"data": {
"id": "160",
"type": "tax_category",
"attributes": {
"name": "Clothing",
"description": "Men's, women's and children's clothing",
"is_default": true,
"deleted_at": null,
"created_at": "2022-11-08T19:35:42.789Z",
"updated_at": "2022-11-08T19:35:43.019Z",
"tax_code": "1233K"
},
"relationships": {
"tax_rates": {
"data": []
}
}
}
}{
"error": "The access token is invalid"
}{
"error": "The resource you were looking for could not be found."
}{
"error": "Name can't be blank",
"errors": {
"name": [
"can't be blank"
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes
Body
application/json
Show child attributes
Show child attributes
Response
Record updated
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Update a Tax Category
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tax_category: {
name: 'Clothing',
is_default: true,
tax_code: '1257L',
description: 'Men\'s, women\'s and children\'s branded clothing'
}
})
};
fetch('http://{defaultHost}/api/v2/platform/tax_categories/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PATCH \
--url http://{defaultHost}/api/v2/platform/tax_categories/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"tax_category": {
"name": "Clothing",
"is_default": true,
"tax_code": "1257L",
"description": "Men's, women's and children's branded clothing"
}
}
EOF{
"data": {
"id": "160",
"type": "tax_category",
"attributes": {
"name": "Clothing",
"description": "Men's, women's and children's clothing",
"is_default": true,
"deleted_at": null,
"created_at": "2022-11-08T19:35:42.789Z",
"updated_at": "2022-11-08T19:35:43.019Z",
"tax_code": "1233K"
},
"relationships": {
"tax_rates": {
"data": []
}
}
}
}{
"error": "The access token is invalid"
}{
"error": "The resource you were looking for could not be found."
}{
"error": "Name can't be blank",
"errors": {
"name": [
"can't be blank"
]
}
}
