Skip to main content
POST
/
v1
/
sdk
/
payment-intents
Create a payment intent
curl --request POST \
  --url https://api.example.com/v1/sdk/payment-intents \
  --header 'Content-Type: application/json' \
  --header 'idempotency-key: <idempotency-key>' \
  --data '
{
  "customerRef": "<string>",
  "productRef": "<string>",
  "planRef": "<string>",
  "pricingTier": "<string>",
  "purpose": "product",
  "amount": 5000050,
  "currency": "<string>",
  "description": "<string>"
}
'
{
  "processorPaymentId": "pi_1a2b3c4d5e6f7g8h",
  "planRef": "pln_2b3c4d5e6f7g",
  "customerRef": "cus_3c4d5e6f7g8h",
  "amount": 4999,
  "originalAmount": 4999,
  "currency": "usd",
  "exchangeRate": 1,
  "status": "requires_payment_method",
  "clientSecret": "pi_1a2b3c4d5e6f7g8h_secret_AbCdEf123456",
  "publishableKey": "pk_test_...",
  "expiresAt": "2025-10-19T10:30:00.000Z",
  "createdAt": "2025-10-18T10:30:00.000Z"
}

Headers

idempotency-key
string
required

Unique idempotency key to prevent duplicate payments (required)

Body

application/json

Payment intent creation data

customerRef
string
required
Minimum string length: 1
productRef
string
Minimum string length: 1
planRef
string
Minimum string length: 1
pricingTier
string
purpose
enum<string>
default:product
Available options:
product,
credit_topup,
usage_billing
amount
integer
Required range: 100 < x < 10000000
currency
string
description
string
Maximum string length: 500

Response

Payment intent created successfully

The response is of type object.