Skip to main content

Bulk Add Tax Items to Cart

POST 

/v2/carts/:cartID/taxes

note

A cart item can only have a maximum of five tax items.

Errors

422 Unprocessable Entity

In this example, when options.add_all_or_nothing is set to true and if one of cart items is not found or or has reached its maximum tax item limit, the following error response is returned:

{
"status": 422,
"title": "Add all or nothing.",
"detail": "Add all or nothing set to (true). Could not bulk add tax items to cart."
}

In this example, if you add more than five tax items to the same cart item, the following error response is returned:

{
"status": 422,
"title": "Tax item not added to cart item.",
"detail": "Cannot exceed tax item limit of (5) on cart item.",
"meta": {
"id": "f88e6370-cb35-40b2-a998-c759f31dec0a"
}
}

404

In this example, if there is a mismatch between cart_item/custom_item and the relationships.item.data.type specified in the bulk add tax item, the following error response is returned:

{
"data": [],
"errors": [
{
"status": 404,
"title": "Tax item not added to cart item.",
"detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).",
"meta": {
"id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d"
}
},
{
"status": 404,
"title": "Tax item not added to cart item.",
"detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).",
"meta": {
"id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d"
}
}
]
}

Request

Responses

Response Headers