---
title: "Create checkout session"
method: POST
path: "/basket/{id}/checkout"
tags: ["basket"]
---

# Create checkout session

`POST /basket/{id}/checkout`

Creates a checkout session and returns the URL the client should redirect the user to.

Use this as the final "continue to payment" step from basket/checkout pages.

What this endpoint checks before creating a session:
- listing availability and purchasability
- seller authorization constraints
- basket consistency at checkout time

Response behavior:
- On success: returns a checkout URL.
- On failure: returns listing-level validation errors for unavailable/invalid items.

Heads up:
- Requires authentication.

## Path parameters

- `id` string, required — The ID of the basket to retrieve

## Request body

- object
  - `successUrl` string, uri, required — The URL to redirect to after a successful payment. A `?purchase=` query parameter will be appended to this URL containing the ID of the resulting purchase.

## Response `200`

The response containing the checkout URL

- object
  - `url` string, uri, required — The URL to redirect the user to for checkout

## Other responses

- `401` — The seller is not authorised to sell one or more items
- `404` — A listing in the basket was not found
- `409` — The listings in the response body are no longer available in their requested quantity
- `500` — A listing in the basket was not found

---

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