Update Items
On this page you will find all necessary information about How to Update items. Make sure you check Embed Checkout article, before continuing reading this article.
When updating items in the cart, the merchant should:
- Send updated cart to Checkout
- Refresh app to show the updated price
1. Send updated cart to Checkout
In order to send updated cart to Checkout application, merchant has to send a PUT
request with “Partner access token” as authorization with JSON
data to /api/partner/payments/{purchaseid}/items
. “Purchase ID” has to be included in the URL.
More information about generating a “Partner access token” here: Obtain partner access token for the purchase
More information about getting a “Purchase ID” for a current session here: Initialize payment
Property | Data type | Description |
---|---|---|
items | [] | List Item |
Item:
Property | Data type | Description |
---|---|---|
Description | string | Name of item |
Notes | string | Optional notes |
Amount | decimal | Item cost |
TaxCode | string | Tax code |
TaxAmount | decimal | Tax amount |
Quantity | decimal | Quantity |
Example
2. Refresh app to show the updated price
This ensures that the form will be reloaded with the actual price.
PHP integration example
Check the PHP demo example of Checkout 3.0 integration in our public repository on Github: https://github.com/avarda-ab/checkout3-phpdemo (opens in a new tab)