Airwallex logo
Airwallex logoAirwallex logo

Billing Checkouts

Copy for LLMView as Markdown

A Billing Checkout manages the setup and lifecycle of an Airwallex-hosted customer checkout experience, enabling customers to confirm and pay for line items or set up payment details for future transactions.
We recommend creating a new Billing Checkout each time a customer initiates a purchase. After the customer successfully completes the checkout, resources such as Customer, Payment Source, and Subscription will be automatically created in the Billing Checkout object.

Endpoints
POST /api/v1/billing/billing_checkouts/create
GET /api/v1/billing/billing_checkouts/{id}
GET /api/v1/billing/billing_checkouts
POST /api/v1/billing/billing_checkouts/{id}/update
POST /api/v1/billing/billing_checkouts/{id}/cancel

Create a billing checkout

POST /api/v1/billing/billing_checkouts/create

Creates a Billing Checkout object.

Request body
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 to reference the Billing Checkout. The customer's profile will be used to prefill the email, name, billing address and tax identification number during the checkout process. If provided, the customer can either choose a saved payment source for this checkout, or checkout a new payment method.
Required in SETUP mode.

currencystring

The checkout currency in 3-letter ISO-4217 format. Required in SETUP mode.

customer_dataobject

The prefilled information of the customer. Only applicable when billing_customer_id is not provided.
Not applicable in SETUP mode.

customer_data.emailstring

The prefilled email of the customer. If this field or a billing_customer_id with an email on file is provided, the email will be prefilled and will not be editable during checkout. If neither is provided, Billing Checkout will prompt the customer to enter their email during the checkout process.

customer_data.namestring

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

customer_data.typestring

Type of the billing customer, one of BUSINESS or INDIVIDUAL. If not provided, an "I am purchasing as a business" checkbox will be displayed during checkout for the customer to self-select.

customer_data_collectionobject

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

customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address will only be collected when necessary. Specifically, when automatic tax is enabled, or tax_id is collected.
  • REQUIRED: Billing address will always be collected. Defaults to AUTO.
customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for business customer during checkout. One of OPTIONAL_IF_SUPPORTED, DISABLED, REQUIRED_IF_SUPPORTED.

  • DISABLED: Tax id will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax id will be optionally collected in the supported countries, by displaying a checkbox "I am purchasing as business".
  • REQUIRED_IF_SUPPORTED: Tax id will always be collected if the country is in the supported list. Defaults to OPTIONAL_IF_SUPPORTED.
discountsarray

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

discounts.couponrequiredobject

Coupon to redeem into a discount for this resource. Only required when type = 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.

hosted_completion_pageobject

Configuration for the Airwallex-hosted completion page. Only applicable when ui_mode is HOSTED.

hosted_completion_page.displayrequiredboolean

Whether to display the Airwallex-hosted completion page after checkout is completed and before the customer is redirected to success_url.

invoice_dataobject

The settings of invoice to be passed to the invoice creation upon completion of the Billing Checkout in PAYMENT mode.

invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

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_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_data.memostring

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

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 if you have more than 1 entity in your organisation.

line_itemsarray

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

line_items.discountsarray

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

line_items.discounts.couponrequiredobject

Coupon to redeem into a discount for this resource. Only required when type = 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 to PAYMENT mode.

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. Only required when the 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.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.namerequiredstring

Product name.

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. Only required when the 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.

linked_payment_account_idstring

ID of the linked 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.

localestring

A code, in IETF language format, that determines the language and formatting displayed to customers on the checkout UI, and can be one of: AUTO, EN, ZH.
If set to AUTO the customer's browser locale is used.

metadataobject

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

moderequiredstring

The mode of the Billing Checkout object, can be one of:
SUBSCRIPTION: Set up subscriptions.
PAYMENT: Accept one-off payments.
SETUP: Collect payment details to charge your customers later.

payment_optionsobject

Payment settings of this Billing Checkout.

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 Billing Checkout will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Billing Checkout, and other configurations in invoice_data. Only applicable when mode is PAYMENT, and the type of the customer is BUSINESS

payment_options.payment_method_saveobject

Settings for saving this payment method for future use.

payment_options.payment_method_save.modestring

Controls whether the payment method can be saved for future use. Possible values: ENABLED, DISABLED, or COLLECT_CONSENT.
ENABLED: The payment method will be saved for future use.
DISABLED: The payment method will not be saved.
COLLECT_CONSENT: The checkout UI asks the customer whether they want to save the payment method. Only applicable to cards.

payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved payment source to trigger future payments. One of MERCHANT or CUSTOMER.
If MERCHANT, a Payment Source 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 hosted checkout page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the hosted checkout page.
Possible enum values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible enum values when mode is PAYMENT: afterpay, airwallex_pay, alfamart, alipaycn, alipayhk, applepay, atome, au_pay, axs_kiosk, bancontact, bigc,bitpay, bkash, blik, boost, card, cash_app_pay, dana, doku_ewallet, dragonpay, duit_now, d_barai, enets, eps, esun, family_mart, fps, fpx, gcash, giropay, googlepay, go_pay, grabpay, hi_life, ideal, indomaret, jenius_pay, kakaopay, klarna, konbini, korean_local_card, laybuy, line_pay, linkaja, maxima, merpay, multibanco, mybank, narvesen, naver_pay, online_banking, ovo, p24, paybybankapp, payco, payeasy, payeasy_atm, payme, paypal, paypay, paypost, paysafecard, paysafecash, paysera, payu, pay_now, perlas_terminals, permatanet, permata_atm, pix, poli, prompt_pay, rabbit_line_pay, rakuten_pay, safetypay, samsung_pay, sam_kiosk, satispay, seven_eleven, shopee_pay, skrill, sofort, spei, tesco_lotus, tng, toss_pay, truemoney, trustly, twint, upi, venmo, verkkopankki, wechatpay, zip.
Possible enum values when mode is SETUP: card.

request_idrequiredstring

Unique request ID specified by the merchant.

subscription_dataobject

The settings of subscription to be passed to the subscription creation upon completion of the Billing Checkout 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.

ui_modestring

The UI mode of the Billing Checkout, 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.
Defaults to HOSTED if not specified.

Response body - 201 Created
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.
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 associated billing customer. Billing Checkout will create a new Billing Customer based on information provided during the process, unless an existing billing customer ID was provided when the Billing Checkout was created.

cancelled_atstring

Time when the Billing Checkout was cancelled.

client_secretstring

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

completed_atstring

Time when the Billing Checkout was completed.

created_atstring

Time when the Billing Checkout was created.

currencystring

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

customer_dataobject

The prefilled information of the customer. Only applicable when billing_customer_id is not provided.
Not applicable in SETUP mode.

customer_data.emailstring

The prefilled email of the customer. If this field or a billing_customer_id with an email on file is provided, the email will be prefilled and will not be editable during checkout. If neither is provided, Billing Checkout will prompt the customer to enter their email during the checkout process.

customer_data.namestring

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

customer_data.typestring

Type of the billing customer, one of BUSINESS or INDIVIDUAL. If not provided, an "I am purchasing as a business" checkbox will be displayed during checkout for the customer to self-select.

customer_data_collectionobject

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

customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address will only be collected when necessary. Specifically, when automatic tax is enabled, or tax_id is collected.
  • REQUIRED: Billing address will always be collected. Defaults to AUTO.
customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for business customer during checkout. One of OPTIONAL_IF_SUPPORTED, DISABLED, REQUIRED_IF_SUPPORTED.

  • DISABLED: Tax id will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax id will be optionally collected in the supported countries, by displaying a checkbox "I am purchasing as business".
  • REQUIRED_IF_SUPPORTED: Tax id will always be collected if the country is in the supported list. Defaults to OPTIONAL_IF_SUPPORTED.
discountsarray

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

discounts.couponobject

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

discounts.coupon.idstring

id of the Coupon object.

discounts.typestring

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.

expires_atstring

Time when the Billing Checkout expires.

hosted_completion_pageobject

Configuration for the Airwallex-hosted completion page. Only applicable when ui_mode is HOSTED.

hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after checkout is completed and before the customer is redirected to success_url.

idstring

ID of the Billing Checkout object.

invoice_dataobject

The settings of invoice to be passed to the invoice creation upon completion of the Billing Checkout in PAYMENT mode.

invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

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_data.due_atstring

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

invoice_data.memostring

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

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 Billing Checkout in PAYMENT mode. Only applicable when the Billing Checkout is in COMPLETED status

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 to be applied to the line items. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

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.discounts.typestring

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

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.

linked_payment_account_idstring

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

localestring

A code, in IETF language format, that determines the language and formatting displayed to customers on the checkout UI, and can be one of: AUTO, EN, ZH.
If set to AUTO the customer's browser locale is used.

metadataobject

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

modestring

The mode of the Billing Checkout object, can be one of:
SUBSCRIPTION: Set up subscriptions.
PAYMENT: Accept one-off payments.SETUP: Collect payment details to charge your customers later.

payment_optionsobject

Payment settings of this Billing Checkout.

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 Billing Checkout will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Billing Checkout, and other configurations in invoice_data. Only applicable when mode is PAYMENT, and the type of the customer is BUSINESS

payment_options.payment_method_saveobject

Settings for saving this payment method for future use.

payment_options.payment_method_save.modestring

Controls whether the payment method can be saved for future use. Possible values: ENABLED, DISABLED, or COLLECT_CONSENT.
ENABLED: The payment method will be saved for future use.
DISABLED: The payment method will not be saved.
COLLECT_CONSENT: The checkout UI asks the customer whether they want to save the payment method.

payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved payment source to trigger future payments. One of MERCHANT or CUSTOMER.
If MERCHANT, a Payment Source 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 hosted checkout page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the hosted checkout page.
Possible enum values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible enum values when mode is PAYMENT: afterpay, airwallex_pay, alfamart, alipaycn, alipayhk, applepay, atome, au_pay, axs_kiosk, bancontact, bigc,bitpay, bkash, blik, boost, card, cash_app_pay, dana, doku_ewallet, dragonpay, duit_now, d_barai, enets, eps, esun, family_mart, fps, fpx, gcash, giropay, googlepay, go_pay, grabpay, hi_life, ideal, indomaret, jenius_pay, kakaopay, klarna, konbini, korean_local_card, laybuy, line_pay, linkaja, maxima, merpay, multibanco, mybank, narvesen, naver_pay, online_banking, ovo, p24, paybybankapp, payco, payeasy, payeasy_atm, payme, paypal, paypay, paypost, paysafecard, paysafecash, paysera, payu, pay_now, perlas_terminals, permatanet, permata_atm, pix, poli, prompt_pay, rabbit_line_pay, rakuten_pay, safetypay, samsung_pay, sam_kiosk, satispay, seven_eleven, shopee_pay, skrill, sofort, spei, tesco_lotus, tng, toss_pay, truemoney, trustly, twint, upi, venmo, verkkopankki, wechatpay, zip.
Possible enum values when mode is SETUP: card.

payment_source_idstring

ID of the Payment Source created when the Billing Checkout 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 Billing Checkout object, can be one of:
ACTIVE: The Billing Checkout is available for the customer to complete a purchase.
COMPLETED: The Billing Checkout has been completed.
CANCELLED: The Billing Checkout has been cancelled.
EXPIRED: The Billing Checkout 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 Billing Checkout 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.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.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.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 Billing Checkout in SUBSCRIPTION mode. Only applicable when the Billing Checkout is in COMPLETED status

success_urlstring

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

ui_modestring

The UI mode of the Billing Checkout, 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.

updated_atstring

Time when the Billing Checkout was last updated.

urlstring

The URL to the Billing Checkout. The value is only present when the 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/billing/billing_checkouts/create
$curl --request POST \
> --url 'https://api-demo.airwallex.com/api/v1/billing/billing_checkouts/create' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "back_url": "https://www.airwallex.com/back",
> "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
> "currency": "USD",
> "customer_data": {
> "email": "[email protected]",
> "name": "John Doe",
> "type": "INDIVIDUAL"
> },
> "customer_data_collection": {
> "billing_address": "AUTO",
> "tax_id": "OPTIONAL_IF_SUPPORTED"
> },
> "discounts": [
> {
> "coupon": {
> "id": "coup_abc123"
> },
> "type": "COUPON"
> }
> ],
> "enable_automatic_tax": false,
> "hosted_completion_page": {
> "display": true
> },
> "invoice_data": {
> "days_until_due": 0,
> "default_tax_percent": 10,
> "due_at": "2026-01-01T10:15:30+0000",
> "memo": "Thank you for your business!",
> "metadata": {
> "foo": "bar"
> }
> },
> "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
> "line_items": [
> {
> "discounts": [
> {
> "coupon": {
> "id": "coup_abc123"
> },
> "type": "COUPON"
> }
> ],
> "price": {
> "currency": "USD",
> "description": "Standard option: $10 / month.",
> "pricing_model": "PER_UNIT",
> "product": {
> "description": "The license to use software in one month.",
> "metadata": {
> "foo": "bar"
> },
> "name": "Software License",
> "tax_code": "pct_0504010000",
> "unit": "month"
> },
> "product_id": "prd_hkpd1x2gbgazzvcd42w",
> "tax_included": false
> },
> "price_id": "pri_hkpd7fedfgb004apkvs",
> "quantity": 1,
> "tax_percent": 5
> }
> ],
> "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
> "locale": "AUTO",
> "metadata": {
> "foo": "bar"
> },
> "mode": "SUBSCRIPTION",
> "payment_options": {
> "pay_by_invoice_enabled": false,
> "payment_method_save": {
> "mode": "ENABLED",
> "next_triggered_by": "MERCHANT"
> },
> "payment_method_types": [
> "card",
> "googlepay",
> "applepay"
> ]
> },
> "request_id": "ee939540-3203-4a2c-9172-89a566485dd9",
> "subscription_data": {
> "days_until_due": 0,
> "default_invoice_template": {
> "invoice_memo": "Thanks for your purchase."
> },
> "default_tax_percent": 10,
> "duration": {
> "period": 12,
> "period_unit": "MONTH"
> },
> "metadata": {
> "foo": "bar"
> },
> "starts_at": "2023-01-01T00:00:00+0000",
> "trial_ends_at": "2023-02-01T00:00:00+0000"
> },
> "success_url": "https://www.airwallex.com/success",
> "ui_mode": "HOSTED"
>}'
Response (201 Created)
1{
2 "automatic_tax_status": "APPLIED",
3 "back_url": "https://www.airwallex.com/back",
4 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
5 "cancelled_at": "2025-05-10T18:00:30+0000",
6 "client_secret": "eyJhbGciOiJIUzI1NiJ9...",
7 "completed_at": "2025-05-10T18:00:30+0000",
8 "created_at": "2025-05-10T16:00:30+0000",
9 "currency": "USD",
10 "customer_data": {
11 "email": "[email protected]",
12 "name": "John Doe",
13 "type": "INDIVIDUAL"
14 },
15 "customer_data_collection": {
16 "billing_address": "AUTO",
17 "tax_id": "OPTIONAL_IF_SUPPORTED"
18 },
19 "discounts": [
20 {
21 "coupon": {
22 "id": "coup_abc123"
23 },
24 "type": "COUPON"
25 }
26 ],
27 "enable_automatic_tax": true,
28 "expires_at": "2025-05-12T16:00:30+0000",
29 "hosted_completion_page": {
30 "display": true
31 },
32 "id": "bco_sgstcdcpnh8sv3awiwo",
33 "invoice_data": {
34 "days_until_due": 0,
35 "default_tax_percent": 10,
36 "due_at": "2026-01-01T10:15:30+0000",
37 "memo": "Thank you for your business!",
38 "metadata": {
39 "foo": "bar"
40 }
41 },
42 "invoice_id": "inv_hkpd49cskgblns6iimw",
43 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
44 "line_items": [
45 {
46 "discounts": [
47 {
48 "coupon": {
49 "id": "coup_abc123"
50 },
51 "type": "COUPON"
52 }
53 ],
54 "price_id": "pri_hkpd7fedfgb004apkvs",
55 "quantity": 1,
56 "tax_percent": 5
57 }
58 ],
59 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
60 "locale": "AUTO",
61 "metadata": {
62 "foo": "bar"
63 },
64 "mode": "SUBSCRIPTION",
65 "payment_options": {
66 "pay_by_invoice_enabled": false,
67 "payment_method_save": {
68 "mode": "ENABLED",
69 "next_triggered_by": "MERCHANT"
70 },
71 "payment_method_types": [
72 "card",
73 "googlepay",
74 "applepay"
75 ]
76 },
77 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
78 "return_url": "https://www.airwallex.com/return",
79 "status": "ACTIVE",
80 "subscription_data": {
81 "days_until_due": 0,
82 "default_invoice_template": {
83 "invoice_memo": "Thanks for your purchase."
84 },
85 "default_tax_percent": 10,
86 "duration": {
87 "period": 12,
88 "period_unit": "MONTH"
89 },
90 "metadata": {
91 "foo": "bar"
92 },
93 "recurring": {
94 "period": 1,
95 "period_unit": "MONTH"
96 },
97 "starts_at": "2023-01-01T00:00:00+0000",
98 "trial_ends_at": "2023-02-01T00:00:00+0000"
99 },
100 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
101 "success_url": "https://www.airwallex.com/success",
102 "ui_mode": "HOSTED",
103 "updated_at": "2025-05-10T16:00:30+0000",
104 "url": "https://checkout.airwallex.com/pay?s=jwt_token"
105}
Was this section helpful?

Retrieve a billing checkout

GET /api/v1/billing/billing_checkouts/{id}

Retrieves a Billing Checkout.

Parameters
idrequiredstring

ID of the Billing Checkout object.

Response body - 200 OK
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.
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 associated billing customer. Billing Checkout will create a new Billing Customer based on information provided during the process, unless an existing billing customer ID was provided when the Billing Checkout was created.

cancelled_atstring

Time when the Billing Checkout was cancelled.

client_secretstring

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

completed_atstring

Time when the Billing Checkout was completed.

created_atstring

Time when the Billing Checkout was created.

currencystring

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

customer_dataobject

The prefilled information of the customer. Only applicable when billing_customer_id is not provided.
Not applicable in SETUP mode.

customer_data.emailstring

The prefilled email of the customer. If this field or a billing_customer_id with an email on file is provided, the email will be prefilled and will not be editable during checkout. If neither is provided, Billing Checkout will prompt the customer to enter their email during the checkout process.

customer_data.namestring

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

customer_data.typestring

Type of the billing customer, one of BUSINESS or INDIVIDUAL. If not provided, an "I am purchasing as a business" checkbox will be displayed during checkout for the customer to self-select.

customer_data_collectionobject

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

customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address will only be collected when necessary. Specifically, when automatic tax is enabled, or tax_id is collected.
  • REQUIRED: Billing address will always be collected. Defaults to AUTO.
customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for business customer during checkout. One of OPTIONAL_IF_SUPPORTED, DISABLED, REQUIRED_IF_SUPPORTED.

  • DISABLED: Tax id will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax id will be optionally collected in the supported countries, by displaying a checkbox "I am purchasing as business".
  • REQUIRED_IF_SUPPORTED: Tax id will always be collected if the country is in the supported list. Defaults to OPTIONAL_IF_SUPPORTED.
discountsarray

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

discounts.couponobject

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

discounts.coupon.idstring

id of the Coupon object.

discounts.typestring

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.

expires_atstring

Time when the Billing Checkout expires.

hosted_completion_pageobject

Configuration for the Airwallex-hosted completion page. Only applicable when ui_mode is HOSTED.

hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after checkout is completed and before the customer is redirected to success_url.

idstring

ID of the Billing Checkout object.

invoice_dataobject

The settings of invoice to be passed to the invoice creation upon completion of the Billing Checkout in PAYMENT mode.

invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

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_data.due_atstring

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

invoice_data.memostring

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

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 Billing Checkout in PAYMENT mode. Only applicable when the Billing Checkout is in COMPLETED status

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 to be applied to the line items. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

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.discounts.typestring

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

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.

linked_payment_account_idstring

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

localestring

A code, in IETF language format, that determines the language and formatting displayed to customers on the checkout UI, and can be one of: AUTO, EN, ZH.
If set to AUTO the customer's browser locale is used.

metadataobject

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

modestring

The mode of the Billing Checkout object, can be one of:
SUBSCRIPTION: Set up subscriptions.
PAYMENT: Accept one-off payments.SETUP: Collect payment details to charge your customers later.

payment_optionsobject

Payment settings of this Billing Checkout.

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 Billing Checkout will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Billing Checkout, and other configurations in invoice_data. Only applicable when mode is PAYMENT, and the type of the customer is BUSINESS

payment_options.payment_method_saveobject

Settings for saving this payment method for future use.

payment_options.payment_method_save.modestring

Controls whether the payment method can be saved for future use. Possible values: ENABLED, DISABLED, or COLLECT_CONSENT.
ENABLED: The payment method will be saved for future use.
DISABLED: The payment method will not be saved.
COLLECT_CONSENT: The checkout UI asks the customer whether they want to save the payment method.

payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved payment source to trigger future payments. One of MERCHANT or CUSTOMER.
If MERCHANT, a Payment Source 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 hosted checkout page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the hosted checkout page.
Possible enum values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible enum values when mode is PAYMENT: afterpay, airwallex_pay, alfamart, alipaycn, alipayhk, applepay, atome, au_pay, axs_kiosk, bancontact, bigc,bitpay, bkash, blik, boost, card, cash_app_pay, dana, doku_ewallet, dragonpay, duit_now, d_barai, enets, eps, esun, family_mart, fps, fpx, gcash, giropay, googlepay, go_pay, grabpay, hi_life, ideal, indomaret, jenius_pay, kakaopay, klarna, konbini, korean_local_card, laybuy, line_pay, linkaja, maxima, merpay, multibanco, mybank, narvesen, naver_pay, online_banking, ovo, p24, paybybankapp, payco, payeasy, payeasy_atm, payme, paypal, paypay, paypost, paysafecard, paysafecash, paysera, payu, pay_now, perlas_terminals, permatanet, permata_atm, pix, poli, prompt_pay, rabbit_line_pay, rakuten_pay, safetypay, samsung_pay, sam_kiosk, satispay, seven_eleven, shopee_pay, skrill, sofort, spei, tesco_lotus, tng, toss_pay, truemoney, trustly, twint, upi, venmo, verkkopankki, wechatpay, zip.
Possible enum values when mode is SETUP: card.

payment_source_idstring

ID of the Payment Source created when the Billing Checkout 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 Billing Checkout object, can be one of:
ACTIVE: The Billing Checkout is available for the customer to complete a purchase.
COMPLETED: The Billing Checkout has been completed.
CANCELLED: The Billing Checkout has been cancelled.
EXPIRED: The Billing Checkout 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 Billing Checkout 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.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.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.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 Billing Checkout in SUBSCRIPTION mode. Only applicable when the Billing Checkout is in COMPLETED status

success_urlstring

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

ui_modestring

The UI mode of the Billing Checkout, 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.

updated_atstring

Time when the Billing Checkout was last updated.

urlstring

The URL to the Billing Checkout. The value is only present when the 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/billing/billing_checkouts/{id}
$curl --request GET \
> --url 'https://api-demo.airwallex.com/api/v1/billing/billing_checkouts/billing_checkout_id' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "automatic_tax_status": "APPLIED",
3 "back_url": "https://www.airwallex.com/back",
4 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
5 "cancelled_at": "2025-05-10T18:00:30+0000",
6 "client_secret": "eyJhbGciOiJIUzI1NiJ9...",
7 "completed_at": "2025-05-10T18:00:30+0000",
8 "created_at": "2025-05-10T16:00:30+0000",
9 "currency": "USD",
10 "customer_data": {
11 "email": "[email protected]",
12 "name": "John Doe",
13 "type": "INDIVIDUAL"
14 },
15 "customer_data_collection": {
16 "billing_address": "AUTO",
17 "tax_id": "OPTIONAL_IF_SUPPORTED"
18 },
19 "discounts": [
20 {
21 "coupon": {
22 "id": "coup_abc123"
23 },
24 "type": "COUPON"
25 }
26 ],
27 "enable_automatic_tax": true,
28 "expires_at": "2025-05-12T16:00:30+0000",
29 "hosted_completion_page": {
30 "display": true
31 },
32 "id": "bco_sgstcdcpnh8sv3awiwo",
33 "invoice_data": {
34 "days_until_due": 0,
35 "default_tax_percent": 10,
36 "due_at": "2026-01-01T10:15:30+0000",
37 "memo": "Thank you for your business!",
38 "metadata": {
39 "foo": "bar"
40 }
41 },
42 "invoice_id": "inv_hkpd49cskgblns6iimw",
43 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
44 "line_items": [
45 {
46 "discounts": [
47 {
48 "coupon": {
49 "id": "coup_abc123"
50 },
51 "type": "COUPON"
52 }
53 ],
54 "price_id": "pri_hkpd7fedfgb004apkvs",
55 "quantity": 1,
56 "tax_percent": 5
57 }
58 ],
59 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
60 "locale": "AUTO",
61 "metadata": {
62 "foo": "bar"
63 },
64 "mode": "SUBSCRIPTION",
65 "payment_options": {
66 "pay_by_invoice_enabled": false,
67 "payment_method_save": {
68 "mode": "ENABLED",
69 "next_triggered_by": "MERCHANT"
70 },
71 "payment_method_types": [
72 "card",
73 "googlepay",
74 "applepay"
75 ]
76 },
77 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
78 "return_url": "https://www.airwallex.com/return",
79 "status": "ACTIVE",
80 "subscription_data": {
81 "days_until_due": 0,
82 "default_invoice_template": {
83 "invoice_memo": "Thanks for your purchase."
84 },
85 "default_tax_percent": 10,
86 "duration": {
87 "period": 12,
88 "period_unit": "MONTH"
89 },
90 "metadata": {
91 "foo": "bar"
92 },
93 "recurring": {
94 "period": 1,
95 "period_unit": "MONTH"
96 },
97 "starts_at": "2023-01-01T00:00:00+0000",
98 "trial_ends_at": "2023-02-01T00:00:00+0000"
99 },
100 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
101 "success_url": "https://www.airwallex.com/success",
102 "ui_mode": "HOSTED",
103 "updated_at": "2025-05-10T16:00:30+0000",
104 "url": "https://checkout.airwallex.com/pay?s=jwt_token"
105}
Was this section helpful?

Get list of billing checkouts

GET /api/v1/billing/billing_checkouts

Retrieves a list of Billing Checkouts based on the query parameters.

Parameters
subscription_idstring

ID of the subscription for the Billing Checkout upon completion.

from_created_atstring

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

to_created_atstring

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

statusstring

Status of the Billing Checkout.

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 Billing Checkouts per page. Defaults to 20.

Response body - 200 OK
itemsarray

Paged results.

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.
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 associated billing customer. Billing Checkout will create a new Billing Customer based on information provided during the process, unless an existing billing customer ID was provided when the Billing Checkout was created.

items.cancelled_atstring

Time when the Billing Checkout was cancelled.

items.client_secretstring

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

items.completed_atstring

Time when the Billing Checkout was completed.

items.created_atstring

Time when the Billing Checkout was created.

items.currencystring

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

items.customer_dataobject

The prefilled information of the customer. Only applicable when billing_customer_id is not provided.
Not applicable in SETUP mode.

items.customer_data.emailstring

The prefilled email of the customer. If this field or a billing_customer_id with an email on file is provided, the email will be prefilled and will not be editable during checkout. If neither is provided, Billing Checkout will prompt the customer to enter their email during the checkout process.

items.customer_data.namestring

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

items.customer_data.typestring

Type of the billing customer, one of BUSINESS or INDIVIDUAL. If not provided, an "I am purchasing as a business" checkbox will be displayed during checkout for the customer to self-select.

items.customer_data_collectionobject

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

items.customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address will only be collected when necessary. Specifically, when automatic tax is enabled, or tax_id is collected.
  • REQUIRED: Billing address will always be collected. Defaults to AUTO.
items.customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for business customer during checkout. One of OPTIONAL_IF_SUPPORTED, DISABLED, REQUIRED_IF_SUPPORTED.

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

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

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.discounts.typestring

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

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 Billing Checkout expires.

items.hosted_completion_pageobject

Configuration for the Airwallex-hosted completion page. Only applicable when ui_mode is HOSTED.

items.hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after checkout is completed and before the customer is redirected to success_url.

items.idstring

ID of the Billing Checkout object.

items.invoice_dataobject

The settings of invoice to be passed to the invoice creation upon completion of the Billing Checkout in PAYMENT mode.

items.invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

items.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_data.due_atstring

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

items.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_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 Billing Checkout in PAYMENT mode. Only applicable when the Billing Checkout is in COMPLETED status

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.line_itemsarray

A list of items the customer is purchasing.

items.line_items.discountsarray

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

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.discounts.typestring

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

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.linked_payment_account_idstring

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

items.localestring

A code, in IETF language format, that determines the language and formatting displayed to customers on the checkout UI, and can be one of: AUTO, EN, ZH.
If set to AUTO the customer's browser locale is used.

items.metadataobject

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

items.modestring

The mode of the Billing Checkout object, can be one of:
SUBSCRIPTION: Set up subscriptions.
PAYMENT: Accept one-off payments.SETUP: Collect payment details to charge your customers later.

items.payment_optionsobject

Payment settings of this Billing Checkout.

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 Billing Checkout will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Billing Checkout, and other configurations in invoice_data. Only applicable when mode is PAYMENT, and the type of the customer is BUSINESS

items.payment_options.payment_method_saveobject

Settings for saving this payment method for future use.

items.payment_options.payment_method_save.modestring

Controls whether the payment method can be saved for future use. Possible values: ENABLED, DISABLED, or COLLECT_CONSENT.
ENABLED: The payment method will be saved for future use.
DISABLED: The payment method will not be saved.
COLLECT_CONSENT: The checkout UI asks the customer whether they want to save the payment method.

items.payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved payment source to trigger future payments. One of MERCHANT or CUSTOMER.
If MERCHANT, a Payment Source 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 hosted checkout page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the hosted checkout page.
Possible enum values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible enum values when mode is PAYMENT: afterpay, airwallex_pay, alfamart, alipaycn, alipayhk, applepay, atome, au_pay, axs_kiosk, bancontact, bigc,bitpay, bkash, blik, boost, card, cash_app_pay, dana, doku_ewallet, dragonpay, duit_now, d_barai, enets, eps, esun, family_mart, fps, fpx, gcash, giropay, googlepay, go_pay, grabpay, hi_life, ideal, indomaret, jenius_pay, kakaopay, klarna, konbini, korean_local_card, laybuy, line_pay, linkaja, maxima, merpay, multibanco, mybank, narvesen, naver_pay, online_banking, ovo, p24, paybybankapp, payco, payeasy, payeasy_atm, payme, paypal, paypay, paypost, paysafecard, paysafecash, paysera, payu, pay_now, perlas_terminals, permatanet, permata_atm, pix, poli, prompt_pay, rabbit_line_pay, rakuten_pay, safetypay, samsung_pay, sam_kiosk, satispay, seven_eleven, shopee_pay, skrill, sofort, spei, tesco_lotus, tng, toss_pay, truemoney, trustly, twint, upi, venmo, verkkopankki, wechatpay, zip.
Possible enum values when mode is SETUP: card.

items.payment_source_idstring

ID of the Payment Source created when the Billing Checkout 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.statusstring

The status of the Billing Checkout object, can be one of:
ACTIVE: The Billing Checkout is available for the customer to complete a purchase.
COMPLETED: The Billing Checkout has been completed.
CANCELLED: The Billing Checkout has been cancelled.
EXPIRED: The Billing Checkout has expired.
The status automatically changes from ACTIVE to EXPIRED after 1 hour if purchase has not been completed.

items.subscription_dataobject

The settings of subscription to be passed to the subscription creation upon completion of the Billing Checkout 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.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.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.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 Billing Checkout in SUBSCRIPTION mode. Only applicable when the Billing Checkout is in COMPLETED status

items.success_urlstring

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

items.ui_modestring

The UI mode of the Billing Checkout, 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 Billing Checkout was last updated.

items.urlstring

The URL to the Billing Checkout. The value is only present when the 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/billing/billing_checkouts
$curl --request GET \
> --url 'https://api-demo.airwallex.com/api/v1/billing/billing_checkouts' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "items": [
3 {
4 "automatic_tax_status": "APPLIED",
5 "back_url": "https://www.airwallex.com/back",
6 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
7 "cancelled_at": "2025-05-10T18:00:30+0000",
8 "client_secret": "eyJhbGciOiJIUzI1NiJ9...",
9 "completed_at": "2025-05-10T18:00:30+0000",
10 "created_at": "2025-05-10T16:00:30+0000",
11 "currency": "USD",
12 "customer_data": {
13 "email": "[email protected]",
14 "name": "John Doe",
15 "type": "INDIVIDUAL"
16 },
17 "customer_data_collection": {
18 "billing_address": "AUTO",
19 "tax_id": "OPTIONAL_IF_SUPPORTED"
20 },
21 "discounts": [
22 {
23 "coupon": {
24 "id": "coup_abc123"
25 },
26 "type": "COUPON"
27 }
28 ],
29 "enable_automatic_tax": true,
30 "expires_at": "2025-05-12T16:00:30+0000",
31 "hosted_completion_page": {
32 "display": true
33 },
34 "id": "bco_sgstcdcpnh8sv3awiwo",
35 "invoice_data": {
36 "days_until_due": 0,
37 "default_tax_percent": 10,
38 "due_at": "2026-01-01T10:15:30+0000",
39 "memo": "Thank you for your business!",
40 "metadata": {
41 "foo": "bar"
42 }
43 },
44 "invoice_id": "inv_hkpd49cskgblns6iimw",
45 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
46 "line_items": [
47 {
48 "discounts": [
49 {
50 "coupon": {
51 "id": "coup_abc123"
52 },
53 "type": "COUPON"
54 }
55 ],
56 "price_id": "pri_hkpd7fedfgb004apkvs",
57 "quantity": 1,
58 "tax_percent": 5
59 }
60 ],
61 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
62 "locale": "AUTO",
63 "metadata": {
64 "foo": "bar"
65 },
66 "mode": "SUBSCRIPTION",
67 "payment_options": {
68 "payment_method_save": {
69 "mode": "ENABLED",
70 "next_triggered_by": "MERCHANT"
71 },
72 "payment_method_types": [
73 "card",
74 "googlepay",
75 "applepay"
76 ]
77 },
78 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
79 "return_url": "https://www.airwallex.com/return",
80 "status": "ACTIVE",
81 "subscription_data": {
82 "days_until_due": 0,
83 "default_invoice_template": {
84 "invoice_memo": "Thanks for your purchase."
85 },
86 "default_tax_percent": 10,
87 "duration": {
88 "period": 12,
89 "period_unit": "MONTH"
90 },
91 "metadata": {
92 "foo": "bar"
93 },
94 "recurring": {
95 "period": 1,
96 "period_unit": "MONTH"
97 },
98 "starts_at": "2023-01-01T00:00:00+0000",
99 "trial_ends_at": "2023-02-01T00:00:00+0000"
100 },
101 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
102 "success_url": "https://www.airwallex.com/success",
103 "ui_mode": "HOSTED",
104 "updated_at": "2025-05-10T16:00:30+0000",
105 "url": "https://checkout.airwallex.com/pay?s=jwt_token"
106 }
107 ],
108 "page_after": "<string>",
109 "page_before": "<string>"
110}
Was this section helpful?

Update a billing checkout

POST /api/v1/billing/billing_checkouts/{id}/update

Updates a Billing Checkout object.

Parameters
idrequiredstring

ID of the Billing Checkout

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
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.
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 associated billing customer. Billing Checkout will create a new Billing Customer based on information provided during the process, unless an existing billing customer ID was provided when the Billing Checkout was created.

cancelled_atstring

Time when the Billing Checkout was cancelled.

client_secretstring

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

completed_atstring

Time when the Billing Checkout was completed.

created_atstring

Time when the Billing Checkout was created.

currencystring

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

customer_dataobject

The prefilled information of the customer. Only applicable when billing_customer_id is not provided.
Not applicable in SETUP mode.

customer_data.emailstring

The prefilled email of the customer. If this field or a billing_customer_id with an email on file is provided, the email will be prefilled and will not be editable during checkout. If neither is provided, Billing Checkout will prompt the customer to enter their email during the checkout process.

customer_data.namestring

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

customer_data.typestring

Type of the billing customer, one of BUSINESS or INDIVIDUAL. If not provided, an "I am purchasing as a business" checkbox will be displayed during checkout for the customer to self-select.

customer_data_collectionobject

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

customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address will only be collected when necessary. Specifically, when automatic tax is enabled, or tax_id is collected.
  • REQUIRED: Billing address will always be collected. Defaults to AUTO.
customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for business customer during checkout. One of OPTIONAL_IF_SUPPORTED, DISABLED, REQUIRED_IF_SUPPORTED.

  • DISABLED: Tax id will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax id will be optionally collected in the supported countries, by displaying a checkbox "I am purchasing as business".
  • REQUIRED_IF_SUPPORTED: Tax id will always be collected if the country is in the supported list. Defaults to OPTIONAL_IF_SUPPORTED.
discountsarray

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

discounts.couponobject

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

discounts.coupon.idstring

id of the Coupon object.

discounts.typestring

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.

expires_atstring

Time when the Billing Checkout expires.

hosted_completion_pageobject

Configuration for the Airwallex-hosted completion page. Only applicable when ui_mode is HOSTED.

hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after checkout is completed and before the customer is redirected to success_url.

idstring

ID of the Billing Checkout object.

invoice_dataobject

The settings of invoice to be passed to the invoice creation upon completion of the Billing Checkout in PAYMENT mode.

invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

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_data.due_atstring

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

invoice_data.memostring

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

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 Billing Checkout in PAYMENT mode. Only applicable when the Billing Checkout is in COMPLETED status

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 to be applied to the line items. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

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.discounts.typestring

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

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.

linked_payment_account_idstring

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

localestring

A code, in IETF language format, that determines the language and formatting displayed to customers on the checkout UI, and can be one of: AUTO, EN, ZH.
If set to AUTO the customer's browser locale is used.

metadataobject

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

modestring

The mode of the Billing Checkout object, can be one of:
SUBSCRIPTION: Set up subscriptions.
PAYMENT: Accept one-off payments.SETUP: Collect payment details to charge your customers later.

payment_optionsobject

Payment settings of this Billing Checkout.

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 Billing Checkout will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Billing Checkout, and other configurations in invoice_data. Only applicable when mode is PAYMENT, and the type of the customer is BUSINESS

payment_options.payment_method_saveobject

Settings for saving this payment method for future use.

payment_options.payment_method_save.modestring

Controls whether the payment method can be saved for future use. Possible values: ENABLED, DISABLED, or COLLECT_CONSENT.
ENABLED: The payment method will be saved for future use.
DISABLED: The payment method will not be saved.
COLLECT_CONSENT: The checkout UI asks the customer whether they want to save the payment method.

payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved payment source to trigger future payments. One of MERCHANT or CUSTOMER.
If MERCHANT, a Payment Source 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 hosted checkout page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the hosted checkout page.
Possible enum values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible enum values when mode is PAYMENT: afterpay, airwallex_pay, alfamart, alipaycn, alipayhk, applepay, atome, au_pay, axs_kiosk, bancontact, bigc,bitpay, bkash, blik, boost, card, cash_app_pay, dana, doku_ewallet, dragonpay, duit_now, d_barai, enets, eps, esun, family_mart, fps, fpx, gcash, giropay, googlepay, go_pay, grabpay, hi_life, ideal, indomaret, jenius_pay, kakaopay, klarna, konbini, korean_local_card, laybuy, line_pay, linkaja, maxima, merpay, multibanco, mybank, narvesen, naver_pay, online_banking, ovo, p24, paybybankapp, payco, payeasy, payeasy_atm, payme, paypal, paypay, paypost, paysafecard, paysafecash, paysera, payu, pay_now, perlas_terminals, permatanet, permata_atm, pix, poli, prompt_pay, rabbit_line_pay, rakuten_pay, safetypay, samsung_pay, sam_kiosk, satispay, seven_eleven, shopee_pay, skrill, sofort, spei, tesco_lotus, tng, toss_pay, truemoney, trustly, twint, upi, venmo, verkkopankki, wechatpay, zip.
Possible enum values when mode is SETUP: card.

payment_source_idstring

ID of the Payment Source created when the Billing Checkout 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 Billing Checkout object, can be one of:
ACTIVE: The Billing Checkout is available for the customer to complete a purchase.
COMPLETED: The Billing Checkout has been completed.
CANCELLED: The Billing Checkout has been cancelled.
EXPIRED: The Billing Checkout 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 Billing Checkout 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.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.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.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 Billing Checkout in SUBSCRIPTION mode. Only applicable when the Billing Checkout is in COMPLETED status

success_urlstring

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

ui_modestring

The UI mode of the Billing Checkout, 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.

updated_atstring

Time when the Billing Checkout was last updated.

urlstring

The URL to the Billing Checkout. The value is only present when the 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/billing/billing_checkouts/{id}/update
$curl --request POST \
> --url 'https://api-demo.airwallex.com/api/v1/billing/billing_checkouts/billing_checkout_id/update' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "metadata": {
> "foo": "bar"
> }
>}'
Response (200 OK)
1{
2 "automatic_tax_status": "APPLIED",
3 "back_url": "https://www.airwallex.com/back",
4 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
5 "cancelled_at": "2025-05-10T18:00:30+0000",
6 "client_secret": "eyJhbGciOiJIUzI1NiJ9...",
7 "completed_at": "2025-05-10T18:00:30+0000",
8 "created_at": "2025-05-10T16:00:30+0000",
9 "currency": "USD",
10 "customer_data": {
11 "email": "[email protected]",
12 "name": "John Doe",
13 "type": "INDIVIDUAL"
14 },
15 "customer_data_collection": {
16 "billing_address": "AUTO",
17 "tax_id": "OPTIONAL_IF_SUPPORTED"
18 },
19 "discounts": [
20 {
21 "coupon": {
22 "id": "coup_abc123"
23 },
24 "type": "COUPON"
25 }
26 ],
27 "enable_automatic_tax": true,
28 "expires_at": "2025-05-12T16:00:30+0000",
29 "hosted_completion_page": {
30 "display": true
31 },
32 "id": "bco_sgstcdcpnh8sv3awiwo",
33 "invoice_data": {
34 "days_until_due": 0,
35 "default_tax_percent": 10,
36 "due_at": "2026-01-01T10:15:30+0000",
37 "memo": "Thank you for your business!",
38 "metadata": {
39 "foo": "bar"
40 }
41 },
42 "invoice_id": "inv_hkpd49cskgblns6iimw",
43 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
44 "line_items": [
45 {
46 "discounts": [
47 {
48 "coupon": {
49 "id": "coup_abc123"
50 },
51 "type": "COUPON"
52 }
53 ],
54 "price_id": "pri_hkpd7fedfgb004apkvs",
55 "quantity": 1,
56 "tax_percent": 5
57 }
58 ],
59 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
60 "locale": "AUTO",
61 "metadata": {
62 "foo": "bar"
63 },
64 "mode": "SUBSCRIPTION",
65 "payment_options": {
66 "pay_by_invoice_enabled": false,
67 "payment_method_save": {
68 "mode": "ENABLED",
69 "next_triggered_by": "MERCHANT"
70 },
71 "payment_method_types": [
72 "card",
73 "googlepay",
74 "applepay"
75 ]
76 },
77 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
78 "return_url": "https://www.airwallex.com/return",
79 "status": "ACTIVE",
80 "subscription_data": {
81 "days_until_due": 0,
82 "default_invoice_template": {
83 "invoice_memo": "Thanks for your purchase."
84 },
85 "default_tax_percent": 10,
86 "duration": {
87 "period": 12,
88 "period_unit": "MONTH"
89 },
90 "metadata": {
91 "foo": "bar"
92 },
93 "recurring": {
94 "period": 1,
95 "period_unit": "MONTH"
96 },
97 "starts_at": "2023-01-01T00:00:00+0000",
98 "trial_ends_at": "2023-02-01T00:00:00+0000"
99 },
100 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
101 "success_url": "https://www.airwallex.com/success",
102 "ui_mode": "HOSTED",
103 "updated_at": "2025-05-10T16:00:30+0000",
104 "url": "https://checkout.airwallex.com/pay?s=jwt_token"
105}
Was this section helpful?

Cancel a billing checkout

POST /api/v1/billing/billing_checkouts/{id}/cancel

A Billing Checkout in ACTIVE status can be cancelled. Once cancelled, the customer will no longer be able to complete the checkout and will see an error message when attempting to load it.

Parameters
idrequiredstring

ID of the Billing Checkout

Response body - 200 OK
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.
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 associated billing customer. Billing Checkout will create a new Billing Customer based on information provided during the process, unless an existing billing customer ID was provided when the Billing Checkout was created.

cancelled_atstring

Time when the Billing Checkout was cancelled.

client_secretstring

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

completed_atstring

Time when the Billing Checkout was completed.

created_atstring

Time when the Billing Checkout was created.

currencystring

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

customer_dataobject

The prefilled information of the customer. Only applicable when billing_customer_id is not provided.
Not applicable in SETUP mode.

customer_data.emailstring

The prefilled email of the customer. If this field or a billing_customer_id with an email on file is provided, the email will be prefilled and will not be editable during checkout. If neither is provided, Billing Checkout will prompt the customer to enter their email during the checkout process.

customer_data.namestring

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

customer_data.typestring

Type of the billing customer, one of BUSINESS or INDIVIDUAL. If not provided, an "I am purchasing as a business" checkbox will be displayed during checkout for the customer to self-select.

customer_data_collectionobject

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

customer_data_collection.billing_addressstring

Controls whether the billing address will be collected during checkout.

  • AUTO: Billing address will only be collected when necessary. Specifically, when automatic tax is enabled, or tax_id is collected.
  • REQUIRED: Billing address will always be collected. Defaults to AUTO.
customer_data_collection.tax_idstring

Controls whether the tax ID will be collected for business customer during checkout. One of OPTIONAL_IF_SUPPORTED, DISABLED, REQUIRED_IF_SUPPORTED.

  • DISABLED: Tax id will not be collected.
  • OPTIONAL_IF_SUPPORTED: Tax id will be optionally collected in the supported countries, by displaying a checkbox "I am purchasing as business".
  • REQUIRED_IF_SUPPORTED: Tax id will always be collected if the country is in the supported list. Defaults to OPTIONAL_IF_SUPPORTED.
discountsarray

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

discounts.couponobject

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

discounts.coupon.idstring

id of the Coupon object.

discounts.typestring

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.

expires_atstring

Time when the Billing Checkout expires.

hosted_completion_pageobject

Configuration for the Airwallex-hosted completion page. Only applicable when ui_mode is HOSTED.

hosted_completion_page.displayboolean

Whether to display the Airwallex-hosted completion page after checkout is completed and before the customer is redirected to success_url.

idstring

ID of the Billing Checkout object.

invoice_dataobject

The settings of invoice to be passed to the invoice creation upon completion of the Billing Checkout in PAYMENT mode.

invoice_data.days_until_dueinteger

Number of days from invoice finalization until payment is due.

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_data.due_atstring

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

invoice_data.memostring

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

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 Billing Checkout in PAYMENT mode. Only applicable when the Billing Checkout is in COMPLETED status

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 to be applied to the line items. Discounts of line items are applied before subscription or invoice discounts. Currently, only one element is supported.

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.discounts.typestring

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

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.

linked_payment_account_idstring

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

localestring

A code, in IETF language format, that determines the language and formatting displayed to customers on the checkout UI, and can be one of: AUTO, EN, ZH.
If set to AUTO the customer's browser locale is used.

metadataobject

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

modestring

The mode of the Billing Checkout object, can be one of:
SUBSCRIPTION: Set up subscriptions.
PAYMENT: Accept one-off payments.SETUP: Collect payment details to charge your customers later.

payment_optionsobject

Payment settings of this Billing Checkout.

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 Billing Checkout will transit to COMPLETED, and an invoice will be generated. The invoice will inherit the payment_options of this Billing Checkout, and other configurations in invoice_data. Only applicable when mode is PAYMENT, and the type of the customer is BUSINESS

payment_options.payment_method_saveobject

Settings for saving this payment method for future use.

payment_options.payment_method_save.modestring

Controls whether the payment method can be saved for future use. Possible values: ENABLED, DISABLED, or COLLECT_CONSENT.
ENABLED: The payment method will be saved for future use.
DISABLED: The payment method will not be saved.
COLLECT_CONSENT: The checkout UI asks the customer whether they want to save the payment method.

payment_options.payment_method_save.next_triggered_bystring

Indicates who will use the saved payment source to trigger future payments. One of MERCHANT or CUSTOMER.
If MERCHANT, a Payment Source 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 hosted checkout page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the hosted checkout page.
Possible enum values when mode is SUBSCRIPTION: card, applepay, googlepay, alipaycn, alipayhk, dana, gcash, kakaopay, klarna, rabbit_line_pay, tng, truemoney.
Possible enum values when mode is PAYMENT: afterpay, airwallex_pay, alfamart, alipaycn, alipayhk, applepay, atome, au_pay, axs_kiosk, bancontact, bigc,bitpay, bkash, blik, boost, card, cash_app_pay, dana, doku_ewallet, dragonpay, duit_now, d_barai, enets, eps, esun, family_mart, fps, fpx, gcash, giropay, googlepay, go_pay, grabpay, hi_life, ideal, indomaret, jenius_pay, kakaopay, klarna, konbini, korean_local_card, laybuy, line_pay, linkaja, maxima, merpay, multibanco, mybank, narvesen, naver_pay, online_banking, ovo, p24, paybybankapp, payco, payeasy, payeasy_atm, payme, paypal, paypay, paypost, paysafecard, paysafecash, paysera, payu, pay_now, perlas_terminals, permatanet, permata_atm, pix, poli, prompt_pay, rabbit_line_pay, rakuten_pay, safetypay, samsung_pay, sam_kiosk, satispay, seven_eleven, shopee_pay, skrill, sofort, spei, tesco_lotus, tng, toss_pay, truemoney, trustly, twint, upi, venmo, verkkopankki, wechatpay, zip.
Possible enum values when mode is SETUP: card.

payment_source_idstring

ID of the Payment Source created when the Billing Checkout 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 Billing Checkout object, can be one of:
ACTIVE: The Billing Checkout is available for the customer to complete a purchase.
COMPLETED: The Billing Checkout has been completed.
CANCELLED: The Billing Checkout has been cancelled.
EXPIRED: The Billing Checkout 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 Billing Checkout 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.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.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.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 Billing Checkout in SUBSCRIPTION mode. Only applicable when the Billing Checkout is in COMPLETED status

success_urlstring

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

ui_modestring

The UI mode of the Billing Checkout, 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.

updated_atstring

Time when the Billing Checkout was last updated.

urlstring

The URL to the Billing Checkout. The value is only present when the 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/billing/billing_checkouts/{id}/cancel
$curl --request POST \
> --url 'https://api-demo.airwallex.com/api/v1/billing/billing_checkouts/billing_checkout_id/cancel' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "automatic_tax_status": "APPLIED",
3 "back_url": "https://www.airwallex.com/back",
4 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
5 "cancelled_at": "2025-05-10T18:00:30+0000",
6 "client_secret": "eyJhbGciOiJIUzI1NiJ9...",
7 "completed_at": "2025-05-10T18:00:30+0000",
8 "created_at": "2025-05-10T16:00:30+0000",
9 "currency": "USD",
10 "customer_data": {
11 "email": "[email protected]",
12 "name": "John Doe",
13 "type": "INDIVIDUAL"
14 },
15 "customer_data_collection": {
16 "billing_address": "AUTO",
17 "tax_id": "OPTIONAL_IF_SUPPORTED"
18 },
19 "discounts": [
20 {
21 "coupon": {
22 "id": "coup_abc123"
23 },
24 "type": "COUPON"
25 }
26 ],
27 "enable_automatic_tax": true,
28 "expires_at": "2025-05-12T16:00:30+0000",
29 "hosted_completion_page": {
30 "display": true
31 },
32 "id": "bco_sgstcdcpnh8sv3awiwo",
33 "invoice_data": {
34 "days_until_due": 0,
35 "default_tax_percent": 10,
36 "due_at": "2026-01-01T10:15:30+0000",
37 "memo": "Thank you for your business!",
38 "metadata": {
39 "foo": "bar"
40 }
41 },
42 "invoice_id": "inv_hkpd49cskgblns6iimw",
43 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
44 "line_items": [
45 {
46 "discounts": [
47 {
48 "coupon": {
49 "id": "coup_abc123"
50 },
51 "type": "COUPON"
52 }
53 ],
54 "price_id": "pri_hkpd7fedfgb004apkvs",
55 "quantity": 1,
56 "tax_percent": 5
57 }
58 ],
59 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
60 "locale": "AUTO",
61 "metadata": {
62 "foo": "bar"
63 },
64 "mode": "SUBSCRIPTION",
65 "payment_options": {
66 "pay_by_invoice_enabled": false,
67 "payment_method_save": {
68 "mode": "ENABLED",
69 "next_triggered_by": "MERCHANT"
70 },
71 "payment_method_types": [
72 "card",
73 "googlepay",
74 "applepay"
75 ]
76 },
77 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
78 "return_url": "https://www.airwallex.com/return",
79 "status": "ACTIVE",
80 "subscription_data": {
81 "days_until_due": 0,
82 "default_invoice_template": {
83 "invoice_memo": "Thanks for your purchase."
84 },
85 "default_tax_percent": 10,
86 "duration": {
87 "period": 12,
88 "period_unit": "MONTH"
89 },
90 "metadata": {
91 "foo": "bar"
92 },
93 "recurring": {
94 "period": 1,
95 "period_unit": "MONTH"
96 },
97 "starts_at": "2023-01-01T00:00:00+0000",
98 "trial_ends_at": "2023-02-01T00:00:00+0000"
99 },
100 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
101 "success_url": "https://www.airwallex.com/success",
102 "ui_mode": "HOSTED",
103 "updated_at": "2025-05-10T16:00:30+0000",
104 "url": "https://checkout.airwallex.com/pay?s=jwt_token"
105}
Was this section helpful?