Update delivery address for an ongoing session
On this page you will find all necessary information about how to update delivery address for an ongoing checkout session.
The following steps are required:
- Send updated delivery address via a backend API call
- Refresh checkout to display the updated delivery address
1. Update delivery address
In order to update the delivery address in the checkout, send a server t to server PUT
request with “Partner access token” as authorization with JSON
data to the /api/partner/payments/{purchaseid}/address
endpoint. (Replace {purchaseid}
in the URL with the actual purchaseId of your session.)
More information about generating a “Partner access token” in Obtain partner access token for the purchase
More information about getting a “Purchase ID” for a current session in Initialize payment
Property | Data type | Description |
---|---|---|
differentDeliveryAddress | Check-box state Type | Decides if the user is able to see the delivery address or it’s hidden |
deliveryAddress | DeliveryAddress object | Delivery address data |
Example
Response
If the request is successful, an empty response with status code 204 (No Content) will be returned.
2. Refresh checkout to show the updated address
Call the below Javascript function to reload the checkout with the updated information.