Skip to main content
POST
Creates a new checkout session and returns a scoped token (px_checkout_...) valid for 30 minutes. Pass this scoped token to your frontend to initialize PayX.checkout() securely without exposing your secret API keys.

Authentication

This endpoint requires your v2 secret API key:
  • Header: x-api-key: px_live_v2_... or Authorization: Bearer px_live_v2_...

Body Parameters

number
required
The amount to collect in GHS. Must be a positive number with at most 2 decimal places (e.g. 100.00).
string
default:"GHS"
required
The 3-letter ISO currency code. Currently only GHS is supported.
string
required
The customer’s email address.
object
Optional key-value object to store custom application metadata associated with the transaction.

Response

string
The 30-minute scoped token (starts with px_checkout_) to pass to the frontend PayX.checkout({ token }) modal.
string
The hosted checkout page URL (https://payx.company/checkout?key=...).
string
ISO 8601 timestamp indicating when the checkout token will expire.