Update a Tax Item

put
Update a Tax Item

https://api.moltin.com/v2/carts/:cartID/items/:itemID/taxes/:id
Request
Response
Path Parameters
id
required
string
ID of the Tax Item to update
Headers
Authentication
required
string
Authentication token to track down who is emptying our stocks.
Body Parameters
type
required
string
This represents the type of the object being returned
name
optional
string
A new name for the tax.
jurisdiction
optional
string
A new jurisdiction for this tax.
code
optional
string
A new unique code for the tax in this jurisdiction.
rate
optional
number
A new tax rate, represented as a decimal (12.5% -> 0.125).
200: OK
Tax item successfully updated.
{
"data": {
"id": "003e2458-3415-4fd2-a10c-ed422bfac4bb",
"type": "tax_item",
"name": "Tax Name",
"jurisdiction" : "UK",
"code": "MYTAX01",
"rate": 0.2
}
}
cURL
Moltin Request
curl -X PUT https://api.moltin.com/v2/carts/:cartID/items/:itemID/taxes/:taxID \
-H "Content-Type: application/json" \
-H "Authorization: Bearer XXXX" \
-d $'{
"data": {
"type": "tax_item",
"name": "Tax Name",
"jurisdiction" : "UK",
"code": "MYTAX01",
"rate": 0.2
}
}'
const { MoltinClient } = require('@moltin/request')
const client = new MoltinClient({
client_id: 'X',
client_secret: 'X'
})
const reference = 'XXXX'
const itemId = 'XXXX'
const taxItemID = 'XXXX'
client
.put(`carts/${reference}/items/${itemId}/taxes/${taxItemID}`, {
type: "tax_item",
name: "Tax Name",
jurisdiction : "UK",
code: "MYTAX01",
rate: 0.2
})
.then(items => {
// Do something...
})
.catch(console.error)