---
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. 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, required
    - `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 the charge currency (minor units)
  - `clientSecret` string, required — Client secret used to confirm the payment on the client
  - `createdAt` string — Creation timestamp
  - `currency` string, required — ISO 4217 currency code
  - `customerRef` string — Customer reference
  - `exchangeRate` number — Exchange rate applied to the amount
  - `expiresAt` string — Expiry timestamp of the payment intent
  - `originalAmount` number — Original amount in the payment currency (minor units)
  - `planRef` string — Plan reference
  - `processorPaymentId` string, required — Payment processor payment intent ID
  - `publishableKey` string, required — Stripe publishable key for the environment
  - `status` string, 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/versions/bbc2ff2bc849/schema)
