Skip to main content

Update metadata

To update the metadata while the Checkout is rendered on the screen, a call to the Checkout Client API's suspend() function shall be performed before calling the Checkout Backend API.

javascript client side flow to update metadata

// Suspend the Checkout, showing a spinner...

// ... then call the backend API to set the new metadata

// ... and finally resume the Checkout after the backend call is completed to update the Checkout

Once in suspend mode, the Checkout metadata can be updated by sending in a new metadata object to the Checkout API from your backend. The content of this request will replace any existing metadata.

Update metadata request

PUT /merchants/123/checkouts/1eec44b5-66d3-4058-a31f-3444229fb727/metadata HTTP/1.1
Content-Type: application/json
Authorization: SharedKey bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...

"metadata": {
"myCustomKey": 1234,
"myComplexObject": {
"firstKey": true,
"CasingIsKept": [1, 2, 3]
Please Note

Please note that this operation cannot be performed if the purchase is completed.

Request Properties

Request headers

AuthorizationYesThe authorization header is generated with the access credentials (username and shared access key) received from Walley Merchant Services. Instructions on how to generate the authorization header value can be found under the authorization section.

Request Body properties

metadataNoMetadata object that will replace any existing metadata. Each key in the object must be a string but the value can be any valid JSON value. Providing null will remove any existing metadata.

Important error responses

Error codeError ReasonCause
400Validation_ErrorMetadata object could not be parsed as a valid JSON object.
423Resource_LockedAnother modifying request is currently being executed for the Checkout session. Retry by sending the request again.
900Purchase_Commitment_FoundThe customer has clicked the Complete Purchase button and the Checkout is therefore locked for modifications.
900Purchase_CompletedPurchase is already complete.