For archived content, access the previous documentation here or the previous API reference here.

Create a session

Prev Next
Post
/sessions

Initiate the process of collecting payments from your customer. We recommend creating a new Session from your server and redirect the customer to the Session Hosted Checkout page. Once payment has succeeded, Session will contain a reference Payment Request or the Payment Token. You get the outcome asynchronously in a Session webhook.

Security
HTTP
Type basic
Body parameters
PaymentLink_SaveExample
{
  "reference_id": "Alice",
  "customer_id": "cust-e2878b4c-d57e-4a2c-922d-c0313c2800a3",
  "session_type": "SAVE",
  "currency": "IDR",
  "amount": 0,
  "mode": "PAYMENT_LINK",
  "country": "ID",
  "locale": "en",
  "description": "Insurance Plan Registration",
  "success_return_url": "https://yourcompany.com/success/example_item=my_item",
  "cancel_return_url": "https://yourcompany.com/cancel/example_item=my_item"
}
Component_SaveExample
{
  "reference_id": "Alice",
  "customer_id": "cust-e2878b4c-d57e-4a2c-922d-c0313c2800a3",
  "session_type": "SAVE",
  "currency": "IDR",
  "amount": 0,
  "mode": "COMPONENT",
  "country": "ID",
  "locale": "en",
  "description": "Insurance Plan Registration",
  "success_return_url": "https://yourcompany.com/success/example_item=my_item",
  "cancel_return_url": "https://yourcompany.com/cancel/example_item=my_item",
  "origins": [
    "https://yourdomain.com"
  ]
}
CardSessionJS_PayExample
{
  "reference_id": "Alice",
  "customer_id": "cust-e2878b4c-d57e-4a2c-922d-c0313c2800a3",
  "session_type": "PAY",
  "currency": "IDR",
  "amount": 0,
  "mode": "CARDS_SESSION_JS",
  "country": "ID",
  "channel_properties": {
    "card_on_file_type": "CUSTOMER_UNSCHEDULED"
  },
  "cards_session_js": {
    "success_return_url": "https://yourcompany.com/success/example_item=my_item",
    "failure_return_url": "https://yourcompany.com/failure/example_item=my_item"
  },
  "locale": "en",
  "description": "Clothes Purchase"
}
CardSessionJS_SaveExample
{
  "reference_id": "Alice",
  "customer_id": "cust-e2878b4c-d57e-4a2c-922d-c0313c2800a3",
  "session_type": "SAVE",
  "currency": "IDR",
  "amount": 0,
  "mode": "CARDS_SESSION_JS",
  "country": "ID",
  "channel_properties": {
    "card_on_file_type": "RECURRING",
    "recurring_configuration": {
      "recurring_frequency": 1,
      "recurring_expiry": "2029-10-10"
    }
  },
  "cards_session_js": {
    "success_return_url": "https://yourcompany.com/success/example_item=my_item",
    "failure_return_url": "https://yourcompany.com/failure/example_item=my_item"
  },
  "locale": "en",
  "description": "Insurance Plan Registration"
}
CardSessionJS_PayAndSaveExample
{
  "reference_id": "Alice",
  "customer_id": "cust-e2878b4c-d57e-4a2c-922d-c0313c2800a3",
  "session_type": "PAY",
  "allow_save_payment_method": "FORCED",
  "currency": "IDR",
  "amount": 0,
  "mode": "CARDS_SESSION_JS",
  "country": "ID",
  "channel_properties": {
    "card_on_file_type": "CUSTOMER_UNSCHEDULED"
  },
  "cards_session_js": {
    "success_return_url": "https://yourcompany.com/success/example_item=my_item",
    "failure_return_url": "https://yourcompany.com/failure/example_item=my_item"
  },
  "locale": "en",
  "description": "Ride book"
}
Expand All
object
reference_id
string Required

A reference to uniquely identify the Payment Session.

Min length1
Max length64
customer_id
string

Xendit-generated Customer ID

Min length41
Max length41
Examplecust-b98d6f63-d240-44ec-9bd5-aa42954c4f48
customer
object (Payment_Session_CustomerProps)

Information about the customer to create a new Xendit Customer object. Visit our docs for more details: https://xendit-docs.document360.io/apidocs/create-customer-request

session_type
string Required

The use case for Payment Session. SAVE: save the payment details from a customer for future payments. PAY: collects a one-time payment from a customer. AUTHORIZATION: authorize a card payment for a future capture. Only supported SAVE as session type for now.

Valid values[ "SAVE", "PAY", "AUTHORIZATION" ]
allow_save_payment_method
string

The option to save the payment details from a customer for the PAY session_type. Saved payment details can be used for future payments. DISABLED: does not save the payment details. OPTIONAL: allows the customer to opt-in to save the payment details. FORCED: always save the payment details. For CARDS_SESSION_JS mode use case, the value of allow_save_payment_method must be FORCED if the merchant is sending it. This field can be omitted by the merchant, which means the payment method won't be saved.

Valid values[ "DISABLED", "OPTIONAL", "FORCED" ]
currency
string Required

ISO 4217 three-letter currency code for the payment.

Valid values[ "IDR", "PHP", "VND", "THB", "SGD", "MYR", "USD" ]
ExampleIDR
amount
number Required

The payment amount to be collected from the customer. For SAVE session_type, the amount must be 0.

Minimum0.0
Example10000.0
mode
string Required

The frontend integration mode for Payment Session. PAYMENT_LINK: redirect the customer to the Xendit Hosted Checkout page. COMPONENT: collect the payment details directly from the customer on your own page using Xendit Components. CARDS_SESSION_JS: collect payment details from customer with cards-session Javascript library. Only supported PAYMENT_LINK and CARDS_SESSION_JS as mode for now.

Valid values[ "PAYMENT_LINK", "COMPONENT", "CARDS_SESSION_JS" ]
capture_method
string

The method to capture the payment. AUTOMATIC: capture the payment automatically. MANUAL: capture the payment manually.

Valid values[ "AUTOMATIC", "MANUAL" ]
country
string Required

ISO 3166-1 alpha-2 two-letter country code for the country of transaction.

Valid values[ "ID", "PH", "VN", "TH", "SG", "MY" ]
ExampleID
channel_properties
object (Payment_Session_ChannelProperties)
payment_link_configuration
object (Payment_Session_PaymentLinkConfiguration)

Contains all settings related to the Xendit Hosted Checkout page to be applied.

primary_payment_channels
Array of string

Specify the list of payment channels to display at the top of the payment channel list on the Xendit Hosted Checkout page. The array order determines the display order. If left empty, this setting will be ignored.

Example[ "CARDS", "BRI_DIRECT_DEBIT", "DANA" ]
string
allowed_payment_channels
Array of string

Specify the list of payment channels for your customer to select from the Xendit Hosted Checkout page. By default all payment channels will be available if you leave this field empty.

Example[ "CARDS", "BRI_DIRECT_DEBIT", "DANA" ]
string
Valid values[ "CARDS", "BAY_CARD_INSTALLMENT", "BBL_CARD_INSTALLMENT", "KBANK_CARD_INSTALLMENT", "KTB_CARD_INSTALLMENT", "SCB_CARD_INSTALLMENT", "TTB_CARD_INSTALLMENT", "BRI_DIRECT_DEBIT", "BCA_ONEKLIK", "CIMB_DIRECT_DEBIT", "BNI_AUTOPAY", "BPI_DIRECT_DEBIT", "UBP_DIRECT_DEBIT", "RCBC_DIRECT_DEBIT", "BDO_DIRECT_DEBIT", "CHINABANK_DIRECT_DEBIT", "MANDIRI_DIRECT_DEBIT", "BBL_DIRECT_DEBIT", "SCB_DIRECT_DEBIT", "KTB_DIRECT_DEBIT", "KRUNGSRI_DIRECT_DEBIT", "KBANK_MOBILE_BANKING", "KRUNGSRI_MOBILE_BANKING", "KTB_MOBILE_BANKING", "BBL_MOBILE_BANKING", "SCB_MOBILE_BANKING", "BDO_EPAY", "BPI_RECURRING", "UBP_EADA", "UBP_DEBIT_PULL", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", "BCA_KLIKPAY", "BDO_ONLINE_BANKING", "BPI_ONLINE_BANKING", "UNIONBANK_ONLINE_BANKING", "BOC_ONLINE_BANKING", "CHINABANK_ONLINE_BANKING", "INSTAPAY_ONLINE_BANKING", "LANDBANK_ONLINE_BANKING", "MAYBANK_ONLINE_BANKING", "METROBANK_ONLINE_BANKING", "PNB_ONLINE_BANKING", "PSBANK_ONLINE_BANKING", "PESONET_ONLINE_BANKING", "RCBC_ONLINE_BANKING", "ROBINSONS_BANK_ONLINE_BANKING", "SECURITY_BANK_ONLINE_BANKING", "BBL_GBW_MOBILE_BANKING", "KTB_GBW_MOBILE_BANKING", "BAY_GBW_MOBILE_BANKING", "SCB_GBW_MOBILE_BANKING", "KBANK_GBW_MOBILE_BANKING", "BBL_GBW_DIRECT_DEBIT", "KTB_GBW_DIRECT_DEBIT", "BAY_GBW_DIRECT_DEBIT", "SCB_GBW_DIRECT_DEBIT", "KBANK_GBW_DIRECT_DEBIT", "GRABPAY", "PAYMAYA", "GCASH", "OVO", "DANA", "LINKAJA", "SHOPEEPAY", "SAKUKU", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", "TOUCHNGO", "GOPAY", "GOPAY_RECURRING", "7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "RD_PAWNSHOP", "CVM", "ECPAY_SCHOOL", "USSC", "SM_BILLS_PAYMENT", "ROBINSONS_BILLS_PAYMENT", "ALFAMART", "INDOMARET", "BCA_VIRTUAL_ACCOUNT", "BJB_VIRTUAL_ACCOUNT", "BNI_VIRTUAL_ACCOUNT", "BRI_VIRTUAL_ACCOUNT", "MANDIRI_VIRTUAL_ACCOUNT", "PERMATA_VIRTUAL_ACCOUNT", "BSI_VIRTUAL_ACCOUNT", "CIMB_VIRTUAL_ACCOUNT", "SAHABAT_SAMPOERNA_VIRTUAL_ACCOUNT", "ARTAJASA_VIRTUAL_ACCOUNT", "PV_VIRTUAL_ACCOUNT", "BSS_VIRTUAL_ACCOUNT", "VIETCAPITAL_VIRTUAL_ACCOUNT", "WOORI_VIRTUAL_ACCOUNT", "MSB_VIRTUAL_ACCOUNT", "STANDARD_CHARTERED_VIRTUAL_ACCOUNT", "AMBANK_VIRTUAL_ACCOUNT", "BNC_VIRTUAL_ACCOUNT", "HANA_VIRTUAL_ACCOUNT", "MUAMALAT_VIRTUAL_ACCOUNT", "BANK_TRANSFER", "QRIS", "PROMPTPAY", "QRPH" ]
expires_at
string (date-time)

ISO 8601 date-time format. By default the Session will expire 30 minutes after creation. We recommend you to keep Sessions short-lived and create a new Session again only when the customer is ready to make payment.

Example2021-12-31T23:59:59Z
locale
string

ISO 639-1 two-letter language code for Hosted Checkout page.

Default"en"
Exampleen
metadata
object (Payment_Session_MerchantMetadata) | null

Key-value entries for your custom data. You can specify up to 50 keys, with key names up to 40 characters and values up to 500 characters. This is for your convenience. Xendit will not use this data for any processing.

Example{ "my_custom_id": "merchant-123", "my_custom_order_id": "order-123" }
description
string

A custom description for the Session. This text will be displayed on the Xendit Hosted Checkout page.

Min length1
Max length1000
ExamplePayment for your order #123
items
Array of object (Payment_Session_XenditStandardItem) | null

Array of objects describing the item/s attached to the payment session. It will be displayed in Xendit Hosted Checkout UI.

object
type

Type of item

Valid values[ "DIGITAL_PRODUCTS", "PHYSICAL_PRODUCT", "DIGITAL_SERVICE", "PHYSICAL_SERVICE", "FEES", "DISCOUNT" ]
name
string Required

Name of item

Min length1
Max length255
net_unit_amount
number Required

Net amount to be charged per unit. Must be a negative number when type = DISCOUNT

quantity
integer Required

Number of units of this item in the basket

Minimum1.0
url
string

URL of the item. Must be HTTPS or HTTP

image_url
string

URL of the image of the item. Must be HTTPS or HTTP

category
string

Category for item

Max length255
subcategory
string

Sub-category for item

Max length255
description
string

Description of item

Max length255
metadata
object (Payment_Session_MerchantMetadata) | null

Key-value entries for your custom data. You can specify up to 50 keys, with key names up to 40 characters and values up to 500 characters. This is for your convenience. Xendit will not use this data for any processing.

Example{ "my_custom_id": "merchant-123", "my_custom_order_id": "order-123" }
success_return_url
string

Specify the URL to redirect the customer after the session is completed or expired, or if the customer decide to stop the payment process. Must be HTTPS. For example: "https://yourcompany.com/example_item=my_example_item"

Examplehttps://yourcompany.com/example_item
cancel_return_url
string

Specify the URL to redirect the customer after the session is completed or expired, or if the customer decide to stop the payment process. Must be HTTPS. For example: "https://yourcompany.com/example_item=my_example_item"

Examplehttps://yourcompany.com/example_item
origins
Array of string | null

Origins will be used for sessions flows with mode COMPONENT to validate CORS

Example[ "https://yourcompany.com" ]
string
Responses
201

Session Created

createSessionResponseExample
{
  "payment_session_id": "ps-661f87c614802d6c402cd82d",
  "created": "2021-12-31T23:59:59Z",
  "updated": "2021-12-31T23:59:59Z",
  "reference_id": "Alice",
  "customer_id": "cust-e2878b4c-d57e-4a2c-922d-c0313c2800a3",
  "session_type": "SAVE",
  "currency": "IDR",
  "amount": 0,
  "country": "ID",
  "mode": "PAYMENT_LINK",
  "channel_properties": {},
  "allowed_payment_channels": [
    "OVO",
    "DANA"
  ],
  "expires_at": "2021-12-31T23:59:59Z",
  "locale": "en",
  "description": "Insurance Plan Registration",
  "success_return_url": "https://yourcompany.com/success/example_item=my_item",
  "cancel_return_url": "https://yourcompany.com/cancel/example_item=my_item",
  "items": null,
  "metadata": null,
  "status": "ACTIVE",
  "payment_link_url": "https://xen.to/kGxPCi60",
  "payment_token_id": null,
  "payment_request_id": null,
  "business_id": "661f87c614802d6c402cd82d"
}
Expand All
object
payment_session_id
string

A unique identifier for the Payment Session

Min length27
Max length27
Exampleps-661f87c614802d6c402cd82d
created
string (date-time)
Example2021-12-31T23:59:59Z
updated
string (date-time)
Example2021-12-31T23:59:59Z
reference_id
string

A reference to uniquely identify the Payment Session.

Min length1
Max length64
customer_id
string

Xendit-generated Customer ID

Min length41
Max length41
Examplecust-b98d6f63-d240-44ec-9bd5-aa42954c4f48
session_type
string

The use case for Payment Session. SAVE: save the payment details from a customer for future payments. PAY: collects a one-time payment from a customer. AUTHORIZATION: authorize a card payment for a future capture. Only supported SAVE as session type for now.

Valid values[ "SAVE", "PAY", "AUTHORIZATION" ]
allow_save_payment_method
string

The option to save the payment details from a customer for the PAY session_type. Saved payment details can be used for future payments. DISABLED: does not save the payment details. OPTIONAL: allows the customer to opt-in to save the payment details. FORCED: always save the payment details. For CARDS_SESSION_JS mode use case, the value of allow_save_payment_method must be FORCED if the merchant is sending it. This field can be omitted by the merchant, which means the payment method won't be saved.

Valid values[ "DISABLED", "OPTIONAL", "FORCED" ]
currency
string

ISO 4217 three-letter currency code for the payment.

Valid values[ "IDR", "PHP", "VND", "THB", "SGD", "MYR", "USD" ]
ExampleIDR
amount
number

The payment amount to be collected from the customer. For SAVE session_type, the amount must be 0.

Minimum0.0
Example10000.0
country
string

ISO 3166-1 alpha-2 two-letter country code for the country of transaction.

Valid values[ "ID", "PH", "VN", "TH", "SG", "MY" ]
ExampleID
mode
string

The frontend integration mode for Payment Session. PAYMENT_LINK: redirect the customer to the Xendit Hosted Checkout page. COMPONENT: collect the payment details directly from the customer on your own page using Xendit Components. CARDS_SESSION_JS: collect payment details from customer with cards-session Javascript library. Only supported PAYMENT_LINK and CARDS_SESSION_JS as mode for now.

Valid values[ "PAYMENT_LINK", "COMPONENT", "CARDS_SESSION_JS" ]
capture_method
string

The method to capture the payment. AUTOMATIC: capture the payment automatically. MANUAL: capture the payment manually.

Valid values[ "AUTOMATIC", "MANUAL" ]
channel_properties
object (Payment_Session_ChannelProperties)
payment_link_configuration
object (Payment_Session_PaymentLinkConfiguration)

Contains all settings related to the Xendit Hosted Checkout page to be applied.

primary_payment_channels
Array of string

Specify the list of payment channels to display at the top of the payment channel list on the Xendit Hosted Checkout page. The array order determines the display order. If left empty, this setting will be ignored.

Example[ "CARDS", "BRI_DIRECT_DEBIT", "DANA" ]
string
allowed_payment_channels
Array of string

Specify the list of payment channels for your customer to select from the Xendit Hosted Checkout page. By default all payment channels will be available if you leave this field empty.

Example[ "CARDS", "BRI_DIRECT_DEBIT", "DANA" ]
string
Valid values[ "CARDS", "BAY_CARD_INSTALLMENT", "BBL_CARD_INSTALLMENT", "KBANK_CARD_INSTALLMENT", "KTB_CARD_INSTALLMENT", "SCB_CARD_INSTALLMENT", "TTB_CARD_INSTALLMENT", "BRI_DIRECT_DEBIT", "BCA_ONEKLIK", "CIMB_DIRECT_DEBIT", "BNI_AUTOPAY", "BPI_DIRECT_DEBIT", "UBP_DIRECT_DEBIT", "RCBC_DIRECT_DEBIT", "BDO_DIRECT_DEBIT", "CHINABANK_DIRECT_DEBIT", "MANDIRI_DIRECT_DEBIT", "BBL_DIRECT_DEBIT", "SCB_DIRECT_DEBIT", "KTB_DIRECT_DEBIT", "KRUNGSRI_DIRECT_DEBIT", "KBANK_MOBILE_BANKING", "KRUNGSRI_MOBILE_BANKING", "KTB_MOBILE_BANKING", "BBL_MOBILE_BANKING", "SCB_MOBILE_BANKING", "BDO_EPAY", "BPI_RECURRING", "UBP_EADA", "UBP_DEBIT_PULL", "AFFIN_FPX", "AGRO_FPX", "ALLIANCE_FPX", "AMBANK_FPX", "ISLAM_FPX", "MUAMALAT_FPX", "BOC_FPX", "RAKYAT_FPX", "BSN_FPX", "CIMB_FPX", "HLB_FPX", "HSBC_FPX", "KFH_FPX", "MAYB2E_FPX", "MAYB2U_FPX", "OCBC_FPX", "PUBLIC_FPX", "RHB_FPX", "SCH_FPX", "UOB_FPX", "AFFIN_FPX_BUSINESS", "AGRO_FPX_BUSINESS", "ALLIANCE_FPX_BUSINESS", "AMBANK_FPX_BUSINESS", "ISLAM_FPX_BUSINESS", "MUAMALAT_FPX_BUSINESS", "BNP_FPX_BUSINESS", "CIMB_FPX_BUSINESS", "CITIBANK_FPX_BUSINESS", "DEUTSCHE_FPX_BUSINESS", "HLB_FPX_BUSINESS", "HSBC_FPX_BUSINESS", "RAKYAT_FPX_BUSINESS", "KFH_FPX_BUSINESS", "MAYB2E_FPX_BUSINESS", "OCBC_FPX_BUSINESS", "PUBLIC_FPX_BUSINESS", "RHB_FPX_BUSINESS", "SCH_FPX_BUSINESS", "UOB_FPX_BUSINESS", "BCA_KLIKPAY", "BDO_ONLINE_BANKING", "BPI_ONLINE_BANKING", "UNIONBANK_ONLINE_BANKING", "BOC_ONLINE_BANKING", "CHINABANK_ONLINE_BANKING", "INSTAPAY_ONLINE_BANKING", "LANDBANK_ONLINE_BANKING", "MAYBANK_ONLINE_BANKING", "METROBANK_ONLINE_BANKING", "PNB_ONLINE_BANKING", "PSBANK_ONLINE_BANKING", "PESONET_ONLINE_BANKING", "RCBC_ONLINE_BANKING", "ROBINSONS_BANK_ONLINE_BANKING", "SECURITY_BANK_ONLINE_BANKING", "BBL_GBW_MOBILE_BANKING", "KTB_GBW_MOBILE_BANKING", "BAY_GBW_MOBILE_BANKING", "SCB_GBW_MOBILE_BANKING", "KBANK_GBW_MOBILE_BANKING", "BBL_GBW_DIRECT_DEBIT", "KTB_GBW_DIRECT_DEBIT", "BAY_GBW_DIRECT_DEBIT", "SCB_GBW_DIRECT_DEBIT", "KBANK_GBW_DIRECT_DEBIT", "GRABPAY", "PAYMAYA", "GCASH", "OVO", "DANA", "LINKAJA", "SHOPEEPAY", "SAKUKU", "NEXCASH", "ASTRAPAY", "JENIUSPAY", "APPOTA", "MOMO", "VNPTWALLET", "VIETTELPAY", "ZALOPAY", "WECHATPAY", "LINEPAY", "TRUEMONEY", "ALIPAY", "TOUCHNGO", "GOPAY", "GOPAY_RECURRING", "7ELEVEN", "7ELEVEN_CLIQQ", "CEBUANA", "ECPAY", "PALAWAN", "MLHUILLIER", "ECPAY_DRAGONLOAN", "LBC", "RD_PAWNSHOP", "CVM", "ECPAY_SCHOOL", "USSC", "SM_BILLS_PAYMENT", "ROBINSONS_BILLS_PAYMENT", "ALFAMART", "INDOMARET", "BCA_VIRTUAL_ACCOUNT", "BJB_VIRTUAL_ACCOUNT", "BNI_VIRTUAL_ACCOUNT", "BRI_VIRTUAL_ACCOUNT", "MANDIRI_VIRTUAL_ACCOUNT", "PERMATA_VIRTUAL_ACCOUNT", "BSI_VIRTUAL_ACCOUNT", "CIMB_VIRTUAL_ACCOUNT", "SAHABAT_SAMPOERNA_VIRTUAL_ACCOUNT", "ARTAJASA_VIRTUAL_ACCOUNT", "PV_VIRTUAL_ACCOUNT", "BSS_VIRTUAL_ACCOUNT", "VIETCAPITAL_VIRTUAL_ACCOUNT", "WOORI_VIRTUAL_ACCOUNT", "MSB_VIRTUAL_ACCOUNT", "STANDARD_CHARTERED_VIRTUAL_ACCOUNT", "AMBANK_VIRTUAL_ACCOUNT", "BNC_VIRTUAL_ACCOUNT", "HANA_VIRTUAL_ACCOUNT", "MUAMALAT_VIRTUAL_ACCOUNT", "BANK_TRANSFER", "QRIS", "PROMPTPAY", "QRPH" ]
expires_at
string (date-time)

ISO 8601 date-time format. By default the Session will expire 30 minutes after creation. We recommend you to keep Sessions short-lived and create a new Session again only when the customer is ready to make payment.

Example2021-12-31T23:59:59Z
locale
string

ISO 639-1 two-letter language code for Hosted Checkout page.

Default"en"
Exampleen
metadata
object (Payment_Session_MerchantMetadata) | null

Key-value entries for your custom data. You can specify up to 50 keys, with key names up to 40 characters and values up to 500 characters. This is for your convenience. Xendit will not use this data for any processing.

Example{ "my_custom_id": "merchant-123", "my_custom_order_id": "order-123" }
description
string

A custom description for the Session. This text will be displayed on the Xendit Hosted Checkout page.

Min length1
Max length1000
ExamplePayment for your order #123
items
Array of object (Payment_Session_XenditStandardItem) | null

Array of objects describing the item/s attached to the payment session. It will be displayed in Xendit Hosted Checkout UI.

object
type

Type of item

Valid values[ "DIGITAL_PRODUCTS", "PHYSICAL_PRODUCT", "DIGITAL_SERVICE", "PHYSICAL_SERVICE", "FEES", "DISCOUNT" ]
name
string

Name of item

Min length1
Max length255
net_unit_amount
number

Net amount to be charged per unit. Must be a negative number when type = DISCOUNT

quantity
integer

Number of units of this item in the basket

Minimum1.0
url
string

URL of the item. Must be HTTPS or HTTP

image_url
string

URL of the image of the item. Must be HTTPS or HTTP

category
string

Category for item

Max length255
subcategory
string

Sub-category for item

Max length255
description
string

Description of item

Max length255
metadata
object (Payment_Session_MerchantMetadata) | null

Key-value entries for your custom data. You can specify up to 50 keys, with key names up to 40 characters and values up to 500 characters. This is for your convenience. Xendit will not use this data for any processing.

Example{ "my_custom_id": "merchant-123", "my_custom_order_id": "order-123" }
success_return_url
string

Specify the URL to redirect the customer after the session is completed or expired, or if the customer decide to stop the payment process. Must be HTTPS. For example: "https://yourcompany.com/example_item=my_example_item"

Examplehttps://yourcompany.com/example_item
cancel_return_url
string

Specify the URL to redirect the customer after the session is completed or expired, or if the customer decide to stop the payment process. Must be HTTPS. For example: "https://yourcompany.com/example_item=my_example_item"

Examplehttps://yourcompany.com/example_item
status
string

The status of the Payment Session.

Valid values[ "ACTIVE", "COMPLETED", "EXPIRED", "CANCELED" ]
payment_link_url
string | null

The URL for Xendit Hosted Checkout page. Redirect your customer to this URL to complete the payment.

Examplehttps://checkout.xendit.co/sessions/ps-661f87c614802d6c402cd82d0 or https://xen.to/kGxPCi60. For test mode, https://checkout-staging.xendit.co/sessions/ps-661f87c614802d6c402cd82d0 or https://dev.xen.to/kGxPCi76
payment_token_id
string | null

Xendit Payment Token ID used to reference the saved payment details from the customer.

Exampleptkn-cc3938dc-c2a5-43c4-89d7-7570793348c2
payment_id
string | null

Xendit Payment ID used to reference the captured payment details from the customer.

Examplepy-ac1fcd3e-21c5-4c70-bb06-fa3c34e19e0c
payment_request_id
string | null

Xendit Payment Request ID used to reference the payment made during this Session.

Examplepr-0800fe40-bb79-47ae-9d1e-e69394d3949c
business_id
string
components_sdk_key
string | null

key will be used for sessions flows with mode COMPONENT

Examplef5RBHw4S3SeZV8KGlBxjy8tyN2Vg4klA5Bww7
origins
Array of string | null

Origins will be used for sessions flows with mode COMPONENT to validate CORS

Example[ "https://yourcompany.com" ]
string
400

Bad Request

object
error_code
string
ExampleAPI_VALIDATION_ERROR
message
string
errors
Array
OneOf
string
string
object
object
401

Unauthorized

object
error_code
string
ExampleINVALID_API_KEY
message
string
errors
Array
OneOf
string
string
object
object
404

Not Found

object
error_code
string
ExampleCUSTOMER_NOT_FOUND, SESSION_NOT_FOUND
message
string
errors
Array
OneOf
string
string
object
object
4XX

Client Side Bad Request Error

500

Internal Server Error

object
error_code
string
ExampleSERVER_ERROR
message
string
errors
Array
OneOf
string
string
object
object
5XX

Server Side Error