Skip to main content

Upsell after a completed purchase

Offer extra products to the customer once their credit purchase is complete. Today, build your own UI and call Reauthorize. A second option β€” letting Walley Checkout render the upsell inside the iframe β€” is in development and documented below as a draft.

Important

Upsell only works for credit purchases (Walley invoice / part-payment) with status NotActivated or PartActivated. Auto-activated invoices cannot be upsold.

Choose your integration​

OptionWho renders the UIWhen to pick it
In-checkout upsell (draft)Walley Checkout iframeUnder construction β€” not yet ready for production. Sweden, credit only.
Custom upsell using ReauthorizeYour own post-checkout UIRecommended today. Use when you need full control or upsell is decided post-checkout.

In-checkout upsell​

Draft β€” under construction

This section describes a feature that is not yet generally available. The API shape, validation rules, and UI may still change. Do not integrate against this in production β€” for now, use the Reauthorize-based flow below.

How it works​

  1. Pass an upsell.items array on the Initialize Checkout request. Max 10 items.
  2. The customer completes their purchase as usual.
  3. On the purchase-completed view, Walley Checkout renders the items as cards (image, description, price, Add button).
  4. When the customer taps Add, Walley appends the article to the order and reauthorises automatically. No merchant call required.
  5. Accepted items appear as extra rows in the order. Read them from Get Checkout Information under order.items once the purchase is complete.

Availability​

  • Country: Sweden (SE) only.
  • Payment method: Walley credit purchases (invoice / part-payment).
  • Order state: not auto-activated. If the order auto-activates, no upsell is shown.

If any of the above is not met the upsell block is silently omitted from the completed view β€” the rest of the checkout is unaffected.

Adding upsell items at init​

Extend your existing Initialize Checkout request with an upsell object:

POST /checkouts HTTP/1.1
Host: api.uat.walleydev.com // (Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
Content-Type: application/json

{
"storeId": 123,
"countryCode": "SE",
"reference": "123456789",
"redirectPageUri": "https://example.com/purchase-completed",
"merchantTermsUri": "https://example.com/terms",
"cart": {
"items": [
/* primary cart items */
]
},
"upsell": {
"items": [
{
"id": "10101",
"description": "Premium gift wrapping",
"quantity": 1,
"unitPrice": 49.0,
"vat": 25.0,
"sku": "GIFTWRAP-PREMIUM",
"imageUrl": "https://cdn.example.com/img/giftwrap.jpg"
},
{
"id": "10102",
"description": "Extended 2-year warranty",
"quantity": 1,
"unitPrice": 199.0,
"vat": 25.0,
"imageUrl": "https://cdn.example.com/img/warranty.jpg"
}
]
}
}

upsell.items[] properties​

PropertyRequiredExplanation
idYesArticle id. Max 50 characters. Shown on the invoice.
descriptionYesShort product description shown on the upsell card and the invoice.
quantityYesAllowed values 1–99999999.
unitPriceYesUnit price including VAT. Max 2 decimals. Range -999999.99–999999.99.
vatYesVAT in percent. Max 2 decimals. Range 0–100.
imageUrlYesAbsolute HTTPS URL to the product image. Max 2048 characters. Rendered in the upsell card.
skuNoStock Keeping Unit. Max 1024 characters.

A maximum of 10 upsell items can be sent per checkout.

Reading back what the customer accepted​

When the customer adds an upsell item, Walley appends it to the order. After the purchase is complete, Get Checkout Information returns the final order under order.items β€” accepted upsell rows show up alongside the original cart rows, keyed by the same id you sent at init:

{
"order": {
"orderId": "...",
"totalAmount": 248.0,
"items": [
/* original cart rows */
{
"id": "10101",
"description": "Premium gift wrapping",
"quantity": 1,
"unitPrice": 49.0,
"vat": 25.0,
"sku": "GIFTWRAP-PREMIUM"
}
]
}
}

Compare order.items against the cart you sent at init to determine which upsell items were accepted. Accepted items are already on the Walley invoice β€” no further merchant call is required.


Custom upsell using Reauthorize​

It’s possible to include your own upsell functionality after the purchase is complete in the checkout. This is done with a call to Reauthorize with the added products of the customer's choice or a larger amount than the original.

How to get started πŸš€β€‹

  1. When the purchase is completed and the checkout information is fetched, it will return an orderId.
  2. Use the orderId for calling the Reauthorize endpoint, remember to send along all existing article rows with the new upsell articles if you want the old articles to show on the new invoice. If you only want to adjust the amount, sending in an amount is enough. This will return a 201 or 202 response depending on if a credit check is needed or not. The response headers will contain a Location header with a path to the order.
  3. Use this url path to verify that the order has successfully been reauthorized. In the case where a credit check happens (201), you will need to poll on the endpoint you recieved in the Location header to await that the reauthorize finalizes.