---
title: "Create Checkout"
method: POST
path: "/api/v1/billing/checkout"
tags: ["Billing", "billing"]
---

# Create Checkout

`POST /api/v1/billing/checkout`

## Request

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

Create a Stripe checkout session for upgrading to a paid plan or buying report credits

## Headers

- `authorization` string

## Request body

- CheckoutRequest
  - `purchase_type` 'subscription' | 'report_credits'
  - `tier_name` string, nullable
  - `pack_size` integer, nullable
  - `product_code` string, nullable
  - `user_id` string, nullable
  - `success_url` string, nullable
  - `cancel_url` string, nullable
  - `attribution` AttributionRequest
    - `visitor_id` string, nullable
    - `session_id` string, nullable
    - `landing_page` string, nullable
    - `current_page` string, nullable
    - `referrer` string, nullable
    - `source` string, nullable
    - `medium` string, nullable
    - `campaign` string, nullable
    - `term` string, nullable
    - `content` string, nullable
    - `gclid` string, nullable
    - `gbraid` string, nullable
    - `wbraid` string, nullable
    - `browser` string, nullable
    - `os` string, nullable
    - `device` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/freeastroapi/apis/astroservice-api.md) · [All operations](https://skmtc.dev/freeastroapi/apis/astroservice-api/llms.txt) · [OpenAPI document](https://skmtc.dev/freeastroapi/apis/astroservice-api/revisions/0c9b4a759522?raw)
