---
title: "Checkout"
method: POST
path: "/api/billing/checkout"
tags: ["billing"]
---

# Checkout

`POST /api/billing/checkout`

## Request

- Base URL: `https://app.dataassist.io` (the document declares no server; this is the origin it was published from)
- URL: `https://app.dataassist.io/api/billing/checkout`
- Auth: none declared

Create a Razorpay order and a pending credit_purchases row.

Precondition: billing details must be complete (approach A — block paid
checkout until name/address/country are filled).

If `promo_code` is supplied, the price charged is the post-discount
`final_amount`. The promo validation + the application-row INSERT happen
in the same transaction as the credit_purchases INSERT — a stale code
cannot lead to a credited purchase at the discounted price.

## Request body

- CheckoutBody
  - `pack_id` string, required
  - `promo_code` string, nullable

## Response `200`

Successful Response

- CheckoutResponse
  - `purchase_id` integer, required
  - `razorpay_order_id` string, required
  - `razorpay_key_id` string, required
  - `amount` integer, required
  - `currency` string, required
  - `pack` object, required
  - `promo_applied` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dataassist/apis/dataassist-io-server.md) · [All operations](https://skmtc.dev/dataassist/apis/dataassist-io-server/llms.txt) · [OpenAPI document](https://skmtc.dev/dataassist/apis/dataassist-io-server/revisions/43b22ccf75fe?raw)
