Skip to main content

Bulk Add Tax Items to Cart

POST 

https://useast.api.elasticpath.com/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 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

    Authorization: http

    name: bearerAuthtype: httpscheme: bearer

    Request Collapse all
    Base URL
    https://useast.api.elasticpath.com
    Auth
    Parameters
    — pathrequired
    Body
    {
      "data": [
        {
          "code": "string",
          "jurisdiction": "string",
          "name": "string",
          "rate": 0,
          "amount": 0,
          "type": "string",
          "relationships": {
            "order": {
              "data": {
                "type": "string",
                "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
              }
            }
          }
        }
      ],
      "options": {
        "add_all_or_nothing": true
      }
    }
    
    ResponseClear

    Click the Send API Request button above and see the response here!

    We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.