---
title: "Create a payment intent"
method: POST
path: "/v1/sdk/payment-intents"
tags: ["Payment Intents"]
---

# Create a payment intent

`POST /v1/sdk/payment-intents`

Creates a new payment intent for a customer to purchase a plan, top up credits (`purpose: "credit_topup"`), or bill usage (`purpose: "usage_billing"`) with an explicit `amount`/`currency`. Requires an idempotency key to prevent duplicate charges. Returns client secret and publishable key needed for frontend integration.

## Headers

- `idempotency-key` string, required

## Request body

- CreatePaymentIntentDto
  - `amount` integer
  - `autoRecharge` object
    - `currency` string
    - `enabled` boolean
    - `maxMonthlySpendMajor` number
    - `thresholdAmountMajor` number
    - `topupAmountMajor` number
    - `triggerType` 'balance'
  - `currency` string
  - `customerRef` string, required
  - `description` string
  - `planRef` string
  - `pricingTier` string
  - `productRef` string
  - `purpose` 'product' | 'credit_topup' | 'usage_billing'

## Response `201`

Payment intent created successfully

- SdkPaymentIntentResponse
  - `accountId` string — Connected Stripe account ID (only present on create)
  - `amount` number, required — Amount in USD minor units (ledger/normalised). The charge-currency amount is `originalAmount` paired with `currency`.
  - `clientSecret` string, required — Client secret used to confirm the payment on the client
  - `createdAt` string — Creation timestamp
  - `currency` string, required — ISO 4217 presentment (charge) currency code — pairs with `originalAmount`
  - `customerRef` string — Customer reference
  - `exchangeRate` number — Exchange rate applied to convert to USD
  - `expiresAt` string — Expiry timestamp of the payment intent
  - `originalAmount` number — Charge-currency amount in minor units (the currency the customer is billed in)
  - `planRef` string — Plan reference
  - `processorPaymentId` string, required — Payment processor payment intent ID
  - `publishableKey` string, required — Stripe publishable key for the environment
  - `status` 'pending' | 'requires_payment_method' | 'requires_confirmation' | 'requires_action' | 'processing' | 'succeeded' | 'failed' | 'cancelled', required — Payment intent status
  - `transactionId` string — Ledger transaction ID

## Other responses

- `400` — Missing required fields or invalid data

---

[API](https://skmtc.net/solvapay/apis/solvapay-rest-api.md) · [All operations](https://skmtc.net/solvapay/apis/solvapay-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/solvapay/solvapay-rest-api/revisions/d29ab7373802/schema)
