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"
}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.
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"
}Unique idempotency key to prevent duplicate payments (required)
Payment intent creation data
111product, credit_topup, usage_billing 100 < x < 10000000500Payment intent created successfully
The response is of type object.