Skip to main content

Initialize a Checkout Session

Initialize a Checkout session by making a POST request to the checkout backend API endpoint. This returns a public token for rendering the Checkout iframe and a private ID for retrieving checkout information.

Explore All Features

This guide covers the basic steps to initialize a checkout session. For comprehensive coverage of all available features, optional configurations, and advanced use cases, see the Initialize Checkout Features Guide.

Quick Start​

Basic example to get started:

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

{
"storeId": 123,
"countryCode": "SE",
"merchantTermsUri": "https://example.com/terms",
"notificationUri": "https://example.com/notifications",
"cart": {
"items": [
{
"id": "10001",
"description": "Product Name",
"unitPrice": 100.0,
"quantity": 1,
"vat": 25.0
}
]
}
}

Required Properties​

Request Headers​

HeaderRequiredDescription
AuthorizationYesBearer token for authentication. See Authorization
Content-TypeYesMust be application/json

Request Body​

PropertyRequiredTypeDescription
storeIdYesnumberYour unique store identifier
countryCodeYesstringMarket code: SE, NO, FI, DK, DE, or EU
merchantTermsUriYesstringURL to your terms and conditions page
notificationUriYesstringHTTPS endpoint for purchase notifications
cartYesobjectShopping cart with items. See Cart Object
Production vs UAT
  • UAT: https://api.uat.walleydev.com/checkouts
  • Production: https://api.walleydev.com/checkouts

See Endpoints for complete list.


Cart Object​

The cart must contain at least one item with these required properties:

PropertyRequiredTypeDescription
idYesstringUnique item identifier
descriptionYesstringProduct name/description
unitPriceYesdecimalPrice per unit (including VAT)
quantityYesintegerNumber of items
vatYesdecimalVAT percentage (e.g., 25.0 for 25%)

Cart Example​

{
"cart": {
"items": [
{
"id": "product-123",
"description": "Premium Widget",
"unitPrice": 299.0,
"quantity": 2,
"vat": 25.0
}
]
}
}

Response​

PropertyExplanation
publicTokenThe publicToken is used to render the Checkout iframe. The public token has a limited lifetime of 168 hours (7 days).
privateIdThe privateId is used to perform backend communication with the Checkout API for the given session. The privateId is used to acquire information for an ongoing or completed session for up to 180 days after it was created. The privateId is also used when modifying a session (e.g. cart update). Updates can be made for a session until it is completed or expiresAt has passed.
expiresAtThe timestamp when this Checkout session will expire. After this timestamp the purchase cannot be completed, no updates to the cart can be performed and a new Checkout session must be initialized.