Airwallex logo

Checkout SessionsEarly access

Copy for LLMView as Markdown
Checkout Sessions is available for early access
Expect limited functionality as we continue development and build the product in partnership with early users. Reach out to your Airwallex account manager or [email protected] if you would like to use this feature. Learn more about early access.Docs

A Checkout Session manages the setup and lifecycle of an Airwallex-hosted customer checkout experience, including billing subscriptions, one-off payments and payment setup flows. We recommend creating a new Checkout Session each time a customer initiates a purchase. After the customer successfully completes the session, downstream resources such as Billing Customer, Customer, Payment Source, Payment Consent, Subscription, or Invoice may be created depending on the session mode.

Endpoints
POST /api/v1/checkout/checkout_sessions/create
GET /api/v1/checkout/checkout_sessions/{id}
GET /api/v1/checkout/checkout_sessions
POST /api/v1/checkout/checkout_sessions/{id}/update
POST /api/v1/checkout/checkout_sessions/{id}/cancel

Create a Checkout SessionEarly access

POST /api/v1/checkout/checkout_sessions/create

Create a Checkout Session is available for early access
Expect limited functionality as we continue development and build the product in partnership with early users. Reach out to your Airwallex account manager or [email protected] if you would like to use this feature. Learn more about early access.Docs

Creates a Checkout Session object.

A Checkout Session is created for one of the following use cases:

  • One-off payment. Set mode to PAYMENT. Omit invoice_creation, or set invoice_creation.enabled to false. PaymentsDocs.
  • One-off payment with an invoice. Set mode to PAYMENT and set invoice_creation.enabled to true. InvoicesDocs.
  • Subscription payments. Set mode to SUBSCRIPTION. BillingDocs.
  • Save a payment method for future use.
    • Save as Payment Consent. Set mode to SETUP and pass customer_id. This field is required. PaymentsDocs.
    • Save as Payment Source. Set mode to SETUP and pass billing_customer_id. This field is required. BillingDocs.
Request body
moderequiredstring

The mode of the Checkout Session object, can be one of:

  • PAYMENT: Accept one-off payments.
  • SUBSCRIPTION: Set up subscriptions.
  • SETUP: Collect payment details to charge your customers later.
request_idrequiredstring

Unique request ID specified by the merchant.

account_idstring

ID of the Airwallex payment account to collect payment. You can find this ID in the Airwallex web app > Settings > Account details, within the Account Information section. Required if you have more than 1 payment account in your organisation.

back_urlstring

If set, the hosted checkout page displays a back button which allows customers to cancel the flow and be directed to this URL.

billing_customer_idstring

The ID of the Billing Customer associated with this Checkout Session.

Use this field when:

  • mode is PAYMENT and invoice_creation.enabled is true.
  • mode is SUBSCRIPTION.
  • mode is SETUP and the collected payment method is saved as a Payment Source. The field is required in this case.

Mutually exclusive with customer_id.

currencystring

The checkout currency in 3-letter ISO-4217 format. Required when mode is PAYMENT or SETUP.

customer_dataobject

The prefilled information of the customer. Only applicable when billing_customer_id and customer_id are omitted and mode is not SETUP.

customer_data.country_codestring

Two-letter ISO 3166 country code of the shopper's country. Strongly recommended — drives which payment methods are surfaced (iDEAL / EPS etc. are country-restricted). Falls back to IP geo when absent.

customer_data.emailstring

The prefilled email of the customer. If this field, or a customer_id or billing_customer_id with an email on file, is provided, the email will be prefilled and will not be editable during checkout. If no email is provided, the Checkout Session prompts the customer to enter their email.

customer_data.namestring

The prefilled name of the customer. If this field, or a customer_id or billing_customer_id with a name on file, is provided, the name will be prefilled and will not be editable during checkout. If no name is provided, the Checkout Session prompts the customer to enter their name.

customer_data.typestring

Type of the customer, one of BUSINESS or INDIVIDUAL. If not provided and no type is available from an existing customer, an "I am purchasing as a business" checkbox is displayed for the customer to self-select.

customer_data_collectionobject

Provides configuration for the Checkout Session to collect information from customers.

customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address is collected only when necessary, including when automatic tax is enabled or a tax ID is collected.
  • REQUIRED: Billing address is always collected. Defaults to AUTO.
customer_data_collection.emailstring

Controls whether the email address will be collected during checkout.

  • AUTO: Email address is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Email address is always collected.
AUTO
REQUIRED
customer_data_collection.namestring

Controls whether the name will be collected during checkout.

  • AUTO: Name is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Name is always collected.
AUTO
REQUIRED
customer_data_collection.phone_numberstring

Controls whether the phone number will be collected during checkout.

  • AUTO: Phone number is collected only when necessary.
  • REQUIRED: Phone number is always collected.
AUTO
REQUIRED
customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for a business customer during checkout.

  • DISABLED: Tax ID will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax ID is optionally collected in supported countries by displaying the "I am purchasing as a business" checkbox.
  • REQUIRED_IF_SUPPORTED: Tax ID is always collected when the country is supported. Defaults to OPTIONAL_IF_SUPPORTED.
customer_idstring

The ID of the Customer associated with this Checkout Session.

Use this field when:

  • mode is PAYMENT and invoice_creation.enabled is false or omitted.
  • mode is SETUP and the collected payment method is saved as a Payment Consent. The field is required in this case.

Mutually exclusive with billing_customer_id.

discountsarray

List of discounts to be applied to the subscription or invoice. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported. Only applicable when an invoice is created.

discounts.couponrequiredobject

Coupon to redeem into a discount for this resource. Required when type is COUPON.

discounts.coupon.idrequiredstring

id of the Coupon object.

discounts.typerequiredstring

Specifies how to obtain the discount. One of: COUPON.

enable_automatic_taxboolean

Whether automatic tax is enabled for this checkout. When enabled, the system attempts to calculate taxes for this checkout's invoice automatically. Defaults to false. Only applicable when an invoice is created.

hosted_completion_pageobject

Configuration of the customer experience after the Checkout Session completes. Only applicable when ui_mode is HOSTED.

hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after the Checkout Session completes and before the customer is redirected to success_url.

invoice_creationobject

Invoice creation settings. Only applicable when mode is PAYMENT.

invoice_creation.enabledrequiredboolean

Whether to create an invoice for this Checkout Session. Only applicable when mode is PAYMENT.

invoice_creation.invoice_dataobject

The settings of the invoice to be created when enabled is true.

invoice_creation.invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

invoice_creation.invoice_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

invoice_creation.invoice_data.due_atstring

Due date set by the merchant for this invoice, if any. Only one of days_until_due and due_at should be passed.

invoice_creation.invoice_data.memostring

String used for merchants to share a custom message to their customers. Referenced as memo or invoice note in Webapp.

invoice_creation.invoice_data.metadataobject

A set of key-value pairs that you can attach to this object for storing additional information.

legal_entity_idstring

ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings. Required when your organisation has more than one legal entity. Only applicable when an invoice is created.

line_itemsarray

A list of items the customer is purchasing. Required when mode is SUBSCRIPTION or PAYMENT. Not applicable when mode is SETUP.
When mode is SUBSCRIPTION, all line items must have a recurring Price.
When mode is PAYMENT, all line items must have a non-recurring Price.

line_items.discountsarray

List of discounts to be applied to the line item. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported. Only applicable when an invoice is created.

line_items.discounts.couponrequiredobject

Coupon to redeem into a discount for this resource. Required when type is COUPON.

line_items.discounts.coupon.idrequiredstring

id of the Coupon object.

line_items.discounts.typerequiredstring

Specifies how to obtain the discount. One of: COUPON.

line_items.priceobject

One-time price definition following the same schema as the Price resource. Exactly one of price_id or price is required. Only applicable when mode is PAYMENT.

line_items.price.currencyrequiredstring

Currency of the price (in 3-letter ISO-4217 format).

line_items.price.descriptionstring

Price description. Used for internal classification and identification.

line_items.price.flat_amountnumber

The fixed amount to be charged. Required when pricing_model is FLAT.

line_items.price.metadataobject

Custom key-value pairs attached to the price.

line_items.price.pricing_modelstring

Specify how to calculate the total billing amount when a quantity is provided. One of

  • FLAT: a fixed price.
  • PER_UNIT: a fixed price per unit quantity. Defaults to PER_UNIT.
line_items.price.productobject

One-time product definition following the same schema as the Product. Exactly one of product_id or product is required.

line_items.price.product.namerequiredstring

Product name.

line_items.price.product.descriptionstring

Product description. Used for internal classification and identification.

line_items.price.product.metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

line_items.price.product.tax_codestring

The tax category of the product.

line_items.price.product.unitstring

Product unit.

line_items.price.product_idstring

ID of the Product object. Exactly one of product_id or product is required.

line_items.price.tax_includedboolean

Whether the price includes tax. Defaults to false.

line_items.price.unit_amountnumber

The amount to be charged per product unit. Required when pricing_model is PER_UNIT.

line_items.price_idstring

ID of the Price object. Exactly one of price_id or price is required.

line_items.quantityinteger

The quantity of the line item being purchased. Defaults to 1.

line_items.tax_percentnumber

The effective tax percent of this line item. Only applicable when an invoice is created.

localestring

The locale for your website. Defaults to the browser's locale; however, if the browser's locale is not supported, it will default to en.

Accepted values: ar, da, de, en, es, fi, fr, he, id, it, ja, ko, ms, nl, pl, pt, ro, ru, si, sv, tr, vi, ur, zh, zh-HK.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

payment_intent_dataobject

A subset of parameters used to create the Payment Intent for this Checkout Session.

payment_intent_data.descriptorstring

Descriptor that will display to the customer on their bank statement. Maximum length is 32. Only applicable when mode is PAYMENT.

payment_intent_data.merchant_order_idstring

The order unique identifier created in merchant's order system that corresponds to this Payment Intent. Maximum length is 64.

payment_intent_data.shippingobject

Shipping information.

payment_intent_data.shipping.addressobject

Shipping address.

payment_intent_data.shipping.address.country_coderequiredstring

The two-letter country code in ISO 3166-1 alpha-2 format.

payment_intent_data.shipping.address.citystring

City of the address.

payment_intent_data.shipping.address.postcodestring

Postcode of the address.

payment_intent_data.shipping.address.statestring

State or province of the address.

payment_intent_data.shipping.address.streetstring

Street address.

payment_intent_data.shipping.fee_amountnumber

Shipping fee amount.

payment_intent_data.shipping.first_namestring

First name of the recipient. Maximum of 128 characters.

payment_intent_data.shipping.last_namestring

Last name of the recipient. Maximum of 128 characters.

payment_intent_data.shipping.phone_numberstring

Phone number of the recipient. Maximum of 50 characters.

payment_intent_data.shipping.shipping_delayed_atstring

Use if customer chose to deliver the item at a later time. The timestamp must include an explicit timezone, for example Z or -04:00.

payment_intent_data.shipping.shipping_methodstring

Shipping method for the product. Maximum of 128 characters.

payment_optionsobject

Payment settings of this Checkout Session.

payment_options.allowed_card_networksarray

One or more card networks that you support. Accepted values are visa, mastercard, maestro, unionpay, amex, jcb, diners, and discover. Only applicable when mode is PAYMENT.

payment_options.authorization_typestring

The authorization type of the card payment. One of final_auth, pre_auth. Defaults to final_auth. Set it to pre_auth if you want to place a hold on your customer's card for more than 7 days. pre_auth is only applicable to Visa or Mastercard and requires auto_capture to be false. Only applicable when mode is PAYMENT.

final_auth
pre_auth
payment_options.auto_captureboolean

Whether the amount should be captured automatically upon successful payment authorization. Set to false to place a hold on the payment method and capture the funds later. Defaults to true. Only applicable when mode is PAYMENT.

payment_options.pay_by_invoice_enabledboolean

Enables the option to "Request an invoice" for payment. After the customer confirms to pay with this option, the status of Checkout Session will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Checkout Session, and other configurations in invoice_creation.invoice_data. Only applicable when an invoice is created, and the customer type is BUSINESS.

payment_options.payment_method_saveobject

Settings that control whether and how the payment method can be reused for future payments.

payment_options.payment_method_save.modestring

Whether and how to store the payment method used in this Checkout Session for future payments. Accepted values:

  • ENABLED: Always store the payment method when possible; no checkbox is shown.
  • DISABLED: Never store the payment method; always treat the transaction as guest checkout.
  • COLLECT_CONSENT: Show a checkbox and only store the payment method if the customer explicitly opts in. Only applicable to cards.
payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved Payment Source or Payment Consent to trigger future payments. One of MERCHANT or CUSTOMER. If MERCHANT, a Payment Source or Payment Consent is created for future use. If CUSTOMER, the payment method is saved only with the payment provider.

payment_options.payment_method_typesarray

Specify which payment methods to display on the Checkout Page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the Checkout Page. If omitted, all available payment methods are displayed in the default order.
Possible values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible values when mode is PAYMENT: card, applepay, googlepay, wechatpay, alipaycn, alipayhk, gcash, dana, kakaopay, tng, truemoney, bkash, poli, fpx, bank_transfer, alfamart, doku_ewallet, enets, grabpay, indomaret, konbini, online_banking, payeasy, payeasy_atm, seven_eleven, skrill, tesco_lotus, eps, giropay, bancontact, ideal, multibanco, p24, sofort, trustly, dragonpay, blik, mybank, paybybankapp, safetypay, verkkopankki, maxima, narvesen, paypost, perlas_terminals, paysafecash, paysafecard, paysera, satispay, family_mart, hi_life, permata_atm, sam_kiosk, axs_kiosk, esun, shopee_pay, boost, paypal, payu, bitpay, ovo, rabbit_line_pay, ach_direct_debit, bacs_direct_debit, becs_direct_debit, sepa_direct_debit, eft_direct_debit, atome, go_pay, jenius_pay, linkaja, duit_now, pay_now, prompt_pay, airwallex_pay, fps, klarna, korean_local_card, payco, samsung_pay, naver_pay, toss_pay, upi, line_pay, paypay, merpay, d_barai, au_pay, rakuten_pay, zip, spei, afterpay, airi, lumi, payto, twint, venmo, pix, laybuy, cash_app_pay, payme, octopus, tabby, spaylater, wero, jkopay, affirm, bizum, cartes_bancaires, swish, mbway.
Possible values when mode is SETUP: card.

return_urlstring

The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site, with payment status not confirmed. Only applicable when ui_mode is EMBEDDED or ELEMENTS.

subscription_dataobject

The settings of subscription to be passed to the subscription creation upon completion of the Checkout Session in SUBSCRIPTION mode.

subscription_data.days_until_dueinteger

Number of days from invoice finalization until payment is due. Defaults to 0.

subscription_data.default_invoice_templateobject

Invoices for the Subscription will be created using the specified settings.

subscription_data.default_invoice_template.invoice_memostring

Memo to be used for the invoices that are generated by this Subscription.

subscription_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

subscription_data.durationobject

The total duration of the subscription.

subscription_data.duration.periodrequiredinteger

The number of period units.

subscription_data.duration.period_unitrequiredstring

Specifies billing duration. One of DAY, WEEK, MONTH or YEAR.

subscription_data.metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

subscription_data.starts_atstring

Time when the subscription started or scheduled to start. Defaults to start immediately after creation.

subscription_data.trial_ends_atstring

The end time of the trial if applicable.

success_urlstring

The URL the customer will be directed to after the checkout completion. Only applicable when ui_mode is HOSTED.

ui_modestring

The UI mode of the Checkout Session:

  • HOSTED: Customers complete checkout on an Airwallex-hosted page.
  • EMBEDDED: Embed the checkout UI directly in your website or app.
  • ELEMENTS: Build a custom checkout UI using Airwallex Elements.

Defaults to HOSTED. When no invoice is created, only HOSTED is supported.

ui_optionsobject

Customization options for the Checkout Page.

ui_options.layoutobject

The layout of the Checkout Page.

ui_options.layout.payment_methodsstring

Specify the layout for the payment elements. Accepted values are tab and accordion. By default, accordion layout is used on desktop and tab layout is used on mobile. Only applicable when no invoice is created.

ui_options.submit_typestring

Describes the type of transaction being performed in order to customize the submit button text. Accepted values are pay, book, subscribe, and save.

ui_options.theme_idstring

ID of the theme to apply to this Checkout Session, overriding the theme applied to its legal entity. You can find this ID in the Airwallex web app > Settings > Themes.

Response body - 201 Created
account_idstring

ID of the Airwallex payment account used to collect payment. You can find this ID in the Airwallex web app > Settings > Account details, within the Account Information section.

automatic_tax_statusstring

The automatic tax status of this checkout. One of:

  • APPLIED: The automatic tax is applied.
  • DISABLED: The automatic tax is disabled.
  • LOCATION_NOT_SUPPORTED: Automatic tax calculation isn't supported in the customer's location.
  • LOCATION_NOT_REGISTERED_BY_MERCHANT: The merchant isn't registered to collect tax in the customer's location.
  • ADDRESS_INCOMPLETE: The customer address was insufficient or invalid to determine the correct tax.
APPLIED
DISABLED
LOCATION_NOT_SUPPORTED
LOCATION_NOT_REGISTERED_BY_MERCHANT
ADDRESS_INCOMPLETE
back_urlstring

If set, the hosted checkout page displays a back button which allows customers to cancel the flow and be directed to this URL.

billing_customer_idstring

ID of the Billing Customer associated with this Checkout Session, if applicable.

cancelled_atstring

Time when the Checkout Session was cancelled.

client_secretstring

The client secret used to initialize the Checkout Session in EMBEDDED or ELEMENTS ui_mode. Only present when ui_mode is EMBEDDED or ELEMENTS.

completed_atstring

Time when the Checkout Session was completed.

created_atstring

Time when the Checkout Session was created.

currencystring

The checkout currency in 3-letter ISO-4217 format.

customer_dataobject

The prefilled information of the customer.

customer_data.country_codestring

Two-letter ISO 3166 country code of the shopper's country. Strongly recommended — drives which payment methods are surfaced (iDEAL / EPS etc. are country-restricted). Falls back to IP geo when absent.

customer_data.emailstring

The prefilled email of the customer. If this field, or a customer_id or billing_customer_id with an email on file, is provided, the email will be prefilled and will not be editable during checkout. If no email is provided, the Checkout Session prompts the customer to enter their email.

customer_data.namestring

The prefilled name of the customer. If this field, or a customer_id or billing_customer_id with a name on file, is provided, the name will be prefilled and will not be editable during checkout. If no name is provided, the Checkout Session prompts the customer to enter their name.

customer_data.typestring

Type of the customer, one of BUSINESS or INDIVIDUAL. If not provided and no type is available from an existing customer, an "I am purchasing as a business" checkbox is displayed for the customer to self-select.

customer_data_collectionobject

Provides configuration for the Checkout Session to collect information from customers.

customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address is collected only when necessary, including when automatic tax is enabled or a tax ID is collected.
  • REQUIRED: Billing address is always collected. Defaults to AUTO.
customer_data_collection.emailstring

Controls whether the email address will be collected during checkout.

  • AUTO: Email address is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Email address is always collected.
AUTO
REQUIRED
customer_data_collection.namestring

Controls whether the name will be collected during checkout.

  • AUTO: Name is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Name is always collected.
AUTO
REQUIRED
customer_data_collection.phone_numberstring

Controls whether the phone number will be collected during checkout.

  • AUTO: Phone number is collected only when necessary.
  • REQUIRED: Phone number is always collected.
AUTO
REQUIRED
customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for a business customer during checkout.

  • DISABLED: Tax ID will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax ID is optionally collected in supported countries by displaying the "I am purchasing as a business" checkbox.
  • REQUIRED_IF_SUPPORTED: Tax ID is always collected when the country is supported. Defaults to OPTIONAL_IF_SUPPORTED.
customer_idstring

ID of the Customer from the Payments API associated with this Checkout Session, if applicable.

discountsarray

List of discounts applied to the subscription or invoice. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

discounts.typestring

Specifies how to obtain the discount. One of: COUPON.

discounts.couponobject

Coupon to redeem into a discount for this resource. Only required when type = COUPON.

discounts.coupon.idstring

id of the Coupon object.

enable_automatic_taxboolean

Whether automatic tax is enabled for this checkout. When enabled, the system attempts to calculate taxes for this checkout's invoice automatically.

expires_atstring

Time when the Checkout Session expires.

hosted_completion_pageobject

Configuration of the customer experience after the Checkout Session completes. Only applicable when ui_mode is HOSTED.

hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after the Checkout Session completes and before the customer is redirected to success_url.

idstring

ID of the Checkout Session object.

invoice_creationobject

Invoice creation settings for this Checkout Session.

invoice_creation.enabledboolean

Whether an invoice is created for this Checkout Session.

invoice_creation.invoice_dataobject

The invoice settings used for this Checkout Session.

invoice_creation.invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

invoice_creation.invoice_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

invoice_creation.invoice_data.due_atstring

Due date set by the merchant for this invoice, if any.

invoice_creation.invoice_data.memostring

String used for merchants to share a custom message to their customers. Referenced as memo or invoice note in Webapp.

invoice_creation.invoice_data.metadataobject

A set of key-value pairs that you can attach to this object for storing additional information.

invoice_idstring

ID of the invoice for the Checkout Session when mode is PAYMENT. Only applicable when status is COMPLETED.

legal_entity_idstring

ID of the legal entity to be used as billing entity, which can be retrieved from the legal_entity_id field in the Retrieve account details API response.

line_itemsarray

A list of items the customer is purchasing.

line_items.discountsarray

List of discounts applied to the line item. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

line_items.discounts.typestring

Specifies how to obtain the discount. One of: COUPON.

line_items.discounts.couponobject

Coupon to redeem into a discount for this resource. Only required when type = COUPON.

line_items.discounts.coupon.idstring

id of the Coupon object.

line_items.price_idstring

ID of the Price object.

line_items.quantityinteger

The quantity of the line item being purchased.

line_items.tax_percentnumber

The effective tax percent of this line item.

localestring

The locale for the Checkout Session.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

modestring

The mode of the Checkout Session object, can be one of:

  • PAYMENT: Accept one-off payments.
  • SUBSCRIPTION: Set up subscriptions.
  • SETUP: Collect payment details to charge your customers later.
payment_intent_dataobject

The Payment Intent parameters configured for this Checkout Session.

payment_intent_data.descriptorstring

Descriptor that will display to the customer on their bank statement. Maximum length is 32. Only applicable when mode is PAYMENT.

payment_intent_data.merchant_order_idstring

The order unique identifier created in merchant's order system that corresponds to this Payment Intent. Maximum length is 64.

payment_intent_data.shippingobject

Shipping information.

payment_intent_data.shipping.addressobject

Shipping address.

payment_intent_data.shipping.address.country_codestring

The two-letter country code in ISO 3166-1 alpha-2 format.

payment_intent_data.shipping.address.citystring

City of the address.

payment_intent_data.shipping.address.postcodestring

Postcode of the address.

payment_intent_data.shipping.address.statestring

State or province of the address.

payment_intent_data.shipping.address.streetstring

Street address.

payment_intent_data.shipping.fee_amountnumber

Shipping fee amount.

payment_intent_data.shipping.first_namestring

First name of the recipient. Maximum of 128 characters.

payment_intent_data.shipping.last_namestring

Last name of the recipient. Maximum of 128 characters.

payment_intent_data.shipping.phone_numberstring

Phone number of the recipient. Maximum of 50 characters.

payment_intent_data.shipping.shipping_delayed_atstring

Use if customer chose to deliver the item at a later time. The timestamp must include an explicit timezone, for example Z or -04:00.

payment_intent_data.shipping.shipping_methodstring

Shipping method for the product. Maximum of 128 characters.

payment_intent_idstring

ID of the Payment Intent associated with this Checkout Session.

payment_optionsobject

Payment settings of this Checkout Session.

payment_options.allowed_card_networksarray

One or more card networks that you support. Accepted values are visa, mastercard, maestro, unionpay, amex, jcb, diners, and discover. Only applicable when mode is PAYMENT.

payment_options.authorization_typestring

The authorization type of the card payment. One of final_auth, pre_auth. Defaults to final_auth. Set it to pre_auth if you want to place a hold on your customer's card for more than 7 days. pre_auth is only applicable to Visa or Mastercard and requires auto_capture to be false. Only applicable when mode is PAYMENT.

final_auth
pre_auth
payment_options.auto_captureboolean

Whether the amount should be captured automatically upon successful payment authorization. Set to false to place a hold on the payment method and capture the funds later. Defaults to true. Only applicable when mode is PAYMENT.

payment_options.pay_by_invoice_enabledboolean

Enables the option to "Request an invoice" for payment. After the customer confirms to pay with this option, the status of Checkout Session will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Checkout Session, and other configurations in invoice_creation.invoice_data. Only applicable when an invoice is created, and the customer type is BUSINESS.

payment_options.payment_method_saveobject

Settings that control whether and how the payment method can be reused for future payments.

payment_options.payment_method_save.modestring

Whether and how to store the payment method used in this Checkout Session for future payments. Accepted values:

  • ENABLED: Always store the payment method when possible; no checkbox is shown.
  • DISABLED: Never store the payment method; always treat the transaction as guest checkout.
  • COLLECT_CONSENT: Show a checkbox and only store the payment method if the customer explicitly opts in. Only applicable to cards.
payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved Payment Source or Payment Consent to trigger future payments. One of MERCHANT or CUSTOMER. If MERCHANT, a Payment Source or Payment Consent is created for future use. If CUSTOMER, the payment method is saved only with the payment provider.

payment_options.payment_method_typesarray

Specify which payment methods to display on the Checkout Page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the Checkout Page. If omitted, all available payment methods are displayed in the default order.
Possible values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible values when mode is PAYMENT: card, applepay, googlepay, wechatpay, alipaycn, alipayhk, gcash, dana, kakaopay, tng, truemoney, bkash, poli, fpx, bank_transfer, alfamart, doku_ewallet, enets, grabpay, indomaret, konbini, online_banking, payeasy, payeasy_atm, seven_eleven, skrill, tesco_lotus, eps, giropay, bancontact, ideal, multibanco, p24, sofort, trustly, dragonpay, blik, mybank, paybybankapp, safetypay, verkkopankki, maxima, narvesen, paypost, perlas_terminals, paysafecash, paysafecard, paysera, satispay, family_mart, hi_life, permata_atm, sam_kiosk, axs_kiosk, esun, shopee_pay, boost, paypal, payu, bitpay, ovo, rabbit_line_pay, ach_direct_debit, bacs_direct_debit, becs_direct_debit, sepa_direct_debit, eft_direct_debit, atome, go_pay, jenius_pay, linkaja, duit_now, pay_now, prompt_pay, airwallex_pay, fps, klarna, korean_local_card, payco, samsung_pay, naver_pay, toss_pay, upi, line_pay, paypay, merpay, d_barai, au_pay, rakuten_pay, zip, spei, afterpay, airi, lumi, payto, twint, venmo, pix, laybuy, cash_app_pay, payme, octopus, tabby, spaylater, wero, jkopay, affirm, bizum, cartes_bancaires, swish, mbway.
Possible values when mode is SETUP: card.

payment_source_idstring

ID of the Payment Source created when the Checkout Session is completed.

return_urlstring

The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site, with payment status not confirmed.

statusstring

The status of the Checkout Session object, can be one of:

  • ACTIVE: The Checkout Session is available for the customer to complete a purchase.
  • COMPLETED: The Checkout Session has been completed.
  • CANCELLED: The Checkout Session has been cancelled.
  • EXPIRED: The Checkout Session has expired.

The status automatically changes from ACTIVE to EXPIRED after 1 hour if purchase has not been completed.

subscription_dataobject

The settings of subscription to be passed to the subscription creation upon completion of the Checkout Session in SUBSCRIPTION mode.

subscription_data.days_until_dueinteger

Number of days from invoice finalization until payment is due. Defaults to 0.

subscription_data.recurringobject

The billing cycle for recurring charges.

subscription_data.recurring.periodinteger

The number of period units between subscription billing cycles. For example, the billing cycle is bi-monthly if period=2 and period_unit=MONTH.

subscription_data.recurring.period_unitstring

Specifies billing frequency. One of DAY, WEEK, MONTH or YEAR.

subscription_data.default_invoice_templateobject

Invoices for the Subscription will be created using the specified settings.

subscription_data.default_invoice_template.invoice_memostring

Memo to be used for the invoices that are generated by this Subscription.

subscription_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

subscription_data.durationobject

The total duration of the subscription.

subscription_data.duration.periodinteger

The number of period units.

subscription_data.duration.period_unitstring

Specifies billing duration. One of DAY, WEEK, MONTH or YEAR.

subscription_data.metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

subscription_data.starts_atstring

Time when the subscription started or scheduled to start. Defaults to start immediately after creation.

subscription_data.trial_ends_atstring

The end time of the trial if applicable.

subscription_idstring

ID of the subscription for the Checkout Session when mode is SUBSCRIPTION. Only applicable when status is COMPLETED.

success_urlstring

The URL the customer will be directed to after the checkout completion.

ui_modestring

The UI mode of the Checkout Session, can be one of:
HOSTED: Customers complete the checkout on an Airwallex-hosted page.
EMBEDDED: Embed the checkout UI directly in your website or app.
ELEMENTS: Build a custom checkout UI using Airwallex Elements.

ui_optionsobject

Customization options for the Checkout Page.

ui_options.layoutobject

The layout of the Checkout Page.

ui_options.layout.payment_methodsstring

Specify the layout for the payment elements. Accepted values are tab and accordion. By default, accordion layout is used on desktop and tab layout is used on mobile. Only applicable when no invoice is created.

ui_options.submit_typestring

Describes the type of transaction being performed in order to customize the submit button text. Accepted values are pay, book, subscribe, and save.

ui_options.theme_idstring

ID of the theme to apply to this Checkout Session, overriding the theme applied to its legal entity. You can find this ID in the Airwallex web app > Settings > Themes.

updated_atstring

Time when the Checkout Session was last updated.

urlstring

The URL to the Checkout Session. Only present when status is ACTIVE.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error, duplicate_request_id

401

Unauthorized. Possible error codes: unauthorized

500

Server Error. Possible error codes: internal_error

POST /api/v1/checkout/checkout_sessions/create
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/checkout/checkout_sessions/create' \
> --header 'Authorization: Bearer <token>' \
> --header 'Content-Type: application/json' \
> --data '{
> "mode": "PAYMENT",
> "request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
> "success_url": "https://www.airwallex.com/success",
> "account_id": "acct_ncI2nypPKSq2VXKxscAcg",
> "back_url": "https://www.airwallex.com/back",
> "currency": "USD",
> "customer_data_collection": {
> "tax_id": "OPTIONAL_IF_SUPPORTED",
> "billing_address": "REQUIRED",
> "phone_number": "REQUIRED",
> "name": "REQUIRED",
> "email": "REQUIRED"
> },
> "customer_id": "cus_hkpd7fedfgb004apkvs",
> "invoice_creation": {
> "enabled": false
> },
> "payment_intent_data": {
> "descriptor": "AIRWALLEX",
> "merchant_order_id": "order_123",
> "shipping": {
> "address": {
> "country_code": "AU",
> "city": "Melbourne",
> "postcode": "3000",
> "state": "VIC",
> "street": "1 Collins Street"
> },
> "fee_amount": 5,
> "first_name": "John",
> "last_name": "Doe",
> "phone_number": "+61400000000",
> "shipping_method": "standard"
> }
> },
> "line_items": [
> {
> "price_id": "pri_hkpd7fedfgb004apkvs",
> "quantity": 1
> }
> ],
> "metadata": {
> "foo": "bar"
> },
> "payment_options": {
> "payment_method_types": [
> "card",
> "googlepay",
> "applepay"
> ],
> "auto_capture": true,
> "authorization_type": "final_auth",
> "allowed_card_networks": [
> "visa",
> "mastercard"
> ],
> "payment_method_save": {
> "mode": "ENABLED",
> "next_triggered_by": "MERCHANT"
> }
> },
> "ui_mode": "HOSTED",
> "locale": "en"
>}'
Response (201 Created)
1{
2 "automatic_tax_status": "DISABLED",
3 "created_at": "2025-05-10T16:00:30+0000",
4 "discounts": [],
5 "enable_automatic_tax": false,
6 "expires_at": "2025-05-10T17:00:30+0000",
7 "id": "bco_sgstcdcpnh8sv3awiwo",
8 "mode": "PAYMENT",
9 "status": "ACTIVE",
10 "success_url": "https://www.airwallex.com/success",
11 "updated_at": "2025-05-10T16:00:30+0000",
12 "account_id": "acct_ncI2nypPKSq2VXKxscAcg",
13 "back_url": "https://www.airwallex.com/back",
14 "currency": "USD",
15 "customer_data_collection": {
16 "tax_id": "OPTIONAL_IF_SUPPORTED",
17 "billing_address": "REQUIRED",
18 "phone_number": "REQUIRED",
19 "name": "REQUIRED",
20 "email": "REQUIRED"
21 },
22 "customer_id": "cus_hkpd7fedfgb004apkvs",
23 "invoice_creation": {
24 "enabled": false
25 },
26 "payment_intent_data": {
27 "descriptor": "AIRWALLEX",
28 "merchant_order_id": "order_123",
29 "shipping": {
30 "address": {
31 "country_code": "AU",
32 "city": "Melbourne",
33 "postcode": "3000",
34 "state": "VIC",
35 "street": "1 Collins Street"
36 },
37 "fee_amount": 5,
38 "first_name": "John",
39 "last_name": "Doe",
40 "phone_number": "+61400000000",
41 "shipping_method": "standard"
42 }
43 },
44 "line_items": [
45 {
46 "price_id": "pri_hkpd7fedfgb004apkvs",
47 "discounts": [],
48 "quantity": 1
49 }
50 ],
51 "metadata": {
52 "foo": "bar"
53 },
54 "payment_options": {
55 "payment_method_types": [
56 "card",
57 "googlepay",
58 "applepay"
59 ],
60 "auto_capture": true,
61 "authorization_type": "final_auth",
62 "allowed_card_networks": [
63 "visa",
64 "mastercard"
65 ],
66 "payment_method_save": {
67 "mode": "ENABLED",
68 "next_triggered_by": "MERCHANT"
69 }
70 },
71 "ui_mode": "HOSTED",
72 "locale": "en",
73 "url": "https://checkout.airwallex.com/pay?s=jwt_token"
74}
Was this section helpful?

Retrieve a Checkout SessionEarly access

GET /api/v1/checkout/checkout_sessions/{id}

Retrieve a Checkout Session is available for early access
Expect limited functionality as we continue development and build the product in partnership with early users. Reach out to your Airwallex account manager or [email protected] if you would like to use this feature. Learn more about early access.Docs

Retrieves a Checkout Session.

Path parameters
idrequiredstring

ID of the Checkout Session object.

Response body - 200 OK
account_idstring

ID of the Airwallex payment account used to collect payment. You can find this ID in the Airwallex web app > Settings > Account details, within the Account Information section.

automatic_tax_statusstring

The automatic tax status of this checkout. One of:

  • APPLIED: The automatic tax is applied.
  • DISABLED: The automatic tax is disabled.
  • LOCATION_NOT_SUPPORTED: Automatic tax calculation isn't supported in the customer's location.
  • LOCATION_NOT_REGISTERED_BY_MERCHANT: The merchant isn't registered to collect tax in the customer's location.
  • ADDRESS_INCOMPLETE: The customer address was insufficient or invalid to determine the correct tax.
APPLIED
DISABLED
LOCATION_NOT_SUPPORTED
LOCATION_NOT_REGISTERED_BY_MERCHANT
ADDRESS_INCOMPLETE
back_urlstring

If set, the hosted checkout page displays a back button which allows customers to cancel the flow and be directed to this URL.

billing_customer_idstring

ID of the Billing Customer associated with this Checkout Session, if applicable.

cancelled_atstring

Time when the Checkout Session was cancelled.

client_secretstring

The client secret used to initialize the Checkout Session in EMBEDDED or ELEMENTS ui_mode. Only present when ui_mode is EMBEDDED or ELEMENTS.

completed_atstring

Time when the Checkout Session was completed.

created_atstring

Time when the Checkout Session was created.

currencystring

The checkout currency in 3-letter ISO-4217 format.

customer_dataobject

The prefilled information of the customer.

customer_data.country_codestring

Two-letter ISO 3166 country code of the shopper's country. Strongly recommended — drives which payment methods are surfaced (iDEAL / EPS etc. are country-restricted). Falls back to IP geo when absent.

customer_data.emailstring

The prefilled email of the customer. If this field, or a customer_id or billing_customer_id with an email on file, is provided, the email will be prefilled and will not be editable during checkout. If no email is provided, the Checkout Session prompts the customer to enter their email.

customer_data.namestring

The prefilled name of the customer. If this field, or a customer_id or billing_customer_id with a name on file, is provided, the name will be prefilled and will not be editable during checkout. If no name is provided, the Checkout Session prompts the customer to enter their name.

customer_data.typestring

Type of the customer, one of BUSINESS or INDIVIDUAL. If not provided and no type is available from an existing customer, an "I am purchasing as a business" checkbox is displayed for the customer to self-select.

customer_data_collectionobject

Provides configuration for the Checkout Session to collect information from customers.

customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address is collected only when necessary, including when automatic tax is enabled or a tax ID is collected.
  • REQUIRED: Billing address is always collected. Defaults to AUTO.
customer_data_collection.emailstring

Controls whether the email address will be collected during checkout.

  • AUTO: Email address is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Email address is always collected.
AUTO
REQUIRED
customer_data_collection.namestring

Controls whether the name will be collected during checkout.

  • AUTO: Name is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Name is always collected.
AUTO
REQUIRED
customer_data_collection.phone_numberstring

Controls whether the phone number will be collected during checkout.

  • AUTO: Phone number is collected only when necessary.
  • REQUIRED: Phone number is always collected.
AUTO
REQUIRED
customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for a business customer during checkout.

  • DISABLED: Tax ID will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax ID is optionally collected in supported countries by displaying the "I am purchasing as a business" checkbox.
  • REQUIRED_IF_SUPPORTED: Tax ID is always collected when the country is supported. Defaults to OPTIONAL_IF_SUPPORTED.
customer_idstring

ID of the Customer from the Payments API associated with this Checkout Session, if applicable.

discountsarray

List of discounts applied to the subscription or invoice. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

discounts.typestring

Specifies how to obtain the discount. One of: COUPON.

discounts.couponobject

Coupon to redeem into a discount for this resource. Only required when type = COUPON.

discounts.coupon.idstring

id of the Coupon object.

enable_automatic_taxboolean

Whether automatic tax is enabled for this checkout. When enabled, the system attempts to calculate taxes for this checkout's invoice automatically.

expires_atstring

Time when the Checkout Session expires.

hosted_completion_pageobject

Configuration of the customer experience after the Checkout Session completes. Only applicable when ui_mode is HOSTED.

hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after the Checkout Session completes and before the customer is redirected to success_url.

idstring

ID of the Checkout Session object.

invoice_creationobject

Invoice creation settings for this Checkout Session.

invoice_creation.enabledboolean

Whether an invoice is created for this Checkout Session.

invoice_creation.invoice_dataobject

The invoice settings used for this Checkout Session.

invoice_creation.invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

invoice_creation.invoice_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

invoice_creation.invoice_data.due_atstring

Due date set by the merchant for this invoice, if any.

invoice_creation.invoice_data.memostring

String used for merchants to share a custom message to their customers. Referenced as memo or invoice note in Webapp.

invoice_creation.invoice_data.metadataobject

A set of key-value pairs that you can attach to this object for storing additional information.

invoice_idstring

ID of the invoice for the Checkout Session when mode is PAYMENT. Only applicable when status is COMPLETED.

legal_entity_idstring

ID of the legal entity to be used as billing entity, which can be retrieved from the legal_entity_id field in the Retrieve account details API response.

line_itemsarray

A list of items the customer is purchasing.

line_items.discountsarray

List of discounts applied to the line item. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

line_items.discounts.typestring

Specifies how to obtain the discount. One of: COUPON.

line_items.discounts.couponobject

Coupon to redeem into a discount for this resource. Only required when type = COUPON.

line_items.discounts.coupon.idstring

id of the Coupon object.

line_items.price_idstring

ID of the Price object.

line_items.quantityinteger

The quantity of the line item being purchased.

line_items.tax_percentnumber

The effective tax percent of this line item.

localestring

The locale for the Checkout Session.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

modestring

The mode of the Checkout Session object, can be one of:

  • PAYMENT: Accept one-off payments.
  • SUBSCRIPTION: Set up subscriptions.
  • SETUP: Collect payment details to charge your customers later.
payment_intent_dataobject

The Payment Intent parameters configured for this Checkout Session.

payment_intent_data.descriptorstring

Descriptor that will display to the customer on their bank statement. Maximum length is 32. Only applicable when mode is PAYMENT.

payment_intent_data.merchant_order_idstring

The order unique identifier created in merchant's order system that corresponds to this Payment Intent. Maximum length is 64.

payment_intent_data.shippingobject

Shipping information.

payment_intent_data.shipping.addressobject

Shipping address.

payment_intent_data.shipping.address.country_codestring

The two-letter country code in ISO 3166-1 alpha-2 format.

payment_intent_data.shipping.address.citystring

City of the address.

payment_intent_data.shipping.address.postcodestring

Postcode of the address.

payment_intent_data.shipping.address.statestring

State or province of the address.

payment_intent_data.shipping.address.streetstring

Street address.

payment_intent_data.shipping.fee_amountnumber

Shipping fee amount.

payment_intent_data.shipping.first_namestring

First name of the recipient. Maximum of 128 characters.

payment_intent_data.shipping.last_namestring

Last name of the recipient. Maximum of 128 characters.

payment_intent_data.shipping.phone_numberstring

Phone number of the recipient. Maximum of 50 characters.

payment_intent_data.shipping.shipping_delayed_atstring

Use if customer chose to deliver the item at a later time. The timestamp must include an explicit timezone, for example Z or -04:00.

payment_intent_data.shipping.shipping_methodstring

Shipping method for the product. Maximum of 128 characters.

payment_intent_idstring

ID of the Payment Intent associated with this Checkout Session.

payment_optionsobject

Payment settings of this Checkout Session.

payment_options.allowed_card_networksarray

One or more card networks that you support. Accepted values are visa, mastercard, maestro, unionpay, amex, jcb, diners, and discover. Only applicable when mode is PAYMENT.

payment_options.authorization_typestring

The authorization type of the card payment. One of final_auth, pre_auth. Defaults to final_auth. Set it to pre_auth if you want to place a hold on your customer's card for more than 7 days. pre_auth is only applicable to Visa or Mastercard and requires auto_capture to be false. Only applicable when mode is PAYMENT.

final_auth
pre_auth
payment_options.auto_captureboolean

Whether the amount should be captured automatically upon successful payment authorization. Set to false to place a hold on the payment method and capture the funds later. Defaults to true. Only applicable when mode is PAYMENT.

payment_options.pay_by_invoice_enabledboolean

Enables the option to "Request an invoice" for payment. After the customer confirms to pay with this option, the status of Checkout Session will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Checkout Session, and other configurations in invoice_creation.invoice_data. Only applicable when an invoice is created, and the customer type is BUSINESS.

payment_options.payment_method_saveobject

Settings that control whether and how the payment method can be reused for future payments.

payment_options.payment_method_save.modestring

Whether and how to store the payment method used in this Checkout Session for future payments. Accepted values:

  • ENABLED: Always store the payment method when possible; no checkbox is shown.
  • DISABLED: Never store the payment method; always treat the transaction as guest checkout.
  • COLLECT_CONSENT: Show a checkbox and only store the payment method if the customer explicitly opts in. Only applicable to cards.
payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved Payment Source or Payment Consent to trigger future payments. One of MERCHANT or CUSTOMER. If MERCHANT, a Payment Source or Payment Consent is created for future use. If CUSTOMER, the payment method is saved only with the payment provider.

payment_options.payment_method_typesarray

Specify which payment methods to display on the Checkout Page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the Checkout Page. If omitted, all available payment methods are displayed in the default order.
Possible values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible values when mode is PAYMENT: card, applepay, googlepay, wechatpay, alipaycn, alipayhk, gcash, dana, kakaopay, tng, truemoney, bkash, poli, fpx, bank_transfer, alfamart, doku_ewallet, enets, grabpay, indomaret, konbini, online_banking, payeasy, payeasy_atm, seven_eleven, skrill, tesco_lotus, eps, giropay, bancontact, ideal, multibanco, p24, sofort, trustly, dragonpay, blik, mybank, paybybankapp, safetypay, verkkopankki, maxima, narvesen, paypost, perlas_terminals, paysafecash, paysafecard, paysera, satispay, family_mart, hi_life, permata_atm, sam_kiosk, axs_kiosk, esun, shopee_pay, boost, paypal, payu, bitpay, ovo, rabbit_line_pay, ach_direct_debit, bacs_direct_debit, becs_direct_debit, sepa_direct_debit, eft_direct_debit, atome, go_pay, jenius_pay, linkaja, duit_now, pay_now, prompt_pay, airwallex_pay, fps, klarna, korean_local_card, payco, samsung_pay, naver_pay, toss_pay, upi, line_pay, paypay, merpay, d_barai, au_pay, rakuten_pay, zip, spei, afterpay, airi, lumi, payto, twint, venmo, pix, laybuy, cash_app_pay, payme, octopus, tabby, spaylater, wero, jkopay, affirm, bizum, cartes_bancaires, swish, mbway.
Possible values when mode is SETUP: card.

payment_source_idstring

ID of the Payment Source created when the Checkout Session is completed.

return_urlstring

The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site, with payment status not confirmed.

statusstring

The status of the Checkout Session object, can be one of:

  • ACTIVE: The Checkout Session is available for the customer to complete a purchase.
  • COMPLETED: The Checkout Session has been completed.
  • CANCELLED: The Checkout Session has been cancelled.
  • EXPIRED: The Checkout Session has expired.

The status automatically changes from ACTIVE to EXPIRED after 1 hour if purchase has not been completed.

subscription_dataobject

The settings of subscription to be passed to the subscription creation upon completion of the Checkout Session in SUBSCRIPTION mode.

subscription_data.days_until_dueinteger

Number of days from invoice finalization until payment is due. Defaults to 0.

subscription_data.recurringobject

The billing cycle for recurring charges.

subscription_data.recurring.periodinteger

The number of period units between subscription billing cycles. For example, the billing cycle is bi-monthly if period=2 and period_unit=MONTH.

subscription_data.recurring.period_unitstring

Specifies billing frequency. One of DAY, WEEK, MONTH or YEAR.

subscription_data.default_invoice_templateobject

Invoices for the Subscription will be created using the specified settings.

subscription_data.default_invoice_template.invoice_memostring

Memo to be used for the invoices that are generated by this Subscription.

subscription_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

subscription_data.durationobject

The total duration of the subscription.

subscription_data.duration.periodinteger

The number of period units.

subscription_data.duration.period_unitstring

Specifies billing duration. One of DAY, WEEK, MONTH or YEAR.

subscription_data.metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

subscription_data.starts_atstring

Time when the subscription started or scheduled to start. Defaults to start immediately after creation.

subscription_data.trial_ends_atstring

The end time of the trial if applicable.

subscription_idstring

ID of the subscription for the Checkout Session when mode is SUBSCRIPTION. Only applicable when status is COMPLETED.

success_urlstring

The URL the customer will be directed to after the checkout completion.

ui_modestring

The UI mode of the Checkout Session, can be one of:
HOSTED: Customers complete the checkout on an Airwallex-hosted page.
EMBEDDED: Embed the checkout UI directly in your website or app.
ELEMENTS: Build a custom checkout UI using Airwallex Elements.

ui_optionsobject

Customization options for the Checkout Page.

ui_options.layoutobject

The layout of the Checkout Page.

ui_options.layout.payment_methodsstring

Specify the layout for the payment elements. Accepted values are tab and accordion. By default, accordion layout is used on desktop and tab layout is used on mobile. Only applicable when no invoice is created.

ui_options.submit_typestring

Describes the type of transaction being performed in order to customize the submit button text. Accepted values are pay, book, subscribe, and save.

ui_options.theme_idstring

ID of the theme to apply to this Checkout Session, overriding the theme applied to its legal entity. You can find this ID in the Airwallex web app > Settings > Themes.

updated_atstring

Time when the Checkout Session was last updated.

urlstring

The URL to the Checkout Session. Only present when status is ACTIVE.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error

401

Unauthorized. Possible error codes: unauthorized

404

Not Found. Possible error codes: resource_not_found

500

Server Error. Possible error codes: internal_error

GET /api/v1/checkout/checkout_sessions/{id}
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/checkout/checkout_sessions/checkout_session_id' \
> --header 'Authorization: Bearer <token>' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "automatic_tax_status": "DISABLED",
3 "created_at": "2025-05-10T16:00:30+0000",
4 "discounts": [],
5 "enable_automatic_tax": false,
6 "expires_at": "2025-05-10T17:00:30+0000",
7 "id": "bco_sgstcdcpnh8sv3awiwo",
8 "mode": "PAYMENT",
9 "status": "ACTIVE",
10 "success_url": "https://www.airwallex.com/success",
11 "ui_mode": "HOSTED",
12 "updated_at": "2025-05-10T16:00:30+0000",
13 "account_id": "acct_ncI2nypPKSq2VXKxscAcg",
14 "back_url": "https://www.airwallex.com/back",
15 "currency": "USD",
16 "customer_data_collection": {
17 "tax_id": "OPTIONAL_IF_SUPPORTED",
18 "billing_address": "REQUIRED",
19 "phone_number": "REQUIRED",
20 "name": "REQUIRED",
21 "email": "REQUIRED"
22 },
23 "customer_id": "cus_hkpd7fedfgb004apkvs",
24 "payment_intent_data": {
25 "merchant_order_id": "order_123"
26 },
27 "line_items": [
28 {
29 "price_id": "pri_hkpd7fedfgb004apkvs",
30 "discounts": [],
31 "quantity": 1
32 }
33 ],
34 "metadata": {
35 "foo": "bar"
36 },
37 "payment_options": {
38 "payment_method_types": [
39 "card",
40 "googlepay",
41 "applepay"
42 ]
43 },
44 "url": "https://checkout.airwallex.com/pay?s=jwt_token"
45}
Was this section helpful?

Get list of Checkout SessionsEarly access

GET /api/v1/checkout/checkout_sessions

Get list of Checkout Sessions is available for early access
Expect limited functionality as we continue development and build the product in partnership with early users. Reach out to your Airwallex account manager or [email protected] if you would like to use this feature. Learn more about early access.Docs

Retrieves a list of Checkout Sessions based on the query parameters.

Query parameters
from_created_atstring

The start date of created_at in ISO8601 format (inclusive).

pagestring

A bookmark for use in pagination to retrieve either the next page or the previous page of results. You can fetch the value for this identifier from the response of the previous API call. To retrieve the next page of results, pass the value of page_after (if not null) from the response to a subsequent call. To retrieve the previous page of results, pass the value of page_before (if not null) from the response to a subsequent call.

page_sizeinteger

Number of Checkout Sessions per page. Defaults to 20.

statusstring

Status of the Checkout Session.

subscription_idstring

ID of the subscription for the Checkout Session upon completion.

to_created_atstring

The end date of created_at in ISO8601 format (exclusive).

Response body - 200 OK
itemsarray

Paged results.

items.account_idstring

ID of the Airwallex payment account used to collect payment. You can find this ID in the Airwallex web app > Settings > Account details, within the Account Information section.

items.automatic_tax_statusstring

The automatic tax status of this checkout. One of:

  • APPLIED: The automatic tax is applied.
  • DISABLED: The automatic tax is disabled.
  • LOCATION_NOT_SUPPORTED: Automatic tax calculation isn't supported in the customer's location.
  • LOCATION_NOT_REGISTERED_BY_MERCHANT: The merchant isn't registered to collect tax in the customer's location.
  • ADDRESS_INCOMPLETE: The customer address was insufficient or invalid to determine the correct tax.
APPLIED
DISABLED
LOCATION_NOT_SUPPORTED
LOCATION_NOT_REGISTERED_BY_MERCHANT
ADDRESS_INCOMPLETE
items.created_atstring

Time when the Checkout Session was created.

items.discountsarray

List of discounts applied to the subscription or invoice. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

items.discounts.typestring

Specifies how to obtain the discount. One of: COUPON.

items.discounts.couponobject

Coupon to redeem into a discount for this resource. Only required when type = COUPON.

items.discounts.coupon.idstring

id of the Coupon object.

items.enable_automatic_taxboolean

Whether automatic tax is enabled for this checkout. When enabled, the system attempts to calculate taxes for this checkout's invoice automatically.

items.expires_atstring

Time when the Checkout Session expires.

items.idstring

ID of the Checkout Session object.

items.line_itemsarray

A list of items the customer is purchasing.

items.line_items.discountsarray

List of discounts applied to the line item. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

items.line_items.discounts.typestring

Specifies how to obtain the discount. One of: COUPON.

items.line_items.discounts.couponobject

Coupon to redeem into a discount for this resource. Only required when type = COUPON.

items.line_items.discounts.coupon.idstring

id of the Coupon object.

items.line_items.price_idstring

ID of the Price object.

items.line_items.quantityinteger

The quantity of the line item being purchased.

items.line_items.tax_percentnumber

The effective tax percent of this line item.

items.modestring

The mode of the Checkout Session object, can be one of:

  • PAYMENT: Accept one-off payments.
  • SUBSCRIPTION: Set up subscriptions.
  • SETUP: Collect payment details to charge your customers later.
items.statusstring

The status of the Checkout Session object, can be one of:

  • ACTIVE: The Checkout Session is available for the customer to complete a purchase.
  • COMPLETED: The Checkout Session has been completed.
  • CANCELLED: The Checkout Session has been cancelled.
  • EXPIRED: The Checkout Session has expired.

The status automatically changes from ACTIVE to EXPIRED after 1 hour if purchase has not been completed.

items.ui_modestring

The UI mode of the Checkout Session, can be one of:
HOSTED: Customers complete the checkout on an Airwallex-hosted page.
EMBEDDED: Embed the checkout UI directly in your website or app.
ELEMENTS: Build a custom checkout UI using Airwallex Elements.

items.updated_atstring

Time when the Checkout Session was last updated.

items.back_urlstring

If set, the hosted checkout page displays a back button which allows customers to cancel the flow and be directed to this URL.

items.billing_customer_idstring

ID of the Billing Customer associated with this Checkout Session, if applicable.

items.cancelled_atstring

Time when the Checkout Session was cancelled.

items.client_secretstring

The client secret used to initialize the Checkout Session in EMBEDDED or ELEMENTS ui_mode. Only present when ui_mode is EMBEDDED or ELEMENTS.

items.completed_atstring

Time when the Checkout Session was completed.

items.currencystring

The checkout currency in 3-letter ISO-4217 format.

items.customer_dataobject

The prefilled information of the customer.

items.customer_data.country_codestring

Two-letter ISO 3166 country code of the shopper's country. Strongly recommended — drives which payment methods are surfaced (iDEAL / EPS etc. are country-restricted). Falls back to IP geo when absent.

items.customer_data.emailstring

The prefilled email of the customer. If this field, or a customer_id or billing_customer_id with an email on file, is provided, the email will be prefilled and will not be editable during checkout. If no email is provided, the Checkout Session prompts the customer to enter their email.

items.customer_data.namestring

The prefilled name of the customer. If this field, or a customer_id or billing_customer_id with a name on file, is provided, the name will be prefilled and will not be editable during checkout. If no name is provided, the Checkout Session prompts the customer to enter their name.

items.customer_data.typestring

Type of the customer, one of BUSINESS or INDIVIDUAL. If not provided and no type is available from an existing customer, an "I am purchasing as a business" checkbox is displayed for the customer to self-select.

items.customer_data_collectionobject

Provides configuration for the Checkout Session to collect information from customers.

items.customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address is collected only when necessary, including when automatic tax is enabled or a tax ID is collected.
  • REQUIRED: Billing address is always collected. Defaults to AUTO.
items.customer_data_collection.emailstring

Controls whether the email address will be collected during checkout.

  • AUTO: Email address is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Email address is always collected.
AUTO
REQUIRED
items.customer_data_collection.namestring

Controls whether the name will be collected during checkout.

  • AUTO: Name is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Name is always collected.
AUTO
REQUIRED
items.customer_data_collection.phone_numberstring

Controls whether the phone number will be collected during checkout.

  • AUTO: Phone number is collected only when necessary.
  • REQUIRED: Phone number is always collected.
AUTO
REQUIRED
items.customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for a business customer during checkout.

  • DISABLED: Tax ID will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax ID is optionally collected in supported countries by displaying the "I am purchasing as a business" checkbox.
  • REQUIRED_IF_SUPPORTED: Tax ID is always collected when the country is supported. Defaults to OPTIONAL_IF_SUPPORTED.
items.customer_idstring

ID of the Customer from the Payments API associated with this Checkout Session, if applicable.

items.hosted_completion_pageobject

Configuration of the customer experience after the Checkout Session completes. Only applicable when ui_mode is HOSTED.

items.hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after the Checkout Session completes and before the customer is redirected to success_url.

items.invoice_creationobject

Invoice creation settings for this Checkout Session.

items.invoice_creation.enabledboolean

Whether an invoice is created for this Checkout Session.

items.invoice_creation.invoice_dataobject

The invoice settings used for this Checkout Session.

items.invoice_creation.invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

items.invoice_creation.invoice_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

items.invoice_creation.invoice_data.due_atstring

Due date set by the merchant for this invoice, if any.

items.invoice_creation.invoice_data.memostring

String used for merchants to share a custom message to their customers. Referenced as memo or invoice note in Webapp.

items.invoice_creation.invoice_data.metadataobject

A set of key-value pairs that you can attach to this object for storing additional information.

items.invoice_idstring

ID of the invoice for the Checkout Session when mode is PAYMENT. Only applicable when status is COMPLETED.

items.legal_entity_idstring

ID of the legal entity to be used as billing entity, which can be retrieved from the legal_entity_id field in the Retrieve account details API response.

items.localestring

The locale for the Checkout Session.

items.metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

items.payment_intent_dataobject

The Payment Intent parameters configured for this Checkout Session.

items.payment_intent_data.descriptorstring

Descriptor that will display to the customer on their bank statement. Maximum length is 32. Only applicable when mode is PAYMENT.

items.payment_intent_data.merchant_order_idstring

The order unique identifier created in merchant's order system that corresponds to this Payment Intent. Maximum length is 64.

items.payment_intent_data.shippingobject

Shipping information.

items.payment_intent_data.shipping.addressobject

Shipping address.

items.payment_intent_data.shipping.address.country_codestring

The two-letter country code in ISO 3166-1 alpha-2 format.

items.payment_intent_data.shipping.address.citystring

City of the address.

items.payment_intent_data.shipping.address.postcodestring

Postcode of the address.

items.payment_intent_data.shipping.address.statestring

State or province of the address.

items.payment_intent_data.shipping.address.streetstring

Street address.

items.payment_intent_data.shipping.fee_amountnumber

Shipping fee amount.

items.payment_intent_data.shipping.first_namestring

First name of the recipient. Maximum of 128 characters.

items.payment_intent_data.shipping.last_namestring

Last name of the recipient. Maximum of 128 characters.

items.payment_intent_data.shipping.phone_numberstring

Phone number of the recipient. Maximum of 50 characters.

items.payment_intent_data.shipping.shipping_delayed_atstring

Use if customer chose to deliver the item at a later time. The timestamp must include an explicit timezone, for example Z or -04:00.

items.payment_intent_data.shipping.shipping_methodstring

Shipping method for the product. Maximum of 128 characters.

items.payment_intent_idstring

ID of the Payment Intent associated with this Checkout Session.

items.payment_optionsobject

Payment settings of this Checkout Session.

items.payment_options.allowed_card_networksarray

One or more card networks that you support. Accepted values are visa, mastercard, maestro, unionpay, amex, jcb, diners, and discover. Only applicable when mode is PAYMENT.

items.payment_options.authorization_typestring

The authorization type of the card payment. One of final_auth, pre_auth. Defaults to final_auth. Set it to pre_auth if you want to place a hold on your customer's card for more than 7 days. pre_auth is only applicable to Visa or Mastercard and requires auto_capture to be false. Only applicable when mode is PAYMENT.

final_auth
pre_auth
items.payment_options.auto_captureboolean

Whether the amount should be captured automatically upon successful payment authorization. Set to false to place a hold on the payment method and capture the funds later. Defaults to true. Only applicable when mode is PAYMENT.

items.payment_options.pay_by_invoice_enabledboolean

Enables the option to "Request an invoice" for payment. After the customer confirms to pay with this option, the status of Checkout Session will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Checkout Session, and other configurations in invoice_creation.invoice_data. Only applicable when an invoice is created, and the customer type is BUSINESS.

items.payment_options.payment_method_saveobject

Settings that control whether and how the payment method can be reused for future payments.

items.payment_options.payment_method_save.modestring

Whether and how to store the payment method used in this Checkout Session for future payments. Accepted values:

  • ENABLED: Always store the payment method when possible; no checkbox is shown.
  • DISABLED: Never store the payment method; always treat the transaction as guest checkout.
  • COLLECT_CONSENT: Show a checkbox and only store the payment method if the customer explicitly opts in. Only applicable to cards.
items.payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved Payment Source or Payment Consent to trigger future payments. One of MERCHANT or CUSTOMER. If MERCHANT, a Payment Source or Payment Consent is created for future use. If CUSTOMER, the payment method is saved only with the payment provider.

items.payment_options.payment_method_typesarray

Specify which payment methods to display on the Checkout Page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the Checkout Page. If omitted, all available payment methods are displayed in the default order.
Possible values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible values when mode is PAYMENT: card, applepay, googlepay, wechatpay, alipaycn, alipayhk, gcash, dana, kakaopay, tng, truemoney, bkash, poli, fpx, bank_transfer, alfamart, doku_ewallet, enets, grabpay, indomaret, konbini, online_banking, payeasy, payeasy_atm, seven_eleven, skrill, tesco_lotus, eps, giropay, bancontact, ideal, multibanco, p24, sofort, trustly, dragonpay, blik, mybank, paybybankapp, safetypay, verkkopankki, maxima, narvesen, paypost, perlas_terminals, paysafecash, paysafecard, paysera, satispay, family_mart, hi_life, permata_atm, sam_kiosk, axs_kiosk, esun, shopee_pay, boost, paypal, payu, bitpay, ovo, rabbit_line_pay, ach_direct_debit, bacs_direct_debit, becs_direct_debit, sepa_direct_debit, eft_direct_debit, atome, go_pay, jenius_pay, linkaja, duit_now, pay_now, prompt_pay, airwallex_pay, fps, klarna, korean_local_card, payco, samsung_pay, naver_pay, toss_pay, upi, line_pay, paypay, merpay, d_barai, au_pay, rakuten_pay, zip, spei, afterpay, airi, lumi, payto, twint, venmo, pix, laybuy, cash_app_pay, payme, octopus, tabby, spaylater, wero, jkopay, affirm, bizum, cartes_bancaires, swish, mbway.
Possible values when mode is SETUP: card.

items.payment_source_idstring

ID of the Payment Source created when the Checkout Session is completed.

items.return_urlstring

The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site, with payment status not confirmed.

items.subscription_dataobject

The settings of subscription to be passed to the subscription creation upon completion of the Checkout Session in SUBSCRIPTION mode.

items.subscription_data.days_until_dueinteger

Number of days from invoice finalization until payment is due. Defaults to 0.

items.subscription_data.recurringobject

The billing cycle for recurring charges.

items.subscription_data.recurring.periodinteger

The number of period units between subscription billing cycles. For example, the billing cycle is bi-monthly if period=2 and period_unit=MONTH.

items.subscription_data.recurring.period_unitstring

Specifies billing frequency. One of DAY, WEEK, MONTH or YEAR.

items.subscription_data.default_invoice_templateobject

Invoices for the Subscription will be created using the specified settings.

items.subscription_data.default_invoice_template.invoice_memostring

Memo to be used for the invoices that are generated by this Subscription.

items.subscription_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

items.subscription_data.durationobject

The total duration of the subscription.

items.subscription_data.duration.periodinteger

The number of period units.

items.subscription_data.duration.period_unitstring

Specifies billing duration. One of DAY, WEEK, MONTH or YEAR.

items.subscription_data.metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

items.subscription_data.starts_atstring

Time when the subscription started or scheduled to start. Defaults to start immediately after creation.

items.subscription_data.trial_ends_atstring

The end time of the trial if applicable.

items.subscription_idstring

ID of the subscription for the Checkout Session when mode is SUBSCRIPTION. Only applicable when status is COMPLETED.

items.success_urlstring

The URL the customer will be directed to after the checkout completion.

items.ui_optionsobject

Customization options for the Checkout Page.

items.ui_options.layoutobject

The layout of the Checkout Page.

items.ui_options.layout.payment_methodsstring

Specify the layout for the payment elements. Accepted values are tab and accordion. By default, accordion layout is used on desktop and tab layout is used on mobile. Only applicable when no invoice is created.

items.ui_options.submit_typestring

Describes the type of transaction being performed in order to customize the submit button text. Accepted values are pay, book, subscribe, and save.

items.ui_options.theme_idstring

ID of the theme to apply to this Checkout Session, overriding the theme applied to its legal entity. You can find this ID in the Airwallex web app > Settings > Themes.

items.urlstring

The URL to the Checkout Session. Only present when status is ACTIVE.

page_afterstring

The page cursor used for searching after page.

page_beforestring

The page cursor used for search before page.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error

401

Unauthorized. Possible error codes: unauthorized

500

Server Error. Possible error codes: internal_error

GET /api/v1/checkout/checkout_sessions
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/checkout/checkout_sessions' \
> --header 'Authorization: Bearer <token>' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "items": [
3 {
4 "automatic_tax_status": "DISABLED",
5 "created_at": "2025-05-10T16:00:30+0000",
6 "discounts": [],
7 "enable_automatic_tax": false,
8 "expires_at": "2025-05-10T17:00:30+0000",
9 "id": "bco_sgstcdcpnh8sv3awiwo",
10 "mode": "PAYMENT",
11 "status": "ACTIVE",
12 "success_url": "https://www.airwallex.com/success",
13 "ui_mode": "HOSTED",
14 "updated_at": "2025-05-10T16:00:30+0000",
15 "account_id": "acct_ncI2nypPKSq2VXKxscAcg",
16 "currency": "USD",
17 "customer_id": "cus_hkpd7fedfgb004apkvs",
18 "line_items": [
19 {
20 "price_id": "pri_hkpd7fedfgb004apkvs",
21 "discounts": [],
22 "quantity": 1
23 }
24 ],
25 "url": "https://checkout.airwallex.com/pay?s=jwt_token"
26 }
27 ],
28 "page_after": "<string>",
29 "page_before": "<string>"
30}
Was this section helpful?

Update a Checkout SessionEarly access

POST /api/v1/checkout/checkout_sessions/{id}/update

Update a Checkout Session is available for early access
Expect limited functionality as we continue development and build the product in partnership with early users. Reach out to your Airwallex account manager or [email protected] if you would like to use this feature. Learn more about early access.Docs

Updates a Checkout Session object.

Path parameters
idrequiredstring

ID of the Checkout Session

Request body
metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

Response body - 200 OK
account_idstring

ID of the Airwallex payment account used to collect payment. You can find this ID in the Airwallex web app > Settings > Account details, within the Account Information section.

automatic_tax_statusstring

The automatic tax status of this checkout. One of:

  • APPLIED: The automatic tax is applied.
  • DISABLED: The automatic tax is disabled.
  • LOCATION_NOT_SUPPORTED: Automatic tax calculation isn't supported in the customer's location.
  • LOCATION_NOT_REGISTERED_BY_MERCHANT: The merchant isn't registered to collect tax in the customer's location.
  • ADDRESS_INCOMPLETE: The customer address was insufficient or invalid to determine the correct tax.
APPLIED
DISABLED
LOCATION_NOT_SUPPORTED
LOCATION_NOT_REGISTERED_BY_MERCHANT
ADDRESS_INCOMPLETE
back_urlstring

If set, the hosted checkout page displays a back button which allows customers to cancel the flow and be directed to this URL.

billing_customer_idstring

ID of the Billing Customer associated with this Checkout Session, if applicable.

cancelled_atstring

Time when the Checkout Session was cancelled.

client_secretstring

The client secret used to initialize the Checkout Session in EMBEDDED or ELEMENTS ui_mode. Only present when ui_mode is EMBEDDED or ELEMENTS.

completed_atstring

Time when the Checkout Session was completed.

created_atstring

Time when the Checkout Session was created.

currencystring

The checkout currency in 3-letter ISO-4217 format.

customer_dataobject

The prefilled information of the customer.

customer_data.country_codestring

Two-letter ISO 3166 country code of the shopper's country. Strongly recommended — drives which payment methods are surfaced (iDEAL / EPS etc. are country-restricted). Falls back to IP geo when absent.

customer_data.emailstring

The prefilled email of the customer. If this field, or a customer_id or billing_customer_id with an email on file, is provided, the email will be prefilled and will not be editable during checkout. If no email is provided, the Checkout Session prompts the customer to enter their email.

customer_data.namestring

The prefilled name of the customer. If this field, or a customer_id or billing_customer_id with a name on file, is provided, the name will be prefilled and will not be editable during checkout. If no name is provided, the Checkout Session prompts the customer to enter their name.

customer_data.typestring

Type of the customer, one of BUSINESS or INDIVIDUAL. If not provided and no type is available from an existing customer, an "I am purchasing as a business" checkbox is displayed for the customer to self-select.

customer_data_collectionobject

Provides configuration for the Checkout Session to collect information from customers.

customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address is collected only when necessary, including when automatic tax is enabled or a tax ID is collected.
  • REQUIRED: Billing address is always collected. Defaults to AUTO.
customer_data_collection.emailstring

Controls whether the email address will be collected during checkout.

  • AUTO: Email address is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Email address is always collected.
AUTO
REQUIRED
customer_data_collection.namestring

Controls whether the name will be collected during checkout.

  • AUTO: Name is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Name is always collected.
AUTO
REQUIRED
customer_data_collection.phone_numberstring

Controls whether the phone number will be collected during checkout.

  • AUTO: Phone number is collected only when necessary.
  • REQUIRED: Phone number is always collected.
AUTO
REQUIRED
customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for a business customer during checkout.

  • DISABLED: Tax ID will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax ID is optionally collected in supported countries by displaying the "I am purchasing as a business" checkbox.
  • REQUIRED_IF_SUPPORTED: Tax ID is always collected when the country is supported. Defaults to OPTIONAL_IF_SUPPORTED.
customer_idstring

ID of the Customer from the Payments API associated with this Checkout Session, if applicable.

discountsarray

List of discounts applied to the subscription or invoice. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

discounts.typestring

Specifies how to obtain the discount. One of: COUPON.

discounts.couponobject

Coupon to redeem into a discount for this resource. Only required when type = COUPON.

discounts.coupon.idstring

id of the Coupon object.

enable_automatic_taxboolean

Whether automatic tax is enabled for this checkout. When enabled, the system attempts to calculate taxes for this checkout's invoice automatically.

expires_atstring

Time when the Checkout Session expires.

hosted_completion_pageobject

Configuration of the customer experience after the Checkout Session completes. Only applicable when ui_mode is HOSTED.

hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after the Checkout Session completes and before the customer is redirected to success_url.

idstring

ID of the Checkout Session object.

invoice_creationobject

Invoice creation settings for this Checkout Session.

invoice_creation.enabledboolean

Whether an invoice is created for this Checkout Session.

invoice_creation.invoice_dataobject

The invoice settings used for this Checkout Session.

invoice_creation.invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

invoice_creation.invoice_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

invoice_creation.invoice_data.due_atstring

Due date set by the merchant for this invoice, if any.

invoice_creation.invoice_data.memostring

String used for merchants to share a custom message to their customers. Referenced as memo or invoice note in Webapp.

invoice_creation.invoice_data.metadataobject

A set of key-value pairs that you can attach to this object for storing additional information.

invoice_idstring

ID of the invoice for the Checkout Session when mode is PAYMENT. Only applicable when status is COMPLETED.

legal_entity_idstring

ID of the legal entity to be used as billing entity, which can be retrieved from the legal_entity_id field in the Retrieve account details API response.

line_itemsarray

A list of items the customer is purchasing.

line_items.discountsarray

List of discounts applied to the line item. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

line_items.discounts.typestring

Specifies how to obtain the discount. One of: COUPON.

line_items.discounts.couponobject

Coupon to redeem into a discount for this resource. Only required when type = COUPON.

line_items.discounts.coupon.idstring

id of the Coupon object.

line_items.price_idstring

ID of the Price object.

line_items.quantityinteger

The quantity of the line item being purchased.

line_items.tax_percentnumber

The effective tax percent of this line item.

localestring

The locale for the Checkout Session.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

modestring

The mode of the Checkout Session object, can be one of:

  • PAYMENT: Accept one-off payments.
  • SUBSCRIPTION: Set up subscriptions.
  • SETUP: Collect payment details to charge your customers later.
payment_intent_dataobject

The Payment Intent parameters configured for this Checkout Session.

payment_intent_data.descriptorstring

Descriptor that will display to the customer on their bank statement. Maximum length is 32. Only applicable when mode is PAYMENT.

payment_intent_data.merchant_order_idstring

The order unique identifier created in merchant's order system that corresponds to this Payment Intent. Maximum length is 64.

payment_intent_data.shippingobject

Shipping information.

payment_intent_data.shipping.addressobject

Shipping address.

payment_intent_data.shipping.address.country_codestring

The two-letter country code in ISO 3166-1 alpha-2 format.

payment_intent_data.shipping.address.citystring

City of the address.

payment_intent_data.shipping.address.postcodestring

Postcode of the address.

payment_intent_data.shipping.address.statestring

State or province of the address.

payment_intent_data.shipping.address.streetstring

Street address.

payment_intent_data.shipping.fee_amountnumber

Shipping fee amount.

payment_intent_data.shipping.first_namestring

First name of the recipient. Maximum of 128 characters.

payment_intent_data.shipping.last_namestring

Last name of the recipient. Maximum of 128 characters.

payment_intent_data.shipping.phone_numberstring

Phone number of the recipient. Maximum of 50 characters.

payment_intent_data.shipping.shipping_delayed_atstring

Use if customer chose to deliver the item at a later time. The timestamp must include an explicit timezone, for example Z or -04:00.

payment_intent_data.shipping.shipping_methodstring

Shipping method for the product. Maximum of 128 characters.

payment_intent_idstring

ID of the Payment Intent associated with this Checkout Session.

payment_optionsobject

Payment settings of this Checkout Session.

payment_options.allowed_card_networksarray

One or more card networks that you support. Accepted values are visa, mastercard, maestro, unionpay, amex, jcb, diners, and discover. Only applicable when mode is PAYMENT.

payment_options.authorization_typestring

The authorization type of the card payment. One of final_auth, pre_auth. Defaults to final_auth. Set it to pre_auth if you want to place a hold on your customer's card for more than 7 days. pre_auth is only applicable to Visa or Mastercard and requires auto_capture to be false. Only applicable when mode is PAYMENT.

final_auth
pre_auth
payment_options.auto_captureboolean

Whether the amount should be captured automatically upon successful payment authorization. Set to false to place a hold on the payment method and capture the funds later. Defaults to true. Only applicable when mode is PAYMENT.

payment_options.pay_by_invoice_enabledboolean

Enables the option to "Request an invoice" for payment. After the customer confirms to pay with this option, the status of Checkout Session will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Checkout Session, and other configurations in invoice_creation.invoice_data. Only applicable when an invoice is created, and the customer type is BUSINESS.

payment_options.payment_method_saveobject

Settings that control whether and how the payment method can be reused for future payments.

payment_options.payment_method_save.modestring

Whether and how to store the payment method used in this Checkout Session for future payments. Accepted values:

  • ENABLED: Always store the payment method when possible; no checkbox is shown.
  • DISABLED: Never store the payment method; always treat the transaction as guest checkout.
  • COLLECT_CONSENT: Show a checkbox and only store the payment method if the customer explicitly opts in. Only applicable to cards.
payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved Payment Source or Payment Consent to trigger future payments. One of MERCHANT or CUSTOMER. If MERCHANT, a Payment Source or Payment Consent is created for future use. If CUSTOMER, the payment method is saved only with the payment provider.

payment_options.payment_method_typesarray

Specify which payment methods to display on the Checkout Page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the Checkout Page. If omitted, all available payment methods are displayed in the default order.
Possible values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible values when mode is PAYMENT: card, applepay, googlepay, wechatpay, alipaycn, alipayhk, gcash, dana, kakaopay, tng, truemoney, bkash, poli, fpx, bank_transfer, alfamart, doku_ewallet, enets, grabpay, indomaret, konbini, online_banking, payeasy, payeasy_atm, seven_eleven, skrill, tesco_lotus, eps, giropay, bancontact, ideal, multibanco, p24, sofort, trustly, dragonpay, blik, mybank, paybybankapp, safetypay, verkkopankki, maxima, narvesen, paypost, perlas_terminals, paysafecash, paysafecard, paysera, satispay, family_mart, hi_life, permata_atm, sam_kiosk, axs_kiosk, esun, shopee_pay, boost, paypal, payu, bitpay, ovo, rabbit_line_pay, ach_direct_debit, bacs_direct_debit, becs_direct_debit, sepa_direct_debit, eft_direct_debit, atome, go_pay, jenius_pay, linkaja, duit_now, pay_now, prompt_pay, airwallex_pay, fps, klarna, korean_local_card, payco, samsung_pay, naver_pay, toss_pay, upi, line_pay, paypay, merpay, d_barai, au_pay, rakuten_pay, zip, spei, afterpay, airi, lumi, payto, twint, venmo, pix, laybuy, cash_app_pay, payme, octopus, tabby, spaylater, wero, jkopay, affirm, bizum, cartes_bancaires, swish, mbway.
Possible values when mode is SETUP: card.

payment_source_idstring

ID of the Payment Source created when the Checkout Session is completed.

return_urlstring

The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site, with payment status not confirmed.

statusstring

The status of the Checkout Session object, can be one of:

  • ACTIVE: The Checkout Session is available for the customer to complete a purchase.
  • COMPLETED: The Checkout Session has been completed.
  • CANCELLED: The Checkout Session has been cancelled.
  • EXPIRED: The Checkout Session has expired.

The status automatically changes from ACTIVE to EXPIRED after 1 hour if purchase has not been completed.

subscription_dataobject

The settings of subscription to be passed to the subscription creation upon completion of the Checkout Session in SUBSCRIPTION mode.

subscription_data.days_until_dueinteger

Number of days from invoice finalization until payment is due. Defaults to 0.

subscription_data.recurringobject

The billing cycle for recurring charges.

subscription_data.recurring.periodinteger

The number of period units between subscription billing cycles. For example, the billing cycle is bi-monthly if period=2 and period_unit=MONTH.

subscription_data.recurring.period_unitstring

Specifies billing frequency. One of DAY, WEEK, MONTH or YEAR.

subscription_data.default_invoice_templateobject

Invoices for the Subscription will be created using the specified settings.

subscription_data.default_invoice_template.invoice_memostring

Memo to be used for the invoices that are generated by this Subscription.

subscription_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

subscription_data.durationobject

The total duration of the subscription.

subscription_data.duration.periodinteger

The number of period units.

subscription_data.duration.period_unitstring

Specifies billing duration. One of DAY, WEEK, MONTH or YEAR.

subscription_data.metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

subscription_data.starts_atstring

Time when the subscription started or scheduled to start. Defaults to start immediately after creation.

subscription_data.trial_ends_atstring

The end time of the trial if applicable.

subscription_idstring

ID of the subscription for the Checkout Session when mode is SUBSCRIPTION. Only applicable when status is COMPLETED.

success_urlstring

The URL the customer will be directed to after the checkout completion.

ui_modestring

The UI mode of the Checkout Session, can be one of:
HOSTED: Customers complete the checkout on an Airwallex-hosted page.
EMBEDDED: Embed the checkout UI directly in your website or app.
ELEMENTS: Build a custom checkout UI using Airwallex Elements.

ui_optionsobject

Customization options for the Checkout Page.

ui_options.layoutobject

The layout of the Checkout Page.

ui_options.layout.payment_methodsstring

Specify the layout for the payment elements. Accepted values are tab and accordion. By default, accordion layout is used on desktop and tab layout is used on mobile. Only applicable when no invoice is created.

ui_options.submit_typestring

Describes the type of transaction being performed in order to customize the submit button text. Accepted values are pay, book, subscribe, and save.

ui_options.theme_idstring

ID of the theme to apply to this Checkout Session, overriding the theme applied to its legal entity. You can find this ID in the Airwallex web app > Settings > Themes.

updated_atstring

Time when the Checkout Session was last updated.

urlstring

The URL to the Checkout Session. Only present when status is ACTIVE.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error

401

Unauthorized. Possible error codes: unauthorized

404

Not Found. Possible error codes: resource_not_found

500

Server Error. Possible error codes: internal_error

POST /api/v1/checkout/checkout_sessions/{id}/update
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/checkout/checkout_sessions/checkout_session_id/update' \
> --header 'Authorization: Bearer <token>' \
> --header 'Content-Type: application/json' \
> --data '{
> "metadata": {
> "foo": "bar"
> }
>}'
Response (200 OK)
1{
2 "automatic_tax_status": "DISABLED",
3 "created_at": "2025-05-10T16:00:30+0000",
4 "discounts": [],
5 "enable_automatic_tax": false,
6 "expires_at": "2025-05-10T17:00:30+0000",
7 "id": "bco_sgstcdcpnh8sv3awiwo",
8 "mode": "PAYMENT",
9 "status": "ACTIVE",
10 "success_url": "https://www.airwallex.com/success",
11 "ui_mode": "HOSTED",
12 "updated_at": "2025-05-10T16:05:30+0000",
13 "account_id": "acct_ncI2nypPKSq2VXKxscAcg",
14 "currency": "USD",
15 "customer_id": "cus_hkpd7fedfgb004apkvs",
16 "line_items": [
17 {
18 "price_id": "pri_hkpd7fedfgb004apkvs",
19 "discounts": [],
20 "quantity": 1
21 }
22 ],
23 "metadata": {
24 "foo": "bar"
25 },
26 "url": "https://checkout.airwallex.com/pay?s=jwt_token"
27}
Was this section helpful?

Cancel a Checkout SessionEarly access

POST /api/v1/checkout/checkout_sessions/{id}/cancel

Cancel a Checkout Session is available for early access
Expect limited functionality as we continue development and build the product in partnership with early users. Reach out to your Airwallex account manager or [email protected] if you would like to use this feature. Learn more about early access.Docs

Cancels an ACTIVE Checkout Session. Once cancelled, the customer will no longer be able to complete the checkout and will see an error message when attempting to load it.

Path parameters
idrequiredstring

ID of the Checkout Session

Response body - 200 OK
account_idstring

ID of the Airwallex payment account used to collect payment. You can find this ID in the Airwallex web app > Settings > Account details, within the Account Information section.

automatic_tax_statusstring

The automatic tax status of this checkout. One of:

  • APPLIED: The automatic tax is applied.
  • DISABLED: The automatic tax is disabled.
  • LOCATION_NOT_SUPPORTED: Automatic tax calculation isn't supported in the customer's location.
  • LOCATION_NOT_REGISTERED_BY_MERCHANT: The merchant isn't registered to collect tax in the customer's location.
  • ADDRESS_INCOMPLETE: The customer address was insufficient or invalid to determine the correct tax.
APPLIED
DISABLED
LOCATION_NOT_SUPPORTED
LOCATION_NOT_REGISTERED_BY_MERCHANT
ADDRESS_INCOMPLETE
back_urlstring

If set, the hosted checkout page displays a back button which allows customers to cancel the flow and be directed to this URL.

billing_customer_idstring

ID of the Billing Customer associated with this Checkout Session, if applicable.

cancelled_atstring

Time when the Checkout Session was cancelled.

client_secretstring

The client secret used to initialize the Checkout Session in EMBEDDED or ELEMENTS ui_mode. Only present when ui_mode is EMBEDDED or ELEMENTS.

completed_atstring

Time when the Checkout Session was completed.

created_atstring

Time when the Checkout Session was created.

currencystring

The checkout currency in 3-letter ISO-4217 format.

customer_dataobject

The prefilled information of the customer.

customer_data.country_codestring

Two-letter ISO 3166 country code of the shopper's country. Strongly recommended — drives which payment methods are surfaced (iDEAL / EPS etc. are country-restricted). Falls back to IP geo when absent.

customer_data.emailstring

The prefilled email of the customer. If this field, or a customer_id or billing_customer_id with an email on file, is provided, the email will be prefilled and will not be editable during checkout. If no email is provided, the Checkout Session prompts the customer to enter their email.

customer_data.namestring

The prefilled name of the customer. If this field, or a customer_id or billing_customer_id with a name on file, is provided, the name will be prefilled and will not be editable during checkout. If no name is provided, the Checkout Session prompts the customer to enter their name.

customer_data.typestring

Type of the customer, one of BUSINESS or INDIVIDUAL. If not provided and no type is available from an existing customer, an "I am purchasing as a business" checkbox is displayed for the customer to self-select.

customer_data_collectionobject

Provides configuration for the Checkout Session to collect information from customers.

customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address is collected only when necessary, including when automatic tax is enabled or a tax ID is collected.
  • REQUIRED: Billing address is always collected. Defaults to AUTO.
customer_data_collection.emailstring

Controls whether the email address will be collected during checkout.

  • AUTO: Email address is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Email address is always collected.
AUTO
REQUIRED
customer_data_collection.namestring

Controls whether the name will be collected during checkout.

  • AUTO: Name is collected only when necessary, including when an invoice is created or when required by the selected payment method.
  • REQUIRED: Name is always collected.
AUTO
REQUIRED
customer_data_collection.phone_numberstring

Controls whether the phone number will be collected during checkout.

  • AUTO: Phone number is collected only when necessary.
  • REQUIRED: Phone number is always collected.
AUTO
REQUIRED
customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for a business customer during checkout.

  • DISABLED: Tax ID will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax ID is optionally collected in supported countries by displaying the "I am purchasing as a business" checkbox.
  • REQUIRED_IF_SUPPORTED: Tax ID is always collected when the country is supported. Defaults to OPTIONAL_IF_SUPPORTED.
customer_idstring

ID of the Customer from the Payments API associated with this Checkout Session, if applicable.

discountsarray

List of discounts applied to the subscription or invoice. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

discounts.typestring

Specifies how to obtain the discount. One of: COUPON.

discounts.couponobject

Coupon to redeem into a discount for this resource. Only required when type = COUPON.

discounts.coupon.idstring

id of the Coupon object.

enable_automatic_taxboolean

Whether automatic tax is enabled for this checkout. When enabled, the system attempts to calculate taxes for this checkout's invoice automatically.

expires_atstring

Time when the Checkout Session expires.

hosted_completion_pageobject

Configuration of the customer experience after the Checkout Session completes. Only applicable when ui_mode is HOSTED.

hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after the Checkout Session completes and before the customer is redirected to success_url.

idstring

ID of the Checkout Session object.

invoice_creationobject

Invoice creation settings for this Checkout Session.

invoice_creation.enabledboolean

Whether an invoice is created for this Checkout Session.

invoice_creation.invoice_dataobject

The invoice settings used for this Checkout Session.

invoice_creation.invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

invoice_creation.invoice_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

invoice_creation.invoice_data.due_atstring

Due date set by the merchant for this invoice, if any.

invoice_creation.invoice_data.memostring

String used for merchants to share a custom message to their customers. Referenced as memo or invoice note in Webapp.

invoice_creation.invoice_data.metadataobject

A set of key-value pairs that you can attach to this object for storing additional information.

invoice_idstring

ID of the invoice for the Checkout Session when mode is PAYMENT. Only applicable when status is COMPLETED.

legal_entity_idstring

ID of the legal entity to be used as billing entity, which can be retrieved from the legal_entity_id field in the Retrieve account details API response.

line_itemsarray

A list of items the customer is purchasing.

line_items.discountsarray

List of discounts applied to the line item. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

line_items.discounts.typestring

Specifies how to obtain the discount. One of: COUPON.

line_items.discounts.couponobject

Coupon to redeem into a discount for this resource. Only required when type = COUPON.

line_items.discounts.coupon.idstring

id of the Coupon object.

line_items.price_idstring

ID of the Price object.

line_items.quantityinteger

The quantity of the line item being purchased.

line_items.tax_percentnumber

The effective tax percent of this line item.

localestring

The locale for the Checkout Session.

metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

modestring

The mode of the Checkout Session object, can be one of:

  • PAYMENT: Accept one-off payments.
  • SUBSCRIPTION: Set up subscriptions.
  • SETUP: Collect payment details to charge your customers later.
payment_intent_dataobject

The Payment Intent parameters configured for this Checkout Session.

payment_intent_data.descriptorstring

Descriptor that will display to the customer on their bank statement. Maximum length is 32. Only applicable when mode is PAYMENT.

payment_intent_data.merchant_order_idstring

The order unique identifier created in merchant's order system that corresponds to this Payment Intent. Maximum length is 64.

payment_intent_data.shippingobject

Shipping information.

payment_intent_data.shipping.addressobject

Shipping address.

payment_intent_data.shipping.address.country_codestring

The two-letter country code in ISO 3166-1 alpha-2 format.

payment_intent_data.shipping.address.citystring

City of the address.

payment_intent_data.shipping.address.postcodestring

Postcode of the address.

payment_intent_data.shipping.address.statestring

State or province of the address.

payment_intent_data.shipping.address.streetstring

Street address.

payment_intent_data.shipping.fee_amountnumber

Shipping fee amount.

payment_intent_data.shipping.first_namestring

First name of the recipient. Maximum of 128 characters.

payment_intent_data.shipping.last_namestring

Last name of the recipient. Maximum of 128 characters.

payment_intent_data.shipping.phone_numberstring

Phone number of the recipient. Maximum of 50 characters.

payment_intent_data.shipping.shipping_delayed_atstring

Use if customer chose to deliver the item at a later time. The timestamp must include an explicit timezone, for example Z or -04:00.

payment_intent_data.shipping.shipping_methodstring

Shipping method for the product. Maximum of 128 characters.

payment_intent_idstring

ID of the Payment Intent associated with this Checkout Session.

payment_optionsobject

Payment settings of this Checkout Session.

payment_options.allowed_card_networksarray

One or more card networks that you support. Accepted values are visa, mastercard, maestro, unionpay, amex, jcb, diners, and discover. Only applicable when mode is PAYMENT.

payment_options.authorization_typestring

The authorization type of the card payment. One of final_auth, pre_auth. Defaults to final_auth. Set it to pre_auth if you want to place a hold on your customer's card for more than 7 days. pre_auth is only applicable to Visa or Mastercard and requires auto_capture to be false. Only applicable when mode is PAYMENT.

final_auth
pre_auth
payment_options.auto_captureboolean

Whether the amount should be captured automatically upon successful payment authorization. Set to false to place a hold on the payment method and capture the funds later. Defaults to true. Only applicable when mode is PAYMENT.

payment_options.pay_by_invoice_enabledboolean

Enables the option to "Request an invoice" for payment. After the customer confirms to pay with this option, the status of Checkout Session will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Checkout Session, and other configurations in invoice_creation.invoice_data. Only applicable when an invoice is created, and the customer type is BUSINESS.

payment_options.payment_method_saveobject

Settings that control whether and how the payment method can be reused for future payments.

payment_options.payment_method_save.modestring

Whether and how to store the payment method used in this Checkout Session for future payments. Accepted values:

  • ENABLED: Always store the payment method when possible; no checkbox is shown.
  • DISABLED: Never store the payment method; always treat the transaction as guest checkout.
  • COLLECT_CONSENT: Show a checkbox and only store the payment method if the customer explicitly opts in. Only applicable to cards.
payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved Payment Source or Payment Consent to trigger future payments. One of MERCHANT or CUSTOMER. If MERCHANT, a Payment Source or Payment Consent is created for future use. If CUSTOMER, the payment method is saved only with the payment provider.

payment_options.payment_method_typesarray

Specify which payment methods to display on the Checkout Page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the Checkout Page. If omitted, all available payment methods are displayed in the default order.
Possible values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible values when mode is PAYMENT: card, applepay, googlepay, wechatpay, alipaycn, alipayhk, gcash, dana, kakaopay, tng, truemoney, bkash, poli, fpx, bank_transfer, alfamart, doku_ewallet, enets, grabpay, indomaret, konbini, online_banking, payeasy, payeasy_atm, seven_eleven, skrill, tesco_lotus, eps, giropay, bancontact, ideal, multibanco, p24, sofort, trustly, dragonpay, blik, mybank, paybybankapp, safetypay, verkkopankki, maxima, narvesen, paypost, perlas_terminals, paysafecash, paysafecard, paysera, satispay, family_mart, hi_life, permata_atm, sam_kiosk, axs_kiosk, esun, shopee_pay, boost, paypal, payu, bitpay, ovo, rabbit_line_pay, ach_direct_debit, bacs_direct_debit, becs_direct_debit, sepa_direct_debit, eft_direct_debit, atome, go_pay, jenius_pay, linkaja, duit_now, pay_now, prompt_pay, airwallex_pay, fps, klarna, korean_local_card, payco, samsung_pay, naver_pay, toss_pay, upi, line_pay, paypay, merpay, d_barai, au_pay, rakuten_pay, zip, spei, afterpay, airi, lumi, payto, twint, venmo, pix, laybuy, cash_app_pay, payme, octopus, tabby, spaylater, wero, jkopay, affirm, bizum, cartes_bancaires, swish, mbway.
Possible values when mode is SETUP: card.

payment_source_idstring

ID of the Payment Source created when the Checkout Session is completed.

return_urlstring

The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site, with payment status not confirmed.

statusstring

The status of the Checkout Session object, can be one of:

  • ACTIVE: The Checkout Session is available for the customer to complete a purchase.
  • COMPLETED: The Checkout Session has been completed.
  • CANCELLED: The Checkout Session has been cancelled.
  • EXPIRED: The Checkout Session has expired.

The status automatically changes from ACTIVE to EXPIRED after 1 hour if purchase has not been completed.

subscription_dataobject

The settings of subscription to be passed to the subscription creation upon completion of the Checkout Session in SUBSCRIPTION mode.

subscription_data.days_until_dueinteger

Number of days from invoice finalization until payment is due. Defaults to 0.

subscription_data.recurringobject

The billing cycle for recurring charges.

subscription_data.recurring.periodinteger

The number of period units between subscription billing cycles. For example, the billing cycle is bi-monthly if period=2 and period_unit=MONTH.

subscription_data.recurring.period_unitstring

Specifies billing frequency. One of DAY, WEEK, MONTH or YEAR.

subscription_data.default_invoice_templateobject

Invoices for the Subscription will be created using the specified settings.

subscription_data.default_invoice_template.invoice_memostring

Memo to be used for the invoices that are generated by this Subscription.

subscription_data.default_tax_percentnumber

The tax rate between 0 and 100(%) to be applied to invoices to be generated. The tax will be exclusive. Defaults to 0.

subscription_data.durationobject

The total duration of the subscription.

subscription_data.duration.periodinteger

The number of period units.

subscription_data.duration.period_unitstring

Specifies billing duration. One of DAY, WEEK, MONTH or YEAR.

subscription_data.metadataobject

A set of string key-value pairs that you can attach to this object for storing additional information.

subscription_data.starts_atstring

Time when the subscription started or scheduled to start. Defaults to start immediately after creation.

subscription_data.trial_ends_atstring

The end time of the trial if applicable.

subscription_idstring

ID of the subscription for the Checkout Session when mode is SUBSCRIPTION. Only applicable when status is COMPLETED.

success_urlstring

The URL the customer will be directed to after the checkout completion.

ui_modestring

The UI mode of the Checkout Session, can be one of:
HOSTED: Customers complete the checkout on an Airwallex-hosted page.
EMBEDDED: Embed the checkout UI directly in your website or app.
ELEMENTS: Build a custom checkout UI using Airwallex Elements.

ui_optionsobject

Customization options for the Checkout Page.

ui_options.layoutobject

The layout of the Checkout Page.

ui_options.layout.payment_methodsstring

Specify the layout for the payment elements. Accepted values are tab and accordion. By default, accordion layout is used on desktop and tab layout is used on mobile. Only applicable when no invoice is created.

ui_options.submit_typestring

Describes the type of transaction being performed in order to customize the submit button text. Accepted values are pay, book, subscribe, and save.

ui_options.theme_idstring

ID of the theme to apply to this Checkout Session, overriding the theme applied to its legal entity. You can find this ID in the Airwallex web app > Settings > Themes.

updated_atstring

Time when the Checkout Session was last updated.

urlstring

The URL to the Checkout Session. Only present when status is ACTIVE.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error

401

Unauthorized. Possible error codes: unauthorized

404

Not Found. Possible error codes: resource_not_found

500

Server Error. Possible error codes: internal_error

POST /api/v1/checkout/checkout_sessions/{id}/cancel
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/checkout/checkout_sessions/checkout_session_id/cancel' \
> --header 'Authorization: Bearer <token>' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "automatic_tax_status": "DISABLED",
3 "created_at": "2025-05-10T16:00:30+0000",
4 "discounts": [],
5 "enable_automatic_tax": false,
6 "expires_at": "2025-05-10T17:00:30+0000",
7 "id": "bco_sgstcdcpnh8sv3awiwo",
8 "mode": "PAYMENT",
9 "status": "CANCELLED",
10 "success_url": "https://www.airwallex.com/success",
11 "ui_mode": "HOSTED",
12 "updated_at": "2025-05-10T16:10:30+0000",
13 "account_id": "acct_ncI2nypPKSq2VXKxscAcg",
14 "cancelled_at": "2025-05-10T16:10:30+0000",
15 "currency": "USD",
16 "customer_id": "cus_hkpd7fedfgb004apkvs",
17 "line_items": [
18 {
19 "price_id": "pri_hkpd7fedfgb004apkvs",
20 "discounts": [],
21 "quantity": 1
22 }
23 ]
24}
Was this section helpful?