The create method initiates a native checkout flow within the Salla Merchant Dashboard. It opens the payment drawer where the merchant can review items and complete the purchase.Usage#
You can pass a single item or an array of items for multi-item checkout.API Reference#
embedded.checkout.create(input, config?)#
| Parameter | Type | Required | Description |
|---|
| input | CheckoutItem | CheckoutItem[] | Yes | A single item or array of items to purchase. |
| config | CheckoutCreateConfig | No | Optional configuration. |
CheckoutItem#
| Property | Type | Required | Default | Description |
|---|
| type | "addon" | Yes | - | The item type. Currently only "addon" is supported. |
| slug | string | Yes | - | The unique slug identifier of the addon. |
| quantity | number | No | 1 | Number of units to purchase. |
CheckoutCreateConfig#
| Property | Type | Required | Description |
|---|
| context | unknown | No | Developer-defined data persisted across 3DS redirects. Returned in onResult. |
Validation#
The SDK validates all items before sending the checkout request. Invalid input throws an error immediately:| Condition | Error Message |
|---|
| Empty array | "At least one item is required" |
Missing or empty slug | "Item at index N must have a valid slug" |
Missing or empty type | "Item at index N must have a valid type" |
Complete Example#
Register onResult First: Always set up your result listener before calling create() to avoid missing the response.
Validate Slugs: Use getAddons() to retrieve valid addon slugs before calling create(). The checkout will fail if a slug doesn't match any available addon.
Context for Navigation: If your app has multi-step flows, pass the current route in context so you can restore it after a 3DS redirect.
Modified at 2026-02-11 20:21:55