Skip to content

Prepare a checkout payment

POST
/checkout/prepare
curl --request POST \
--url https://apisandbox.puurk.com/checkout/prepare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "amount": 25000, "oid": "example", "client_id": "example", "uid": "example", "customer_name": "example", "customer_email": "example" }'

Creates a Stripe PaymentIntent and returns the client secret and publishable key needed to collect a card with Stripe Elements. Used by the Puurk hosted checkout and by partners using Puurk as their payment processor.

Payment intent to prepare

Media typeapplication/json
object
amount
required

Amount to charge, in cents. Must not exceed 10000000.

integer
Example
25000
oid
required

Organization ID the payment belongs to

string
client_id

Your own identifier for the customer. Resolves an existing payment customer for this organization, or creates one keyed on it. Without a client_id the organization’s shared anonymous payment customer is used, so every customer’s saved cards land on the same Stripe customer — always send one.

string
uid

Puurk user ID of the customer. Rejected for service-token callers, which must use client_id.

string
customer_name

Customer name, used when creating a new payment customer

string
customer_email

Customer email. Required when neither client_id nor uid is supplied.

string

Successful operation

Media typeapplication/json
object
client_secret

PaymentIntent client secret, for Stripe Elements

string
publishable_key

Puurk’s Stripe publishable key, for initializing Stripe.js

string
payment_intent_id

Stripe PaymentIntent ID

string
customer_ephemeral_key

Stripe ephemeral key for the customer

string
customer_id

Stripe customer ID

string
payment_id

Reserved Puurk payment ID, to pass to /checkout/verify-payment

string
Examplegenerated
{
"client_secret": "example",
"publishable_key": "example",
"payment_intent_id": "example",
"customer_ephemeral_key": "example",
"customer_id": "example",
"payment_id": "example"
}

Invalid parameter

Unauthorized

Unable to process request