Create a payment intent
POST
/api/v1/payments
const url = 'https://example.com/api/v1/payments';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"customerId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","amount":4900,"currency":"usd","idempotencyKey":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/payments \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "customerId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "amount": 4900, "currency": "usd", "idempotencyKey": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
customerId
required
Local customer id (UUID)
string format: uuid
amount
required
Amount in smallest currency unit (cents)
number
Example
4900currency
required
string
Example
usdidempotencyKey
Pass the same key on retries to guarantee the charge is created at most once
string
Responses
Section titled “Responses”Media typeapplication/json
object
payment
required
object
id
required
string
stripePaymentIntentId
required
string
customerId
required
string
amount
required
Smallest currency unit (cents)
number
currency
required
string
status
required
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
clientSecret
required
string
Example
{ "payment": { "status": "requires_payment_method" }}