Create an embedded checkout session
Creates a new embedded checkout session. Returns a client_secret that the merchant passes to their frontend to render the checkout form in an iframe.
Authorization
apiKey Merchant API key. Publishable keys (pk_test_* / pk_live_) are safe for browser/frontend use and carry a limited scope set (sessions, payment_instruments, customers, orders writes; products, product_prices, payment_links reads). Secret keys (sk_test_ / sk_live_*) grant full admin access and must only be used server-side.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://loading/v1/api/embedded-checkout/" \ -H "Content-Type: application/json" \ -d '{ "line_items": [ { "price_id": "price_abc123", "quantity": 1 } ], "mode": "payment", "success_url": "https://merchant.com/success?session_id={SESSION_ID}", "cancel_url": "https://merchant.com/cancel", "customer_email": "customer@example.com" }'{
"success": true,
"timestamp": "2026-03-13T12:00:00.000Z",
"message": "Embedded checkout session created",
"data": {
"id": "ecs_abc123",
"client_secret": "ecs_abc123_secret_xyz789",
"url": "https://checkout.itseasy.co/embed?session=ecs_abc123",
"amount_total": 2000,
"currency": "USD",
"status": "open",
"expires_at": "2026-03-14T12:00:00.000Z"
}
}{
"success": false,
"timestamp": "2019-08-24T14:15:22Z",
"error": {
"code": "string",
"message": "string",
"details": null
}
}{
"success": false,
"timestamp": "2019-08-24T14:15:22Z",
"error": {
"code": "string",
"message": "string",
"details": null
}
}{
"success": false,
"timestamp": "2019-08-24T14:15:22Z",
"error": {
"code": "string",
"message": "string",
"details": null
}
}Confirm payment for an embedded checkout session
Processes payment for an embedded checkout session. Called by the checkout iframe's server action with the client_secret and tokenized payment details.
Validate an embedded checkout session
Validates a client_secret and returns session data needed to render the checkout form. No API key required — the client_secret serves as the auth token.