Update tax (partial)
curl --request PATCH \
--url https://staging-api.tyms.io/v1/adam/taxes/{uuid} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"percentage": 123,
"currency": "<string>",
"is_deduction": true,
"payable_account": "<string>",
"receivable_account": "<string>"
}
'import requests
url = "https://staging-api.tyms.io/v1/adam/taxes/{uuid}"
payload = {
"name": "<string>",
"percentage": 123,
"currency": "<string>",
"is_deduction": True,
"payable_account": "<string>",
"receivable_account": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
percentage: 123,
currency: '<string>',
is_deduction: true,
payable_account: '<string>',
receivable_account: '<string>'
})
};
fetch('https://staging-api.tyms.io/v1/adam/taxes/{uuid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"message": "Tax updated successfully",
"data": {
"id": "a1b2c3d4e5f6478990abcdef12345678",
"uuid": "a1b2c3d4e5f6478990abcdef12345678",
"name": "VAT",
"label": "VAT (7.5%)",
"percentage": 7.5,
"currency": "NGN",
"is_deduction": false,
"payable_account": "VAT Payable",
"receivable_account": "VAT Receivable"
}
}{
"status": "failed",
"message": "The date field is required. The currency field is required.",
"errors": [
{
"field": "date",
"message": "The date field is required."
},
{
"field": "currency",
"message": "The currency field is required."
}
],
"data": {
"date": [
"The date field is required."
],
"currency": [
"The currency field is required."
]
}
}{
"status": "failed",
"message": "The date field is required. The currency field is required.",
"errors": [
{
"field": "date",
"message": "The date field is required."
},
{
"field": "currency",
"message": "The currency field is required."
}
],
"data": {
"date": [
"The date field is required."
],
"currency": [
"The currency field is required."
]
}
}Taxes
Update tax (partial)
Change name, rate, currency, withholding flag, or linked accounts. Send only the fields you want to change. percentage stays a human rate such as 7.5.
PATCH
/
taxes
/
{uuid}
Update tax (partial)
curl --request PATCH \
--url https://staging-api.tyms.io/v1/adam/taxes/{uuid} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"percentage": 123,
"currency": "<string>",
"is_deduction": true,
"payable_account": "<string>",
"receivable_account": "<string>"
}
'import requests
url = "https://staging-api.tyms.io/v1/adam/taxes/{uuid}"
payload = {
"name": "<string>",
"percentage": 123,
"currency": "<string>",
"is_deduction": True,
"payable_account": "<string>",
"receivable_account": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
percentage: 123,
currency: '<string>',
is_deduction: true,
payable_account: '<string>',
receivable_account: '<string>'
})
};
fetch('https://staging-api.tyms.io/v1/adam/taxes/{uuid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"message": "Tax updated successfully",
"data": {
"id": "a1b2c3d4e5f6478990abcdef12345678",
"uuid": "a1b2c3d4e5f6478990abcdef12345678",
"name": "VAT",
"label": "VAT (7.5%)",
"percentage": 7.5,
"currency": "NGN",
"is_deduction": false,
"payable_account": "VAT Payable",
"receivable_account": "VAT Receivable"
}
}{
"status": "failed",
"message": "The date field is required. The currency field is required.",
"errors": [
{
"field": "date",
"message": "The date field is required."
},
{
"field": "currency",
"message": "The currency field is required."
}
],
"data": {
"date": [
"The date field is required."
],
"currency": [
"The currency field is required."
]
}
}{
"status": "failed",
"message": "The date field is required. The currency field is required.",
"errors": [
{
"field": "date",
"message": "The date field is required."
},
{
"field": "currency",
"message": "The currency field is required."
}
],
"data": {
"date": [
"The date field is required."
],
"currency": [
"The currency field is required."
]
}
}Authorizations
Body
application/json
Send only the fields you want to change. percentage stays a human rate such as 7.5.
Response
Tax updated