Create a checkout session

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

🚧

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.
paymentIntentIdstringThe unique identifier for the payment transaction.

More information can be found in the How payment intents work page.
paymentIntentStatusstringThe 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.
capturebooleanAn 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.
currencystringThe 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.
Language
Authorization
Click Try It! to start a request and see the response here!