---
title: "Create a checkout session"
method: POST
path: "/v1/sdk/checkout-sessions"
tags: ["Checkout Sessions"]
---

# Create a checkout session

`POST /v1/sdk/checkout-sessions`

Creates a hosted checkout session for a customer to purchase a product plan. Returns a session ID and checkout URL for redirect.

## Request body

- CreateCheckoutSessionRequest
  - `customerRef` string, required
  - `planRef` string
  - `productRef` string
  - `purpose` 'credit_topup'
  - `returnUrl` string

## Response `201`

Checkout session created

- CreateCheckoutSessionResponse
  - `checkoutUrl` string, required — Full checkout URL based on backend configuration (ready to redirect customer)
  - `sessionId` string, required — Checkout session ID/token

## Other responses

- `400` — Missing customerRef or productRef

---

[API](https://skmtc.net/solvapay/apis/solvapay-rest-api.md) · [All operations](https://skmtc.net/solvapay/apis/solvapay-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/solvapay/solvapay-rest-api/versions/bbc2ff2bc849/schema)
