---
title: "Purchase credits"
method: POST
path: "/credits/purchase"
tags: ["Credits"]
---

# Purchase credits

`POST /credits/purchase`

## Request

- Base URL: `https://us-central1-paymentgateway-ab783.cloudfunctions.net/api`
- URL: `https://us-central1-paymentgateway-ab783.cloudfunctions.net/api/credits/purchase`
- Auth: HTTP bearer

Create a Stripe checkout session for purchasing credits

## Request body

- object
  - `appId` string, required
  - `packageId` string, required
  - `successUrl` string, uri
  - `cancelUrl` string, uri

## Response `200`

Checkout session created

- object
  - `success` boolean
  - `sessionId` string
  - `url` string

## Other responses

- `401`: Missing or invalid authentication token
- `404`: Package not found

---

[API](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api.md) · [All operations](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futuresenseai/apis/futuresense-ai-central-hub-api/revisions/53e075911af9?raw)
