Payment Intents

Create a payment intent

Changed on

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.

post/v1/sdk/payment-intents

Request

Headers

idempotency-keystring required

Unique idempotency key to prevent duplicate payments (required)

Request body

amountinteger
currencystring
customerRefstring required
descriptionstring
planRefstring
pricingTierstring
productRefstring
purpose'product' | 'credit_topup' | 'usage_billing'

Response

Payment intent created successfully

accountIdstring

Connected Stripe account ID (only present on create)

amountnumber required

Amount in USD minor units (ledger/normalised). The charge-currency amount is originalAmount paired with currency.

clientSecretstring required

Client secret used to confirm the payment on the client

createdAtstring

Creation timestamp

currencystring required

ISO 4217 presentment (charge) currency code — pairs with originalAmount

customerRefstring

Customer reference

exchangeRatenumber

Exchange rate applied to convert to USD

expiresAtstring

Expiry timestamp of the payment intent

originalAmountnumber

Charge-currency amount in minor units (the currency the customer is billed in)

planRefstring

Plan reference

processorPaymentIdstring required

Payment processor payment intent ID

publishableKeystring required

Stripe publishable key for the environment

status'pending' | 'requires_payment_method' | 'requires_confirmation' | 'requires_action' | 'processing' | 'succeeded' | 'failed' | 'cancelled' required

Payment intent status

transactionIdstring

Ledger transaction ID

Example response

{
  "accountId": "acct_1A2B3C4D",
  "amount": 4999,
  "clientSecret": "pi_1a2b3c4d5e6f7g8h_secret_AbCdEf123456",
  "createdAt": "2025-10-18T10:30:00.000Z",
  "currency": "usd",
  "customerRef": "cus_3c4d5e6f7g8h",
  "exchangeRate": 1,
  "expiresAt": "2025-10-19T10:30:00.000Z",
  "originalAmount": 4999,
  "planRef": "pln_2b3c4d5e6f7g",
  "processorPaymentId": "pi_1a2b3c4d5e6f7g8h",
  "publishableKey": "pk_test_...",
  "status": "requires_payment_method",
  "transactionId": "507f1f77bcf86cd799439011"
}

Changes

    • warning

      added the new cancelled enum value to the response property for the response status

    • warning

      added the new failed enum value to the response property for the response status

    • warning

      added the new pending enum value to the response property for the response status

    • warning

      added the new processing enum value to the response property for the response status

    • warning

      added the new requires_action enum value to the response property for the response status

    • warning

      added the new requires_confirmation enum value to the response property for the response status

    • warning

      added the new requires_payment_method enum value to the response property for the response status

    • warning

      added the new succeeded enum value to the response property for the response status

    • info

      the request property became optional