Hosted Checkout Integration
Embed the STRABL hosted checkout experience into any web or mobile application by creating a cart session via a single API call, then redirecting your customer to the returned checkout URL.
How It Works#
Your Server ── POST ──► STRABL API ──returns cartId──► Your Server
Your Server redirects customer to:Customer completes payment on STRABL hosted pageSTRABL sends webhook(s) to your server with authoritative payment statusImportant: The redirect back to your successUrl does not confirm payment. Webhooks are the authoritative source of truth for order status. Never fulfill an order based on a redirect alone.
Environments#
| Environment | API Base URL | Checkout URL |
|---|
| Sandbox | https://sandbox.api.strabl.com | https://sandbox.checkout.strabl.io |
| Production | https://api.strabl.com | https://checkout.strabl.io |
Authentication#
This endpoint is public — no Authorization header is required.Your identity is established via platformUuid, which STRABL assigns when your merchant account is created.
Create Checkout Session#
POST /v2/public/api/cart/#
Creates a checkout session and returns a cartId token used to redirect the customer.Request Body#
{
"cartObject": {
"store": { ... },
"cart": { ... }
}
}
cartObject.store#
| Field | Type | Required | Description |
|---|
platformUuid | string | ✅ | Your Strabl-assigned platform identifier |
name | string | ✅ | Store display name shown on the checkout page |
url | string | ✅ | HTTPS URL of your store |
logo | string | ❌ | Publicly accessible URL of your store logo |
cartObject.cart#
| Field | Type | Required | Description |
|---|
currency | string | ✅ | ISO 4217 currency code (e.g. AED, SAR, KWD) |
country | string | ✅ | ISO 3166 2–3 character country code (e.g. AE, SA, KW) |
items | array | ✅ | One or more line items — see below |
extra | object | ✅ | Arbitrary key-value metadata echoed back in webhooks (use for your internal order/reference IDs) |
merchantUrls.successUrl | string | ✅ | URL to redirect the customer after a successful payment attempt |
merchantUrls.failureUrl | string | ✅ | URL to redirect the customer after a failed or cancelled payment |
cartObject.cart.items[]#
| Field | Type | Required | Description |
|---|
title | string | ✅ | Product name |
description | string | ✅ | Product description |
price | integer | ✅ | Unit price (pre-tax). Total line value = price × quantity |
quantity | integer | ✅ | Number of units |
url | string | ✅ | Public product page URL |
image | string | ✅ | Product thumbnail URL |
zeroPay | boolean | ✅ | Set to false for all paid items |
sku | string | ❌ | Your internal SKU reference |
productId | string | ❌ | Your internal product identifier |
variantId | string | ❌ | Your internal variant identifier |
variantOptions | string[] | ❌ | Variant attributes as "Key : Value" strings (e.g. "Color : Red") |
Example Request#
{
"cartObject": {
"store": {
"platformUuid": "your-platform-uuid",
"name": "Acme Store",
"url": "https://acme.com",
"logo": "https://acme.com/logo.png"
},
"cart": {
"currency": "AED",
"country": "AE",
"items": [
{
"title": "Classic White Sneakers",
"description": "Lightweight everyday sneakers",
"price": 299,
"quantity": 1,
"url": "https://acme.com/products/white-sneakers",
"image": "https://acme.com/images/white-sneakers.jpg",
"zeroPay": false,
"sku": "SNK-WHT-42",
"productId": "prod_001",
"variantId": "var_42",
"variantOptions": [
"Size : 42",
"Color : White"
]
}
],
"extra": {
"internalOrderRef": "ORD-2024-00123"
},
"merchantUrls": {
"successUrl": "https://acme.com/checkout/success",
"failureUrl": "https://acme.com/checkout/failure"
}
}
}
}
Response — 200 OK#
{
"code": "SUCCESS",
"message": "Cart session created",
"data": {
"cartId": "abc123xyz",
"cartData": {
"store": { ... },
"cart": { ... }
},
"expiresOn": "2024-06-18T12:45:00Z"
}
}
Response Fields#
| Field | Description |
|---|
data.cartId | Token used to build the customer redirect URL |
data.expiresOn | Session expires 45 minutes from creation |
Each cartId is valid for a single checkout attempt only. Generate a new session if the customer needs to retry.
Redirecting the Customer#
Once you have a cartId, redirect your customer immediately.Sandbox#
https://sandbox.checkout.strabl.io/?token={cartId}
Production#
https://checkout.strabl.io/?token={cartId}
Webhooks#
STRABL sends event notifications to your registered webhook endpoint for all order lifecycle changes. Read more here for webhook configuration on the dashboard.
Sandbox Testing#
Use these credentials to simulate a successful payment in the sandbox environment. They are not valid in production.| Field | Value |
|---|
| OTP | 123456 |
| Card Number | 5123 4500 0000 0008 |
| Expiry | 01/39 |
| CVV | 123 |
Key Constraints#
successUrl and failureUrl redirects do not indicate payment outcome — use webhooks only.
Sessions expire after 45 minutes.
Each session is single-use — create a new session for each checkout attempt.
logo and url under store must be publicly accessible HTTPS URLs.
Modified at 2026-06-18 13:48:48