---
title: "Create the upfront intent for the picked plan."
method: POST
path: "/api/v1/billing/checkout/payment-intent"
tags: ["Billing"]
---

# Create the upfront intent for the picked plan.

`POST /api/v1/billing/checkout/payment-intent`

## Request

- Base URL: `https://api.avatarfactory.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.avatarfactory.io/api/v1/billing/checkout/payment-intent`
- Auth: one of:
  - API key in cookie `session`
  - HTTP bearer

<br/>Normally a $1 card-validation PaymentIntent; a fully-discounting promo code<br/>switches it to a $0 SetupIntent so the card is saved but never charged.

## Request body

- CheckoutPaymentIntentRequest: Body for `POST /api/v1/billing/checkout/payment-intent`.
  - `interval` string
  - `plan` string, required
  - `promotion_code` string, nullable

## Response `200`

OK

- CheckoutIntentResponse
  - `amount` integer, required
  - `client_secret` string, nullable
  - `currency` string, required
  - `discount_amount_off` integer, nullable
  - `discount_duration` string, nullable
  - `discount_label` string, nullable
  - `discount_percent_off` number, nullable
  - `finalized` boolean
  - `intent_id` string, required
  - `interval` string, required
  - `meta_checkout_event_id` string, nullable
  - `mode` string, required
  - `plan_slug` string, required

## Other responses

- `400`: Bad Request
- `402`: Payment Required
- `422`: Unprocessable Entity
- `503`: Service Unavailable

---

[API](https://skmtc.dev/avatarfactory/apis/avatarfactory-api.md) · [All operations](https://skmtc.dev/avatarfactory/apis/avatarfactory-api/llms.txt) · [OpenAPI document](https://skmtc.dev/avatarfactory/apis/avatarfactory-api/revisions/66fc7aa3f296?raw)
