KwitKwit Docs

Checkout API

POST /v1/checkout and GET /v1/checkout/:sessionId

llms.txtPOST /v1/checkout and GET /v1/checkout/:sessionId

Create checkout

POST /v1/checkout

Creates a checkout session, generates the first invoice, and returns the hosted payment URL.

Body (createCheckoutSchema):

FieldTypeRequired
customerIdstring (UUID)Yes
priceIdstring (UUID)Yes
checkoutLinkIdstringNo
successUrlstringNo
cancelUrlstringNo
discountIdstringNo
metadataobjectNo

Response 201:

{
  "sessionId": "uuid",
  "checkoutUrl": "https://kwit.dev/checkout/...",
  "invoice": { }
}

Errors: 400 validation, 404 if customer/product not found, 500 otherwise.

Retrieve session

GET /v1/checkout/:sessionId

Response 200 - checkout session including status (OPEN, COMPLETE, EXPIRED).

const session = await kwit.checkout.sessions.retrieve(sessionId);

On this page