(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:

NameDescriptionTypeRequiredExample values
idThe numerical ID of the desired taxLongyes123
itemIdThe numerical ID of item. Required if tax type of list is not Fixed amountLong- 
taxListIdThe numerical ID of tax-listLongyes 
taxValueThe tax valueDoubleyes 
useExternalIdBy default, it is set to false. set it to true if you want to use external ids.Booleannotrue , false

URL with external_id:

https://BASE_URL/api/VERSION/taxes/reference/{itemListId}/{itemId}

Parameters:

NameDescriptionTypeRequiredExamples values
itemIdreference of the itemStringNoeliteBook_820
taxListIdreference of the tax listStringYesTL-001
taxValueThe tax valueDoubleyes 

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)"
}