Create a checkout session

This API endpoint creates a checkout session for users to make payment for their purchases.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
🚧

Alert

Please provide a unique referenceId to avoid multiple payments and for a successful reconciliation.

Related guide(s): How payment intents work, Payment intent status and Capture method.

Successful response payload data

Parameter nameData typeDescription
idstringThe ID of the checkout session.
paymentIntentIdstring

The unique identifier for the payment transaction.

More information can be found in the How payment intents work page.

paymentIntentStatusstring

The current status of the payment intent.

The full list of statuses can be found in the Payment intent status page.

referenceIdstringThe partner’s generated ID, which generated this transaction.
referenceTypeenumeratedAn identifier to determine the type of transaction or service related to this session.
paymentMethodobjectThe payment method used for this session.
paymentMethod.familystringThe family the payment method belongs to.
paymentMethod.typestringThe payment method type.
paymentMethod.brandstringThe payment method brand.
subMerchantobject

⚠️ Required for third party acquirers
Partners' merchant information (lowest level merchant).

This will be used to display on our checkout page and e-receipt.

subMerchant.namestringThe name of the partner's merchant.
subMerchant.referencestringThe partner's merchant's ID provided by partners.
captureboolean

An identifier to see if the transaction is a captured transaction.

More information can be found in the capture method page.

amountstringThe total amount of all items after discounts and taxes.
currencystring

The three-letter ISO currency code of the payment.

Currently, only supports MYR.

referenceMetaobjectAn object to store additional information about the transaction (e.g: order details, etc.).
referenceMeta.items.itemNamestringName and description of the item.
referenceMeta.items.variationNamestringItem variation.
e.g.: M, Red.
referenceMeta.items.unitPricefloatThe price per item.
referenceMeta.items.quantityintegerThe number of items purchased.
referenceMeta.items.totalPricefloatTotal price = item quantity x item unit price.
referenceMeta.items.totalDiscountedPricefloatThe total price after discount.
referenceMeta.totalDiscountfloatThe total amount of discount given.
referenceMeta.subtotalfloatThe total amount before applying any taxes or discount, fee, etc.
referenceMeta.shippingFeefloatThe shipping fee (applicable for e-commerce).
referenceMeta.pumpNumberstringThe code for the pump being operated.
referenceMeta.stationNamestringThe name of the station where the operating pump is located.
customer.idstringThe ID of the customer.
customer.emailstringThe email of the customer.
customer.namestringThe name of the customer.
redirectobjectRedirects to a URL when the customer finishes a session.
redirect.successUrlstringThe URL to be redirected upon a successful checkout session.
redirect.cancelUrlstringThe URL to be redirected upon the cancellation of the checkout session.
webhookobjectThe webhook URL to send session information.
webhook.urlstringThe URL that will receive updates about the checkout session.
localestringStores the name of the location/region.
descriptionstringAdditional information about the order.
createdAtdate stringThe time the checkout session was created.
updatedAtdate stringThe time the checkout session was last updated.
Body Params
string

A unique string to reference the checkout session. This can be an order ID, a cart ID, or something similar generated by the merchant’s side.

paymentMethod
object

The payment method used by the user.

subMerchant
object

⚠️ Required for third-party acquirers. Stores partner's merchant information (lowest level merchant). This will be used to display on our checkout page and e-receipt.

boolean
Defaults to true

An identifier to see if the transaction is a captured transaction. For more information on this capture transaction please refer to the Holding and capturing payments page.

string
required

The total price amount of all items after discounts and taxes are applied.

string
required
Defaults to MYR

The three-letter ISO currency code of the payment. Currently, it only supports MYR.

referenceMeta
object

A class to store additional information about the transaction (e.g: order details, etc.).

customer
object

A class that contains all of the merchant customer’s details.

string

Stores the name of the location or region. Accepted values are: 'en' (English), 'ms_my' (Bahasa Melayu), 'ta' (Tamil), zh_hans (Chinese Simplified), zh_hant (Chinese Traditional).

redirect
object
required

A class that stores URLs to redirect the customer when a session is completed.

webhook
object

The webhook URL to store session information.

string

Additional information provided by partners about the transaction.

string
enum
Defaults to external-service

An identifier to determine the type of transaction or service related to this session.

Allowed:
Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json