Skip to main content

Update fees

The Update fees request will replace the current fees. If you update the fees while the Checkout is visible, use the Checkout Client API's to invoke suspend before your operation and resume afterward.

The fee is optional but will be shown last on the receipt after all the cart items if present and be presented separately on the thank you-page.

Please note

If the Delivery Module is used, the customer selects delivery method inside Walley Checkout meaning that the fees.shipping object and this entire endpoint are obsolete.

Please Note

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

While the checkout is suspended, the fees can be updated by calling the Checkout API from your backend as demonstrated in the following code:

Update fees request​

PUT /checkouts/1eec44b5-66d3-4058-a31f-3444229fb727/fees HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
Content-Type: application/json

{
"shipping": {
"id": "shipping1",
"description": "Shipping fee (incl. VAT)",
"unitPrice": 59,
"vat": 25
}
}

Request Properties​

Request headers

HeaderRequiredExplanation
AuthorizationYesInstructions on how to generate the authorization header value can be found here.

To set the shipping fee, add a shipping object to the fees object of the request. The shipping object can be null to remove the shipping fee for the current Checkout.

The shipping object contain the following properties:

PropertyRequiredExplanation
idYesAn id of the fee item. Max 50 characters. The combination of id and description (property below) must be unique within the Checkout session including the articles in the cart. Values are trimmed from leading and trailing white-spaces. Shown on the invoice or receipt.
descriptionYesDescriptions longer than 50 characters will be truncated. Description and id (property above) must be unique within the Checkout session including the articles in the cart. Values are trimmed from leading and trailing white-spaces. Shown on the invoice or receipt.
unitPriceYesThe unit price of the fee including VAT. Allowed values are 0 to 999999.99. Max 2 decimals, i.e. 25.00
vatYesThe VAT of the fee in percent. Allowed values are 0 to 100. Max 2 decimals, i.e. 25.00

Important error responses​

Error codeError ReasonCause
400Duplicate_ArticlesCan't add article/fees since multiple articles/fees with same id and description already exist.
400Validation_ErrorThe request contains properties with invalid values. Details are provided in the response body.
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.