Composable Frontend 2.0 Learn more 

  • Commerce Cloud/
    Carts/
    Tax Items/
    Update a Tax Item

    Update a Tax Item

    PUT Update a Tax Item

    https://useast.api.elasticpath.com/v2/carts/:cartId/items/:itemId/taxes/:taxitemId
    

    Parameters

    Path parameters

    NameRequiredTypeDescription
    itemIdRequiredstringThe unique identifier of the item.
    taxitemIdRequiredstringThe unique identifier of the tax item.

    Headers

    NameRequiredTypeDescription
    AuthenticationRequiredstringAuthentication token to track down who is emptying our stocks.

    Body

    NameRequiredTypeDescription
    typeRequiredstringThis represents the type of the object being returned.
    nameOptionalstringA new name for the tax.
    jurisdictionOptionalstringA new jurisdiction for this tax.
    codeOptionalstringA new unique code for the tax in this jurisdiction.
    rateOptionalnumberA new tax rate, represented as a decimal (12.5% -> 0.125).

    Request Examples

    Curl

    curl -X PUT https://useast.api.elasticpath.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
            }
        }
    

    JavaScript SDK

    const itemId = "25617d3e-14a6-434c-bfab-3fda87517aaf";
    const taxItemId = "08c53828-bf85-460f-9a31-985547e0e567";
    const taxData = {
        type: "tax_item",
        name: "Tax Name",
        jurisdiction: "UK",
        code: "MYTAX01",
        rate: 0.2,
    };
    
    
    // Where `EPCC` is an authenticated client
    await EPCC.Cart.UpdateItemTax(itemId, taxItemId, taxData);
    

    Response Example

    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
        }
    }
    
    Previous
    Create a Tax Item