(Quick Reference)
Service: Update a tax
Description: Returns the updated tax in json format when successful. Returns a json response, describing the failure condition when unsuccessful.
Method: PUT
Request content type: application/json
URL:
https://BASE_URL/api/VERSION/taxes/{id}
Parameters:
Name | Description | Type | Required | Example values |
---|
id | The numerical ID of the desired tax | Long | yes | 123 |
itemId | The numerical ID of item. Required if tax type of list is not Fixed amount | Long | - | |
taxListId | The numerical ID of tax-list | Long | yes | |
taxValue | The tax value | Double | yes | |
useExternalId | By default, it is set to false. set it to true if you want to use external ids. | Boolean | no | true , false |
URL with external_id:
https://BASE_URL/api/VERSION/taxes/reference/{itemListId}/{itemId}
Parameters:
Name | Description | Type | Required | Examples values |
---|
itemId | reference of the item | String | No | eliteBook_820 |
taxListId | reference of the tax list | String | Yes | TL-001 |
taxValue | The tax value | Double | yes | |
Success Output
Status: HTTP/1.1 200 OK
{
"id": 1367,
"itemReference": "bracelet-GRP09062",
"item": {
"id": 519,
"reference": "bracelet-GRP09062",
"name": "Knot Band Bracelet",
"href": "/api/v1.0/items/519"
},
"taxListReference": "20_tax_list",
"taxList": {
"id": 7,
"reference": "20_tax_list",
"name": "VAT 20%",
"href": "/api/v1.0/taxLists/7"
},
"taxValue": 24,
"organization": "entity1",
"dateCreated": "2016-02-10T13:36:18Z",
"lastUpdated": "2016-02-10T14:40:00Z"
}
Failure Output
Status: HTTP/1.1 404 Not Found
{
"error": "not_found",
"error_description": "The tax with the id 70 doesn't exist."
}
{
"error": "not_found",
"error_description": "The item with the id 4945 doesn't exist."
}
{
"error": "not_found",
"error_description": "The taxList with the id 457 doesn't exist."
}
Status: HTTP/1.1 400 Bad Request
{
"error": "save_failed",
"error_description": "Failed to save instance"
}
{
"error": "invalid_param_type",
"error_description": "An invalid value was specified for parameter: taxValue (must be a Double)"
}