Create a payment intent
Changed onCreates 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.
Request
- Base URLhttps://api.solvapay.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Unique idempotency key to prevent duplicate payments (required)
Request body
Response
Payment intent created successfully
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
cancelledenum value to theresponse property for the response status - warning
added the new
failedenum value to theresponse property for the response status - warning
added the new
pendingenum value to theresponse property for the response status - warning
added the new
processingenum value to theresponse property for the response status - warning
added the new
requires_actionenum value to theresponse property for the response status - warning
added the new
requires_confirmationenum value to theresponse property for the response status - warning
added the new
requires_payment_methodenum value to theresponse property for the response status - warning
added the new
succeededenum value to theresponse property for the response status
- warning
- info
the request property
became optional
- info