Update shipping properties
The Update shipping properties request will replace the current shipping properties.
If you update the shipping properties while the Checkout is visible, use the Checkout Client API's to invoke suspend
before your operation and resume
afterward.
Shipping properties are optional and only relevant if a Delivery Module is used. It gives flexibility to customize what delivery methods should be available based on the items in the cart.
Please note that this operation cannot be performed if the purchase is completed.
While the checkout is suspended, the shipping properties can be updated by calling the Checkout API from your backend as demonstrated in the following code:
Update shipping properties request​
- Request
- Response
- Error
PUT /checkouts/1eec44b5-66d3-4058-a31f-3444229fb727/shippingProperties HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
Content-Type: application/json
{
"isBulky": true,
"isHulky": false,
"height": 10,
"width": 20
}
{
"id": "f5f4e86d-95b1-4c1a-8ad0-1d5907236bd7",
"data": null,
"error": null
}
/*
Example error. More errors available below.
*/
{
"id": "862336bb-86a5-418b-b6ff-5547398d5c6b",
"data": null,
"error": {
"code": 423,
"message": "The resource requested is currently locked for modification. Try again.",
"errors": [
{
"reason": "Resource_Locked",
"message": "The resource requested is currently locked for modification. Try again."
}
]
}
}
Request Properties​
Request headers
Header | Required | Explanation |
---|---|---|
Authorization | Yes | Instructions on how to generate the authorization header value can be found here. |
Request body properties
It is compromised of key-value pairs that will set shipping properties. Each key must be a string but the value can be any valid JSON value. Providing null will remove any existing property. Providing an empty body will remove any existing shipping properties.
Important error responses​
Error code | Error Reason | Cause |
---|---|---|
400 | Validation_Error | Shipping properties values could not be parsed as a valid JSON value. |
423 | Resource_Locked | Another modifying request is currently being executed for the Checkout session. Retry by sending the request again. |
900 | Purchase_Commitment_Found | The customer has clicked the Complete Purchase button and the Checkout is therefore locked for modifications. |
900 | Purchase_Completed | Purchase is already complete. |