Unzer Docs

Update a basket

Overview

To update a basket, send a PUT request to the basket API. You cannot update the basket ID once it is created. You can only update the basket item details. For example, in our previous request, if we want to give a discount of 10 EUR, you can update the basket as shown in the following example.

PUT https://api.unzer.com/v2/baskets/s-bsk-db282c3a21d8

{
  "currencyCode": "EUR",
  "orderId": "{{randomOrderId}}",
  "totalValueGross":190.00,
  "note": "basket note",
  "basketItems": [
    {
      "title": "Macbook pro",
      "basketItemReferenceId": "item-1",
      "quantity": 1,
      "amountPerUnitGross": 200.00,
      "amountDiscountPerUnitGross": 10.00,
      "vat": 10,
      "unit": "pc",
      "subTitle": "basket item 2"
    }
  ]
}
{
    "id": "s-bsk-db282c3a21d8"
}

You can review the updated details for the basket by sending a GET request to the basket resource specifying the basket ID that you want to update.

GET https://api.unzer.com/v2/baskets/s-bsk-db282c3a21d8

{
  "currencyCode": "EUR",
  "orderId": "order-1611916622-718",
  "totalValueGross":190.00,
  "note": "basket note",
  "basketItems": [
    {
      "title": "Macbook pro",
      "basketItemReferenceId": "item-1",
      "quantity": 1,
      "amountPerUnitGross": 200.00,
      "amountDiscountPerUnitGross": 10.00,
      "vat": 10,
      "unit": "pc",
      "subTitle": "basket item 2"
    }
  ]
}