curl --request POST \
--url https://api.example.com/v1/sdk/payment-intents \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"customerReference": "cus_3c4d5e6f7g8h",
"planRef": "pln_2b3c4d5e6f7g",
"productRef": "prd_1A2B3C4D",
"pricingTier": "Pro"
}
'Creates a new payment intent for a customer to purchase a plan. Payment intents are used with Stripe.js to process payments. 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 '
{
"customerReference": "cus_3c4d5e6f7g8h",
"planRef": "pln_2b3c4d5e6f7g",
"productRef": "prd_1A2B3C4D",
"pricingTier": "Pro"
}
'Unique idempotency key to prevent duplicate payments (required)
Payment intent creation data
Customer reference identifier
"cus_3c4d5e6f7g8h"
Plan reference to purchase
"pln_2b3c4d5e6f7g"
Product reference that owns the plan
"prd_1A2B3C4D"
Name of the pricing tier to purchase (for plans with pricingTiers). If not specified, uses the plan base price.
"Pro"
Payment intent created successfully