Skip to main content
POST
Create a checkout session

Authorizations

x-api-key
string
header
required

Your API key. Public production API-key endpoints accept kyren_live_* keys. Staging credentials are environment-specific and must be used only with the staging environment for which KyrenPay issued them.

Body

application/json
productId
string
required

The ID of the product to create a checkout for

successUrl
string<uri>
required

URL to redirect the customer to after successful payment

cancelUrl
string<uri>

URL to redirect the customer to if they cancel the payment

customerEmail
string<email>

Pre-fill the customer's email on the checkout page

customerName
string

Pre-fill the customer's name on the checkout page

merchantCustomerId
string

Optional stable merchant-side customer ID, also accepted as merchant_customer_id. This is separate from metadata used to associate your business order for fulfillment. For DOKU OVO, an explicitly identified end customer must already be registered with KyrenPay; omit this field to use the hosted anonymous browser binding flow.

displayMerchantName
string

Optional per-checkout merchant display name shown on the hosted checkout page. Also accepted as display_merchant_name.

Maximum string length: 80
metadata
object

Merchant-defined string values attached to the checkout, resulting order and payment Webhook. Supply trusted server-side businessOrderId and userId values for reconciliation. Product metadata is not automatically merged. Internal provider metadata keys are filtered from Webhooks. Do not store secrets or card data here.

Response

Checkout session created successfully

code
integer
Example:

0

message
string
Example:

"success"

data
object