Skip to main content
POST
Checkout Sessions
A Checkout Session represents your customer’s session as they pay for one-time purchases or subscriptions through Pursar’s hosted checkout page. When you create a Checkout Session, Pursar returns a url to which you redirect your customer. After the customer completes their payment, Pursar redirects them to your specified success_url with the checkout session ID.

Authentication

Pursar follows the Stripe standard HTTP Basic Authentication format. Pass your Secret Key as the Basic Auth username (with an empty password), or in the Authorization: Bearer header.

Request Body

number
required
The total amount to charge in the currency’s standard or minor unit (e.g., 15000 for 15,000 XAF).
string
default:"XAF"
Three-letter ISO currency code (XAF, XOF, GHS, KES, USD, EUR).
string
required
The URL to which Pursar redirects your customer when the payment is successful. You can include {CHECKOUT_SESSION_ID} as a template parameter.
string
The URL to which Pursar redirects your customer if they choose to cancel or abandon the checkout page.
string
If provided, this email is pre-filled on the hosted checkout page.
string
A unique string to reference the Checkout Session on your system.
array
A list of items the customer is purchasing.
object
Key-value pairs for attaching custom data to the session and downstream transaction.

Code Examples


Response Example