Airwallex logo

Invoices

Copy for LLMView as Markdown

An Invoice represents an official request for payment that details products or services purchased, pricing and payment instructions. It can be issued directly (one-time invoices) or via a Subscription (recurring invoices).

Endpoints
POST /api/v1/billing/invoices/create
POST /api/v1/billing/invoices/preview
POST /api/v1/billing/invoices/{id}/update
POST /api/v1/billing/invoices/{id}/delete
GET /api/v1/billing/invoices/{id}
GET /api/v1/billing/invoices
POST /api/v1/billing/invoices/{id}/finalize
POST /api/v1/billing/invoices/{id}/mark_as_paid
POST /api/v1/billing/invoices/{id}/void
POST /api/v1/billing/invoices/{id}/pay
POST /api/v1/billing/invoices/{id}/add_line_items
GET /api/v1/billing/invoices/{id}/line_items/{item_id}
GET /api/v1/billing/invoices/{id}/line_items
POST /api/v1/billing/invoices/{id}/update_line_items
POST /api/v1/billing/invoices/{id}/delete_line_items

Create an invoice

POST /api/v1/billing/invoices/create

Creates a one-off Invoice.

Request body
billing_customer_idrequiredstring

ID of the Billing Customer who will be charged.

currencyrequiredstring

The currency of the Invoice in 3-letter ISO-4217 format.

request_idrequiredstring

Unique request ID specified by the merchant.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

days_until_dueinteger

Number of days from invoice finalization until payment is due. Only one of days_until_due and due_at should be passed.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive. Defaults to 0.

discountsarray

List of discounts to be applied to the invoice. Invoice line item discounts are applied before invoice 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.

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.

enable_automatic_taxboolean

Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically. Defaults to false.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

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.

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. If collection_method is CHARGE_ON_CHECKOUT and your organisation has only one payment account, it will be automatically populated with that account by default.

memostring

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

metadataobject

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

numberstring

Unique invoice number specified by the merchant. If omitted, Airwallex generates one automatically.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.
Possible enum values: afterpay, airwallex_pay, alfamart, alipaycn, alipayhk, applepay, atome, au_pay, axs_kiosk, bancontact, bank_transfer, 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.

payment_source_idstring

ID of the Payment Source to pay for the invoice. Required when collection_method is AUTO_CHARGE.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

Response body - 201 Created
amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
bank_transfer_instructions.account_numberstring

Bank account number.

bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
bank_transfer_instructions.ibanstring

IBAN number.

bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

created_atstring

Time when this invoice was created.

credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

due_atstring

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

enable_automatic_taxboolean

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

finalized_atstring

The time that the invoice draft was finalized.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

idstring

ID of the Invoice object.

last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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.

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.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

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

next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

paid_atstring

The time that the invoice was paid.

paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription that generated this invoice, if any.

total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

total_tax_amountnumber

The aggregate amounts calculated for all line items.

updated_atstring

Time when this invoice was last updated.

voided_atstring

The time that the invoice was voided.

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/invoices/create
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/create' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
> "collection_method": "AUTO_CHARGE",
> "currency": "USD",
> "days_until_due": 1,
> "default_tax_percent": 10,
> "discounts": [
> {
> "coupon": {
> "id": "coup_abc123"
> },
> "type": "COUPON"
> }
> ],
> "due_at": "2022-01-01T10:15:30+0000",
> "enable_automatic_tax": true,
> "footer": "Please include the reference number in your payment reference.\nFor remittance advice, contact [email protected].",
> "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
> "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
> "memo": "manual invoice",
> "metadata": {
> "foo": "bar"
> },
> "number": "INV-2026-0001",
> "payment_options": {
> "payment_method_save": {
> "mode": "ENABLED",
> "next_triggered_by": "MERCHANT"
> },
> "payment_method_types": [
> "card",
> "googlepay",
> "applepay"
> ]
> },
> "payment_source_id": "psrc_d3Ds20ae5VihKs092",
> "request_id": "ee939540-3203-4a2c-9172-89a566485dd9"
>}'
Response (201 Created)
1{
2 "amount_due": 100,
3 "applied_discounts": [
4 {
5 "amount_off": 10,
6 "applied_to": "SUBSCRIPTION",
7 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
8 "billing_customer_id": "bcus_7fz9qm2n4k",
9 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
10 "currency": "USD",
11 "discount_model": "PERCENTAGE",
12 "duration": {
13 "period": 3,
14 "period_unit": "MONTH"
15 },
16 "duration_type": "CUSTOM",
17 "ends_at": "2027-01-01T00:00:00+0000",
18 "id": "disc_hkpdkcmxdgazzq53jbk",
19 "name": "Black Friday 20% Off",
20 "percentage_off": 20,
21 "source": "COUPON",
22 "source_id": "coup_hkpdkcmxdgazzq53jbk",
23 "starts_at": "2026-01-01T00:00:00+0000"
24 }
25 ],
26 "automatic_tax_status": "APPLIED",
27 "bank_transfer_instructions": {
28 "currency": "USD",
29 "account_name": "Tromp, Littel and Luettgen",
30 "account_number": "8453687204",
31 "bank_name": "Community Federal Savings Bank",
32 "routing_number": "026073150",
33 "reference": "QCNLQC"
34 },
35 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
36 "collection_method": "AUTO_CHARGE",
37 "created_at": "2022-01-01T10:15:30+0000",
38 "credit_note_amount_after_payment": 10,
39 "credit_note_amount_before_payment": 10,
40 "currency": "USD",
41 "days_until_due": 1,
42 "default_tax_percent": 10,
43 "due_at": "2022-12-05T10:15:30+0000",
44 "enable_automatic_tax": true,
45 "finalized_at": "2022-12-05T10:15:30+0000",
46 "footer": "Please include the reference number in your payment reference.\nFor remittance advice, contact [email protected].",
47 "hosted_url": "https://invoice.airwallex.com/billing/invoices/payment?s=jwt_token",
48 "id": "inv_hkpd49cskgblns6iimw",
49 "last_payment_attempt_at": "2022-12-05T10:15:30+0000",
50 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
51 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
52 "memo": "Invoice memo.",
53 "metadata": {
54 "foo": "bar"
55 },
56 "next_payment_attempt_at": "2022-12-05T10:15:30+0000",
57 "number": "INV-YOLI0II9-0685",
58 "paid_at": "2022-12-05T10:15:30+0000",
59 "paid_out_of_band": false,
60 "past_payment_attempt_count": 1,
61 "payment_options": {
62 "payment_method_save": {
63 "mode": "ENABLED",
64 "next_triggered_by": "MERCHANT"
65 },
66 "payment_method_types": [
67 "card",
68 "googlepay",
69 "applepay"
70 ]
71 },
72 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
73 "payment_status": "UNPAID",
74 "pdf_url": "https://invoice.airwallex.com/billing/invoices/pdf?s=jwt_token",
75 "remaining_payment_attempt_count": 1,
76 "status": "FINALIZED",
77 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
78 "total_amount": 100,
79 "total_discount_amounts": [
80 {
81 "amount": 10,
82 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
83 }
84 ],
85 "total_tax_amount": 0,
86 "updated_at": "2022-01-01T10:15:30+0000",
87 "voided_at": "2022-12-05T10:15:30+0000"
88}
Was this section helpful?

Preview an invoice

POST /api/v1/billing/invoices/preview

Preview the upcoming invoice of an existing Subscription (by specifying a subscription_id), or the first invoice before a new Subscription is created (without specifying a subscription_id).

Request body
billing_customer_idstring

ID of the Billing Customer who this Invoice is to be issued to.

billing_cycle_anchor_atstring

A future timestamp in the first billing cycle as the reference point to align the future billing date.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive. Defaults to 0.

discountsarray

List of discounts to be applied to the invoice. Invoice line item discounts are applied before invoice 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 invoice. When enabled, the system attempts to calculate taxes automatically. Defaults to false.

ends_atstring

Time when the subscription is scheduled to end. The subscription will continue indefinitely if both of duration and ends_at are null. It is only applicable when duration is empty.

itemsarray

List of Subscription Items to be used for generating the invoice.

items.price_idrequiredstring

ID of the Price subscribed by the customer. The Price's recurring values must match the recurring values set out in this subscription.

items.discountsarray

List of discounts to be applied to the invoice. Invoice line item discounts are applied before invoice discounts. Currently, only one element is supported.

items.discounts.couponrequiredobject

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

items.discounts.coupon.idrequiredstring

id of the Coupon object.

items.discounts.typerequiredstring

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

items.quantityinteger

The product quantity. Defaults to 1.

items.tax_percentnumber

The effective tax percent of this invoice line item.

legal_entity_idstring

ID of the legal entity to be used for the Invoice as billing entity. You can get this ID from the legal_entity_id in the response of the Retrieve account details API.

starts_atstring

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

subscription_idstring

ID of the Subscription object.

trial_ends_atstring

The end time of the trial if applicable.

Response body - 200 OK
applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

billing_customer_idstring

ID of the Billing Customer who will be charged.

created_atstring

Time when this invoice will be created.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive. Defaults to 0.

enable_automatic_taxboolean

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

itemsarray

The preview invoice items.

items.amountnumber

The amount of the Invoice Line Item.

items.applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

items.applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
items.applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

items.applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

items.applied_discounts.created_atstring

Time when the Discount was created.

items.applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
items.applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
items.applied_discounts.idstring

ID of the Discount object.

items.applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

items.applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
items.applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

items.applied_discounts.updated_atstring

Time when the Discount was updated.

items.applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

items.applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

items.applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

items.applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

items.applied_discounts.duration.periodinteger

The number of period units.

items.applied_discounts.duration.period_unitstring

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

items.applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

items.applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

items.applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

items.currencystring

The currency of the Invoice Line Item in 3-letter ISO-4217 format.

items.discount_amountsarray

The amount of discount calculated per discount for this line item. The Discount applied to the invoice will be apportioned to the DiscountAmountResponses of each invoice line item

items.discount_amounts.amountnumber

The amount of the applied discount.

items.discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

items.priceobject

Price subscribed by the customer.

items.price.activeboolean

true if the price is available for new purchases, false otherwise.

items.price.created_atstring

Time when the price was created.

items.price.currencystring

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

items.price.idstring

ID of the Price object.

items.price.meteredboolean

Specify how to determine the quantity of the product used in each billing cycle for subscription payments. true if the quantity is dynamically determined during the billing cycle. The merchant should call the Ingest Usage Events API to submit usage data when the product is used. false if the quantity is determined when creating a subscription.

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.
  • VOLUME: the unit price is based on which tier the total quantity falls in.
  • GRADUATED: the unit price changes as the quantity increases.
items.price.product_idstring

ID of the Product object this price is associated with.

items.price.tax_includedboolean

Whether the price includes tax.

items.price.typestring

One of ONE_OFF or RECURRING depending on whether the price is for a one-off purchase or a recurring (subscription) purchase.

items.price.updated_atstring

Time when the price was last updated.

items.price.billing_typestring

Indicates when should the price be billed, one of

  • IN_ADVANCE: billed at the beginning of the billing cycle.
  • IN_ARREARS: billed at the end of the billing cycle.
items.price.descriptionstring

Price description.

items.price.flat_amountnumber

The fixed amount to be charged. Only required when the pricing model is FLAT.

items.price.lotobject

Defines how quantity is grouped into billable lots. The unit_amount is then applied per lot. If not set, quantity is treated as the number of billable lots. Only applicable for PER_UNIT price.

items.price.lot.rounding_modestring

Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.

items.price.lot.sizeinteger

The amount of quantity that constitutes a single billable lot.

items.price.metadataobject

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

items.price.meter_idstring

ID of the Meter object specifying how to calculate the usage for this price.

items.price.recurringobject

The frequency at which the price is charged. null for one-time charge.

items.price.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.price.recurring.period_unitstring

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

items.price.tiersarray

List of quantity-based pricing tiers for this price. Required when the pricing model is VOLUME or GRADUATED.

items.price.tiers.flat_amountnumber

The flat amount to be charged for this tier when pricing model is GRADUATED, or the overall flat amount to be charged when pricing model is VOLUME.

items.price.tiers.lotobject

Defines how quantity is grouped into billable lots. The unit_amount is then applied per lot. If not set, quantity is treated as the number of billable lots. Only applicable for VOLUME and GRADUATED prices.

items.price.tiers.lot.rounding_modestring

Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.

items.price.tiers.lot.sizeinteger

The amount of quantity that constitutes a single billable lot.

items.price.tiers.unit_amountnumber

The per-unit amount to be charged for this tier when pricing model is GRADUATED, or the overall per-unit amount to be charged when pricing model is VOLUME.

items.price.tiers.unit_descriptionstring

Description of the billable unit for the tier.

items.price.tiers.upper_boundnumber

The upper quantity limit of this tier. This tier is applicable when the quantity does not exceed the upper bound of this tier, and is greater than the upper bound of the tier below it(or 0 if this is the first tier). For the last tier, the upper bound must be left empty.

items.price.unit_amountnumber

The amount to be charged per product unit. Only required when the pricing model is PER_UNIT.

items.price.unit_descriptionstring

Description of the billable unit for the price.

items.quantityinteger

The product quantity.

items.period_ends_atstring

The end of the billing period associated with this Invoice Line Item. This value is exclusive.

items.period_starts_atstring

The start of the billing period associated with this Invoice Line Item. This value is inclusive.

items.tax_amountnumber

The tax amount for this line item.

items.tax_breakdownarray

The tax breakdown details the exact taxes that apply to this line item.

items.tax_breakdown.namestring

The display name of this tax component.

items.tax_breakdown.tax_amountnumber

The amount of tax charged for this component.

items.tax_breakdown.tax_percentnumber

The tax percent applied for this component.

items.tax_breakdown.taxable_amountnumber

The portion of the subtotal that this tax component applies to.

items.tax_percentnumber

The effective tax percent of this invoice line item.

legal_entity_idstring

ID of the legal entity to be used for the Invoice as billing entity.

subscription_idstring

ID of the Subscription which generated this invoice, if any.

total_amountnumber

The total amount of the invoice.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

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/invoices/preview
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/preview' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
> "billing_cycle_anchor_at": "2022-01-15T10:15:30+0000",
> "default_tax_percent": 10,
> "discounts": [
> {
> "coupon": {
> "id": "coup_abc123"
> },
> "type": "COUPON"
> }
> ],
> "enable_automatic_tax": false,
> "ends_at": "2023-01-01T10:15:30+0000",
> "items": [
> {
> "discounts": [
> {
> "coupon": {
> "id": "coup_abc123"
> },
> "type": "COUPON"
> }
> ],
> "price_id": "pri_sgpd7fedwse004apedr",
> "quantity": 1,
> "tax_percent": 5
> }
> ],
> "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
> "starts_at": "2022-01-01T10:15:30+0000",
> "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
> "trial_ends_at": "2022-01-01T10:15:30+0000"
>}'
Response (200 OK)
1{
2 "applied_discounts": [
3 {
4 "amount_off": 10,
5 "applied_to": "SUBSCRIPTION",
6 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
7 "billing_customer_id": "bcus_7fz9qm2n4k",
8 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
9 "currency": "USD",
10 "discount_model": "PERCENTAGE",
11 "duration": {
12 "period": 3,
13 "period_unit": "MONTH"
14 },
15 "duration_type": "CUSTOM",
16 "ends_at": "2027-01-01T00:00:00+0000",
17 "id": "disc_hkpdkcmxdgazzq53jbk",
18 "name": "Black Friday 20% Off",
19 "percentage_off": 20,
20 "source": "COUPON",
21 "source_id": "coup_hkpdkcmxdgazzq53jbk",
22 "starts_at": "2026-01-01T00:00:00+0000"
23 }
24 ],
25 "automatic_tax_status": "APPLIED",
26 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
27 "created_at": "2022-01-01T10:15:30+0000",
28 "currency": "USD",
29 "default_tax_percent": 10,
30 "enable_automatic_tax": true,
31 "items": [
32 {
33 "amount": 10,
34 "applied_discounts": [
35 {
36 "amount_off": 10,
37 "applied_to": "SUBSCRIPTION",
38 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
39 "billing_customer_id": "bcus_7fz9qm2n4k",
40 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
41 "currency": "USD",
42 "discount_model": "PERCENTAGE",
43 "duration": {
44 "period": 3,
45 "period_unit": "MONTH"
46 },
47 "duration_type": "CUSTOM",
48 "ends_at": "2027-01-01T00:00:00+0000",
49 "id": "disc_hkpdkcmxdgazzq53jbk",
50 "name": "Black Friday 20% Off",
51 "percentage_off": 20,
52 "source": "COUPON",
53 "source_id": "coup_hkpdkcmxdgazzq53jbk",
54 "starts_at": "2026-01-01T00:00:00+0000"
55 }
56 ],
57 "currency": "USD",
58 "discount_amounts": [
59 {
60 "amount": 10,
61 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
62 }
63 ],
64 "period_ends_at": "2022-01-05T10:15:30+0000",
65 "period_starts_at": "2022-01-01T10:15:30+0000",
66 "price": {
67 "active": true,
68 "billing_type": "IN_ADVANCE",
69 "created_at": "2022-01-01T10:15:30+0000",
70 "currency": "USD",
71 "description": "Standard option: $10 / month.",
72 "id": "pri_hkpd7fedfgb004apkvs",
73 "metadata": {
74 "foo": "bar"
75 },
76 "metered": false,
77 "pricing_model": "GRADUATED",
78 "product_id": "prd_hkpd1x2gbgazzvcd42w",
79 "recurring": {
80 "period": 1,
81 "period_unit": "MONTH"
82 },
83 "tax_included": false,
84 "tiers": [
85 {
86 "unit_amount": 10,
87 "upper_bound": 20
88 },
89 {
90 "flat_amount": 20
91 }
92 ],
93 "type": "RECURRING",
94 "updated_at": "2022-01-01T10:15:30+0000"
95 },
96 "quantity": 1,
97 "tax_amount": 1.5,
98 "tax_breakdown": [
99 {
100 "name": "GST",
101 "tax_amount": 10,
102 "tax_percent": 10,
103 "taxable_amount": 100
104 }
105 ],
106 "tax_percent": 5
107 }
108 ],
109 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
110 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
111 "total_amount": 10,
112 "total_discount_amounts": [
113 {
114 "amount": 10,
115 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
116 }
117 ]
118}
Was this section helpful?

Update an invoice

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

Updates a draft Invoice. Only fields provided in the request are updated, while omitted fields remain unchanged. Array fields are fully replaced if included. Set a field to null or an empty string (for strings) to clear its value.

Parameters
idrequiredstring

ID of the Invoice object.

Request body
billing_customer_idstring

ID of the Billing Customer who this Invoice is to be issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due. Only one of days_until_due and due_at should be passed.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

discountsarray

Desired set of invoice-level discounts. If provided, replaces all existing 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.typestring

Specifies how to obtain a new discount. One of: COUPON.

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.

enable_automatic_taxboolean

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

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

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.

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 collection_method is CHARGE_ON_CHECKOUT when the invoice is finalized.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

A set of key-value pairs that you can attach to an invoice object. It can be useful for storing additional information about the invoice in a structured format.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.
Possible enum values: afterpay, airwallex_pay, alfamart, alipaycn, alipayhk, applepay, atome, au_pay, axs_kiosk, bancontact, bank_transfer, 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.

payment_source_idstring

ID of the Payment Source to pay for the invoice. Required when collection_method is AUTO_CHARGE.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

Response body - 200 OK
amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
bank_transfer_instructions.account_numberstring

Bank account number.

bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
bank_transfer_instructions.ibanstring

IBAN number.

bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

created_atstring

Time when this invoice was created.

credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

due_atstring

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

enable_automatic_taxboolean

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

finalized_atstring

The time that the invoice draft was finalized.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

idstring

ID of the Invoice object.

last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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.

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.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

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

next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

paid_atstring

The time that the invoice was paid.

paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription that generated this invoice, if any.

total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

total_tax_amountnumber

The aggregate amounts calculated for all line items.

updated_atstring

Time when this invoice was last updated.

voided_atstring

The time that the invoice was voided.

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/invoices/{id}/update
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id/update' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
> "collection_method": "AUTO_CHARGE",
> "currency": "USD",
> "days_until_due": 1,
> "default_tax_percent": 10,
> "discounts": [
> {
> "coupon": {
> "id": "coup_abc123"
> },
> "type": "COUPON"
> }
> ],
> "due_at": "2025-01-27T12:00:00+0000",
> "enable_automatic_tax": true,
> "footer": "Please include the reference number in your payment reference.\nFor remittance advice, contact [email protected].",
> "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
> "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
> "memo": "memo example",
> "metadata": {
> "foo": "bar"
> },
> "payment_options": {
> "payment_method_save": {
> "mode": "ENABLED",
> "next_triggered_by": "MERCHANT"
> },
> "payment_method_types": [
> "card",
> "googlepay",
> "applepay"
> ]
> },
> "payment_source_id": "psrc_d3Ds20ae5VihKs092"
>}'
Response (200 OK)
1{
2 "amount_due": 100,
3 "applied_discounts": [
4 {
5 "amount_off": 10,
6 "applied_to": "SUBSCRIPTION",
7 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
8 "billing_customer_id": "bcus_7fz9qm2n4k",
9 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
10 "currency": "USD",
11 "discount_model": "PERCENTAGE",
12 "duration": {
13 "period": 3,
14 "period_unit": "MONTH"
15 },
16 "duration_type": "CUSTOM",
17 "ends_at": "2027-01-01T00:00:00+0000",
18 "id": "disc_hkpdkcmxdgazzq53jbk",
19 "name": "Black Friday 20% Off",
20 "percentage_off": 20,
21 "source": "COUPON",
22 "source_id": "coup_hkpdkcmxdgazzq53jbk",
23 "starts_at": "2026-01-01T00:00:00+0000"
24 }
25 ],
26 "automatic_tax_status": "APPLIED",
27 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
28 "collection_method": "AUTO_CHARGE",
29 "created_at": "2022-01-01T10:15:30+0000",
30 "credit_note_amount_after_payment": 10,
31 "credit_note_amount_before_payment": 10,
32 "currency": "USD",
33 "days_until_due": 1,
34 "default_tax_percent": 10,
35 "due_at": "2022-12-05T10:15:30+0000",
36 "enable_automatic_tax": true,
37 "finalized_at": "2022-12-05T10:15:30+0000",
38 "footer": "Please include the reference number in your payment reference.\nFor remittance advice, contact [email protected].",
39 "hosted_url": "https://invoice.airwallex.com/billing/invoices/payment?s=jwt_token",
40 "id": "inv_hkpd49cskgblns6iimw",
41 "last_payment_attempt_at": "2022-12-05T10:15:30+0000",
42 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
43 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
44 "memo": "Invoice memo.",
45 "metadata": {
46 "foo": "bar"
47 },
48 "next_payment_attempt_at": "2022-12-05T10:15:30+0000",
49 "number": "INV-YOLI0II9-0685",
50 "paid_at": "2022-12-05T10:15:30+0000",
51 "paid_out_of_band": false,
52 "past_payment_attempt_count": 1,
53 "payment_options": {
54 "payment_method_save": {
55 "mode": "ENABLED",
56 "next_triggered_by": "MERCHANT"
57 },
58 "payment_method_types": [
59 "card",
60 "googlepay",
61 "applepay"
62 ]
63 },
64 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
65 "payment_status": "UNPAID",
66 "pdf_url": "https://invoice.airwallex.com/billing/invoices/pdf?s=jwt_token",
67 "remaining_payment_attempt_count": 1,
68 "status": "FINALIZED",
69 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
70 "total_amount": 100,
71 "total_discount_amounts": [
72 {
73 "amount": 10,
74 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
75 }
76 ],
77 "total_tax_amount": 0,
78 "updated_at": "2022-01-01T10:15:30+0000",
79 "voided_at": "2022-12-05T10:15:30+0000",
80 "bank_transfer_instructions": {
81 "currency": "USD",
82 "account_name": "Tromp, Littel and Luettgen",
83 "account_number": "8453687204",
84 "bank_name": "Community Federal Savings Bank",
85 "routing_number": "026073150",
86 "reference": "QCNLQC"
87 }
88}
Was this section helpful?

Delete a draft invoice

POST /api/v1/billing/invoices/{id}/delete

Delete a draft Invoice.

Parameters
idrequiredstring

ID of the Invoice object.

Response body - 200 OK
deletedboolean

Indicates whether the delete command was executed successfully.

idstring

ID of the Invoice object.

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/invoices/{id}/delete
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id/delete' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "deleted": true,
3 "id": "inv_hkpd49cskgblns6iimw"
4}
Was this section helpful?

Retrieve an invoice

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

Retrieves the details of an Invoice.

Parameters
idrequiredstring

ID of the Invoice object.

Response body - 200 OK
amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
bank_transfer_instructions.account_numberstring

Bank account number.

bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
bank_transfer_instructions.ibanstring

IBAN number.

bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

created_atstring

Time when this invoice was created.

credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

due_atstring

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

enable_automatic_taxboolean

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

finalized_atstring

The time that the invoice draft was finalized.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

idstring

ID of the Invoice object.

last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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.

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.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

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

next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

paid_atstring

The time that the invoice was paid.

paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription that generated this invoice, if any.

total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

total_tax_amountnumber

The aggregate amounts calculated for all line items.

updated_atstring

Time when this invoice was last updated.

voided_atstring

The time that the invoice was voided.

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/invoices/{id}
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "amount_due": 100,
3 "applied_discounts": [
4 {
5 "amount_off": 10,
6 "applied_to": "SUBSCRIPTION",
7 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
8 "billing_customer_id": "bcus_7fz9qm2n4k",
9 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
10 "currency": "USD",
11 "discount_model": "PERCENTAGE",
12 "duration": {
13 "period": 3,
14 "period_unit": "MONTH"
15 },
16 "duration_type": "CUSTOM",
17 "ends_at": "2027-01-01T00:00:00+0000",
18 "id": "disc_hkpdkcmxdgazzq53jbk",
19 "name": "Black Friday 20% Off",
20 "percentage_off": 20,
21 "source": "COUPON",
22 "source_id": "coup_hkpdkcmxdgazzq53jbk",
23 "starts_at": "2026-01-01T00:00:00+0000"
24 }
25 ],
26 "automatic_tax_status": "APPLIED",
27 "bank_transfer_instructions": {
28 "currency": "USD",
29 "account_name": "Tromp, Littel and Luettgen",
30 "account_number": "8453687204",
31 "bank_name": "Community Federal Savings Bank",
32 "routing_number": "026073150",
33 "reference": "QCNLQC"
34 },
35 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
36 "collection_method": "AUTO_CHARGE",
37 "created_at": "2022-01-01T10:15:30+0000",
38 "credit_note_amount_after_payment": 10,
39 "credit_note_amount_before_payment": 10,
40 "currency": "USD",
41 "days_until_due": 1,
42 "default_tax_percent": 10,
43 "due_at": "2022-12-05T10:15:30+0000",
44 "enable_automatic_tax": true,
45 "finalized_at": "2022-12-05T10:15:30+0000",
46 "footer": "Please include the reference number in your payment reference.\nFor remittance advice, contact [email protected].",
47 "hosted_url": "https://invoice.airwallex.com/billing/invoices/payment?s=jwt_token",
48 "id": "inv_hkpd49cskgblns6iimw",
49 "last_payment_attempt_at": "2022-12-05T10:15:30+0000",
50 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
51 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
52 "memo": "Invoice memo.",
53 "metadata": {
54 "foo": "bar"
55 },
56 "next_payment_attempt_at": "2022-12-05T10:15:30+0000",
57 "number": "INV-YOLI0II9-0685",
58 "paid_at": "2022-12-05T10:15:30+0000",
59 "paid_out_of_band": false,
60 "past_payment_attempt_count": 1,
61 "payment_options": {
62 "payment_method_save": {
63 "mode": "ENABLED",
64 "next_triggered_by": "MERCHANT"
65 },
66 "payment_method_types": [
67 "card",
68 "googlepay",
69 "applepay"
70 ]
71 },
72 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
73 "payment_status": "UNPAID",
74 "pdf_url": "https://invoice.airwallex.com/billing/invoices/pdf?s=jwt_token",
75 "remaining_payment_attempt_count": 1,
76 "status": "FINALIZED",
77 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
78 "total_amount": 100,
79 "total_discount_amounts": [
80 {
81 "amount": 10,
82 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
83 }
84 ],
85 "total_tax_amount": 0,
86 "updated_at": "2022-01-01T10:15:30+0000",
87 "voided_at": "2022-12-05T10:15:30+0000"
88}
Was this section helpful?

Get list of invoices

GET /api/v1/billing/invoices

Retrieves a list of Invoices based on the query parameters.

Parameters
billing_customer_idstring

ID of the Billing Customer who the invoice is addressed to.

from_created_atstring

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

pagestring

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

page_sizeinteger

Number of Invoices per page. Defaults to 20.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription which generated this invoice, if any.

to_created_atstring

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

Response body - 200 OK
itemsarray

Paged results.

items.amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

items.applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

items.applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
items.applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

items.applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

items.applied_discounts.created_atstring

Time when the Discount was created.

items.applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
items.applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
items.applied_discounts.idstring

ID of the Discount object.

items.applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

items.applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
items.applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

items.applied_discounts.updated_atstring

Time when the Discount was updated.

items.applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

items.applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

items.applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

items.applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

items.applied_discounts.duration.periodinteger

The number of period units.

items.applied_discounts.duration.period_unitstring

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

items.applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

items.applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

items.applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

items.automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

items.billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

items.created_atstring

Time when this invoice was created.

items.currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

items.enable_automatic_taxboolean

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

items.idstring

ID of the Invoice object.

items.paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

items.payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

items.statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

items.total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

items.total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

items.total_discount_amounts.amountnumber

The amount of the applied discount.

items.total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

items.total_tax_amountnumber

The aggregate amounts calculated for all line items.

items.updated_atstring

Time when this invoice was last updated.

items.bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

items.bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

items.bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

items.bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
items.bank_transfer_instructions.account_numberstring

Bank account number.

items.bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

items.bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

items.bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

items.bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

items.bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
items.bank_transfer_instructions.ibanstring

IBAN number.

items.bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

items.bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

items.bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

items.bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

items.bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

items.bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

items.bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

items.bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

items.bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

items.bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

items.bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

items.bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

items.collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

items.credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

items.credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

items.days_until_dueinteger

Number of days from invoice finalization until payment is due.

items.default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

items.due_atstring

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

items.finalized_atstring

The time that the invoice draft was finalized.

items.footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

items.hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

items.last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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

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

String used to describe the object. Referenced as memo or invoice note in Webapp.

items.metadataobject

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

items.next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

items.numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

items.paid_atstring

The time that the invoice was paid.

items.past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

items.payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

items.payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

items.pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

items.remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

items.subscription_idstring

ID of the Subscription that generated this invoice, if any.

items.voided_atstring

The time that the invoice was voided.

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/invoices
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "items": [
3 {
4 "amount_due": 100,
5 "applied_discounts": [
6 {
7 "amount_off": 10,
8 "applied_to": "SUBSCRIPTION",
9 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
10 "billing_customer_id": "bcus_7fz9qm2n4k",
11 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
12 "currency": "USD",
13 "discount_model": "PERCENTAGE",
14 "duration": {
15 "period": 3,
16 "period_unit": "MONTH"
17 },
18 "duration_type": "CUSTOM",
19 "ends_at": "2027-01-01T00:00:00+0000",
20 "id": "disc_hkpdkcmxdgazzq53jbk",
21 "name": "Black Friday 20% Off",
22 "percentage_off": 20,
23 "source": "COUPON",
24 "source_id": "coup_hkpdkcmxdgazzq53jbk",
25 "starts_at": "2026-01-01T00:00:00+0000"
26 }
27 ],
28 "automatic_tax_status": "APPLIED",
29 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
30 "collection_method": "AUTO_CHARGE",
31 "created_at": "2022-01-01T10:15:30+0000",
32 "credit_note_amount_after_payment": 10,
33 "credit_note_amount_before_payment": 10,
34 "currency": "USD",
35 "days_until_due": 1,
36 "default_tax_percent": 10,
37 "due_at": "2022-12-05T10:15:30+0000",
38 "enable_automatic_tax": true,
39 "finalized_at": "2022-12-05T10:15:30+0000",
40 "hosted_url": "https://invoice.airwallex.com/billing/invoices/payment?s=jwt_token",
41 "id": "inv_hkpd49cskgblns6iimw",
42 "last_payment_attempt_at": "2022-12-05T10:15:30+0000",
43 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
44 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
45 "memo": "Invoice memo.",
46 "metadata": {
47 "foo": "bar"
48 },
49 "next_payment_attempt_at": "2022-12-05T10:15:30+0000",
50 "number": "INV-YOLI0II9-0685",
51 "paid_at": "2022-12-05T10:15:30+0000",
52 "paid_out_of_band": false,
53 "past_payment_attempt_count": 1,
54 "payment_options": {
55 "payment_method_save": {
56 "mode": "ENABLED",
57 "next_triggered_by": "MERCHANT"
58 },
59 "payment_method_types": [
60 "card",
61 "googlepay",
62 "applepay"
63 ]
64 },
65 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
66 "payment_status": "UNPAID",
67 "pdf_url": "https://invoice.airwallex.com/billing/invoices/pdf?s=jwt_token",
68 "remaining_payment_attempt_count": 1,
69 "status": "FINALIZED",
70 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
71 "total_amount": 100,
72 "total_discount_amounts": [
73 {
74 "amount": 10,
75 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
76 }
77 ],
78 "total_tax_amount": 0,
79 "updated_at": "2022-01-01T10:15:30+0000",
80 "voided_at": "2022-12-05T10:15:30+0000"
81 }
82 ],
83 "page_after": "<string>",
84 "page_before": "<string>"
85}
Was this section helpful?

Finalize an invoice

POST /api/v1/billing/invoices/{id}/finalize

Finalizes a draft invoice.

Parameters
idrequiredstring

ID of the Invoice object.

Response body - 200 OK
amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
bank_transfer_instructions.account_numberstring

Bank account number.

bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
bank_transfer_instructions.ibanstring

IBAN number.

bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

created_atstring

Time when this invoice was created.

credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

due_atstring

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

enable_automatic_taxboolean

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

finalized_atstring

The time that the invoice draft was finalized.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

idstring

ID of the Invoice object.

last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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.

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.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

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

next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

paid_atstring

The time that the invoice was paid.

paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription that generated this invoice, if any.

total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

total_tax_amountnumber

The aggregate amounts calculated for all line items.

updated_atstring

Time when this invoice was last updated.

voided_atstring

The time that the invoice was voided.

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/invoices/{id}/finalize
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id/finalize' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "amount_due": 100,
3 "applied_discounts": [
4 {
5 "amount_off": 10,
6 "applied_to": "SUBSCRIPTION",
7 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
8 "billing_customer_id": "bcus_7fz9qm2n4k",
9 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
10 "currency": "USD",
11 "discount_model": "PERCENTAGE",
12 "duration": {
13 "period": 3,
14 "period_unit": "MONTH"
15 },
16 "duration_type": "CUSTOM",
17 "ends_at": "2027-01-01T00:00:00+0000",
18 "id": "disc_hkpdkcmxdgazzq53jbk",
19 "name": "Black Friday 20% Off",
20 "percentage_off": 20,
21 "source": "COUPON",
22 "source_id": "coup_hkpdkcmxdgazzq53jbk",
23 "starts_at": "2026-01-01T00:00:00+0000"
24 }
25 ],
26 "automatic_tax_status": "APPLIED",
27 "bank_transfer_instructions": {
28 "currency": "USD",
29 "account_name": "Tromp, Littel and Luettgen",
30 "account_number": "8453687204",
31 "bank_name": "Community Federal Savings Bank",
32 "routing_number": "026073150",
33 "reference": "QCNLQC"
34 },
35 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
36 "collection_method": "AUTO_CHARGE",
37 "created_at": "2022-01-01T10:15:30+0000",
38 "credit_note_amount_after_payment": 10,
39 "credit_note_amount_before_payment": 10,
40 "currency": "USD",
41 "days_until_due": 1,
42 "default_tax_percent": 10,
43 "due_at": "2022-12-05T10:15:30+0000",
44 "enable_automatic_tax": true,
45 "finalized_at": "2022-12-05T10:15:30+0000",
46 "footer": "Please include the reference number in your payment reference.\nFor remittance advice, contact [email protected].",
47 "hosted_url": "https://invoice.airwallex.com/billing/invoices/payment?s=jwt_token",
48 "id": "inv_hkpd49cskgblns6iimw",
49 "last_payment_attempt_at": "2022-12-05T10:15:30+0000",
50 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
51 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
52 "memo": "Invoice memo.",
53 "metadata": {
54 "foo": "bar"
55 },
56 "next_payment_attempt_at": "2022-12-05T10:15:30+0000",
57 "number": "INV-YOLI0II9-0685",
58 "paid_at": "2022-12-05T10:15:30+0000",
59 "paid_out_of_band": false,
60 "past_payment_attempt_count": 1,
61 "payment_options": {
62 "payment_method_save": {
63 "mode": "ENABLED",
64 "next_triggered_by": "MERCHANT"
65 },
66 "payment_method_types": [
67 "card",
68 "googlepay",
69 "applepay"
70 ]
71 },
72 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
73 "payment_status": "UNPAID",
74 "pdf_url": "https://invoice.airwallex.com/billing/invoices/pdf?s=jwt_token",
75 "remaining_payment_attempt_count": 1,
76 "status": "FINALIZED",
77 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
78 "total_amount": 100,
79 "total_discount_amounts": [
80 {
81 "amount": 10,
82 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
83 }
84 ],
85 "total_tax_amount": 0,
86 "updated_at": "2022-01-01T10:15:30+0000",
87 "voided_at": "2022-12-05T10:15:30+0000"
88}
Was this section helpful?

Mark an invoice as paid

POST /api/v1/billing/invoices/{id}/mark_as_paid

Mark a finalized Invoice that has already been paid out-of-band.

Parameters
idrequiredstring

ID of the Invoice object.

Response body - 200 OK
amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
bank_transfer_instructions.account_numberstring

Bank account number.

bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
bank_transfer_instructions.ibanstring

IBAN number.

bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

created_atstring

Time when this invoice was created.

credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

due_atstring

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

enable_automatic_taxboolean

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

finalized_atstring

The time that the invoice draft was finalized.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

idstring

ID of the Invoice object.

last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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.

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.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

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

next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

paid_atstring

The time that the invoice was paid.

paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription that generated this invoice, if any.

total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

total_tax_amountnumber

The aggregate amounts calculated for all line items.

updated_atstring

Time when this invoice was last updated.

voided_atstring

The time that the invoice was voided.

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/invoices/{id}/mark_as_paid
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id/mark_as_paid' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "amount_due": 100,
3 "applied_discounts": [
4 {
5 "amount_off": 10,
6 "applied_to": "SUBSCRIPTION",
7 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
8 "billing_customer_id": "bcus_7fz9qm2n4k",
9 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
10 "currency": "USD",
11 "discount_model": "PERCENTAGE",
12 "duration": {
13 "period": 3,
14 "period_unit": "MONTH"
15 },
16 "duration_type": "CUSTOM",
17 "ends_at": "2027-01-01T00:00:00+0000",
18 "id": "disc_hkpdkcmxdgazzq53jbk",
19 "name": "Black Friday 20% Off",
20 "percentage_off": 20,
21 "source": "COUPON",
22 "source_id": "coup_hkpdkcmxdgazzq53jbk",
23 "starts_at": "2026-01-01T00:00:00+0000"
24 }
25 ],
26 "automatic_tax_status": "APPLIED",
27 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
28 "collection_method": "AUTO_CHARGE",
29 "created_at": "2022-01-01T10:15:30+0000",
30 "credit_note_amount_after_payment": 10,
31 "credit_note_amount_before_payment": 10,
32 "currency": "USD",
33 "days_until_due": 1,
34 "default_tax_percent": 10,
35 "due_at": "2022-12-05T10:15:30+0000",
36 "enable_automatic_tax": true,
37 "finalized_at": "2022-12-05T10:15:30+0000",
38 "hosted_url": "https://invoice.airwallex.com/billing/invoices/payment?s=jwt_token",
39 "id": "inv_hkpd49cskgblns6iimw",
40 "last_payment_attempt_at": "2022-12-05T10:15:30+0000",
41 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
42 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
43 "memo": "Invoice memo.",
44 "metadata": {
45 "foo": "bar"
46 },
47 "next_payment_attempt_at": "2022-12-05T10:15:30+0000",
48 "number": "INV-YOLI0II9-0685",
49 "paid_at": "2022-12-05T10:15:30+0000",
50 "paid_out_of_band": false,
51 "past_payment_attempt_count": 1,
52 "payment_options": {
53 "payment_method_save": {
54 "mode": "ENABLED",
55 "next_triggered_by": "MERCHANT"
56 },
57 "payment_method_types": [
58 "card",
59 "googlepay",
60 "applepay"
61 ]
62 },
63 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
64 "payment_status": "UNPAID",
65 "pdf_url": "https://invoice.airwallex.com/billing/invoices/pdf?s=jwt_token",
66 "remaining_payment_attempt_count": 1,
67 "status": "FINALIZED",
68 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
69 "total_amount": 100,
70 "total_discount_amounts": [
71 {
72 "amount": 10,
73 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
74 }
75 ],
76 "total_tax_amount": 0,
77 "updated_at": "2022-01-01T10:15:30+0000",
78 "voided_at": "2022-12-05T10:15:30+0000"
79}
Was this section helpful?

Void an invoice

POST /api/v1/billing/invoices/{id}/void

Void a finalized Invoice.

Parameters
idrequiredstring

ID of the Invoice object.

Response body - 200 OK
amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
bank_transfer_instructions.account_numberstring

Bank account number.

bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
bank_transfer_instructions.ibanstring

IBAN number.

bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

created_atstring

Time when this invoice was created.

credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

due_atstring

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

enable_automatic_taxboolean

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

finalized_atstring

The time that the invoice draft was finalized.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

idstring

ID of the Invoice object.

last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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.

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.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

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

next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

paid_atstring

The time that the invoice was paid.

paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription that generated this invoice, if any.

total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

total_tax_amountnumber

The aggregate amounts calculated for all line items.

updated_atstring

Time when this invoice was last updated.

voided_atstring

The time that the invoice was voided.

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/invoices/{id}/void
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id/void' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "amount_due": 100,
3 "applied_discounts": [
4 {
5 "amount_off": 10,
6 "applied_to": "SUBSCRIPTION",
7 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
8 "billing_customer_id": "bcus_7fz9qm2n4k",
9 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
10 "currency": "USD",
11 "discount_model": "PERCENTAGE",
12 "duration": {
13 "period": 3,
14 "period_unit": "MONTH"
15 },
16 "duration_type": "CUSTOM",
17 "ends_at": "2027-01-01T00:00:00+0000",
18 "id": "disc_hkpdkcmxdgazzq53jbk",
19 "name": "Black Friday 20% Off",
20 "percentage_off": 20,
21 "source": "COUPON",
22 "source_id": "coup_hkpdkcmxdgazzq53jbk",
23 "starts_at": "2026-01-01T00:00:00+0000"
24 }
25 ],
26 "automatic_tax_status": "APPLIED",
27 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
28 "collection_method": "AUTO_CHARGE",
29 "created_at": "2022-01-01T10:15:30+0000",
30 "credit_note_amount_after_payment": 10,
31 "credit_note_amount_before_payment": 10,
32 "currency": "USD",
33 "days_until_due": 1,
34 "default_tax_percent": 10,
35 "due_at": "2022-12-05T10:15:30+0000",
36 "enable_automatic_tax": true,
37 "finalized_at": "2022-12-05T10:15:30+0000",
38 "hosted_url": "https://invoice.airwallex.com/billing/invoices/payment?s=jwt_token",
39 "id": "inv_hkpd49cskgblns6iimw",
40 "last_payment_attempt_at": "2022-12-05T10:15:30+0000",
41 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
42 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
43 "memo": "Invoice memo.",
44 "metadata": {
45 "foo": "bar"
46 },
47 "next_payment_attempt_at": "2022-12-05T10:15:30+0000",
48 "number": "INV-YOLI0II9-0685",
49 "paid_at": "2022-12-05T10:15:30+0000",
50 "paid_out_of_band": false,
51 "past_payment_attempt_count": 1,
52 "payment_options": {
53 "payment_method_save": {
54 "mode": "ENABLED",
55 "next_triggered_by": "MERCHANT"
56 },
57 "payment_method_types": [
58 "card",
59 "googlepay",
60 "applepay"
61 ]
62 },
63 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
64 "payment_status": "UNPAID",
65 "pdf_url": "https://invoice.airwallex.com/billing/invoices/pdf?s=jwt_token",
66 "remaining_payment_attempt_count": 1,
67 "status": "FINALIZED",
68 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
69 "total_amount": 100,
70 "total_discount_amounts": [
71 {
72 "amount": 10,
73 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
74 }
75 ],
76 "total_tax_amount": 0,
77 "updated_at": "2022-01-01T10:15:30+0000",
78 "voided_at": "2022-12-05T10:15:30+0000"
79}
Was this section helpful?

Pay an Invoice

POST /api/v1/billing/invoices/{id}/pay

Pay a finalized AUTO_CHARGE Invoice using an existing Payment Source.

Parameters
idrequiredstring

Unique identifier of the Invoice object.

Request body
payment_source_idrequiredstring

ID of an existing Payment Source that belongs to the customer and will be used to pay the Invoice. This is a one-time payment instruction and does not change the Payment Source saved on the Subscription.

The Payment Source's linked_payment_account_id must match the Invoice's linked_payment_account_id.

Response body - 200 OK
amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
bank_transfer_instructions.account_numberstring

Bank account number.

bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
bank_transfer_instructions.ibanstring

IBAN number.

bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

created_atstring

Time when this invoice was created.

credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

due_atstring

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

enable_automatic_taxboolean

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

finalized_atstring

The time that the invoice draft was finalized.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

idstring

ID of the Invoice object.

last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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.

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.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

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

next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

paid_atstring

The time that the invoice was paid.

paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription that generated this invoice, if any.

total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

total_tax_amountnumber

The aggregate amounts calculated for all line items.

updated_atstring

Time when this invoice was last updated.

voided_atstring

The time that the invoice was voided.

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/invoices/{id}/pay
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/inv_hkpd49cskgblns6iimw/pay' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "payment_source_id": "psrc_d3Ds20ae5VihKs092"
>}'
Response (200 OK)
1{
2 "amount_due": 0,
3 "applied_discounts": [],
4 "automatic_tax_status": "DISABLED",
5 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
6 "created_at": "2022-01-01T10:15:30+0000",
7 "currency": "USD",
8 "enable_automatic_tax": false,
9 "id": "inv_hkpd49cskgblns6iimw",
10 "paid_out_of_band": false,
11 "payment_status": "PAID",
12 "status": "FINALIZED",
13 "total_amount": 100,
14 "total_discount_amounts": [],
15 "total_tax_amount": 0,
16 "updated_at": "2022-12-05T10:15:30+0000"
17}
Was this section helpful?

Create invoice line items and add them to an invoice

POST /api/v1/billing/invoices/{id}/add_line_items

This is only possible when the status of an Invoice is in DRAFT. You can add up to 100 line items at a time. This bulk operation is atomic.

Parameters
idrequiredstring

ID of the Invoice object that this Invoice Line Item belongs to.

Request body
line_itemsrequiredarray

List of Invoice Line Item to be created.

line_items.descriptionstring

Description of the Invoice Line Item.

line_items.discountsarray

A list of discounts to be applied to the invoice line item. Discounts of invoice line items are applied before 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.metadataobject

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

line_items.priceobject

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

line_items.price.pricing_modelrequiredstring

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.
line_items.price.descriptionstring

Price description.

line_items.price.flat_amountnumber

The fixed amount to be charged. Only required when the pricing model is FLAT.

line_items.price.productobject

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

line_items.price.product.namerequiredstring

Product name.

line_items.price.product.descriptionstring

Product description. Used for internal classification and identification.

line_items.price.product.metadataobject

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

line_items.price.product.tax_codestring

The tax category of the product.

line_items.price.product.unitstring

Product unit.

line_items.price.product_idstring

ID of the Product object this price is associated with. 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 or price_id is required.

line_items.quantityinteger

The product quantity.

line_items.tax_percentnumber

The effective tax percent of this subscription item.

request_idrequiredstring

Unique request ID specified by the merchant.

Response body - 200 OK
amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
bank_transfer_instructions.account_numberstring

Bank account number.

bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
bank_transfer_instructions.ibanstring

IBAN number.

bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

created_atstring

Time when this invoice was created.

credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

due_atstring

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

enable_automatic_taxboolean

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

finalized_atstring

The time that the invoice draft was finalized.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

idstring

ID of the Invoice object.

last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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.

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.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

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

next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

paid_atstring

The time that the invoice was paid.

paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription that generated this invoice, if any.

total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

total_tax_amountnumber

The aggregate amounts calculated for all line items.

updated_atstring

Time when this invoice was last updated.

voided_atstring

The time that the invoice was voided.

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/invoices/{id}/add_line_items
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id/add_line_items' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "line_items": [
> {
> "description": "Description of the Invoice Line Item.",
> "discounts": [
> {
> "coupon": {
> "id": "coup_abc123"
> },
> "type": "COUPON"
> }
> ],
> "metadata": {
> "foo": "bar"
> },
> "price": {
> "description": "Standard option: $10 / month.",
> "pricing_model": "FLAT",
> "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
> }
> ],
> "request_id": "ee939540-3203-4a2c-9172-89a566485dd9"
>}'
Response (200 OK)
1{
2 "amount_due": 100,
3 "applied_discounts": [
4 {
5 "amount_off": 10,
6 "applied_to": "SUBSCRIPTION",
7 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
8 "billing_customer_id": "bcus_7fz9qm2n4k",
9 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
10 "currency": "USD",
11 "discount_model": "PERCENTAGE",
12 "duration": {
13 "period": 3,
14 "period_unit": "MONTH"
15 },
16 "duration_type": "CUSTOM",
17 "ends_at": "2027-01-01T00:00:00+0000",
18 "id": "disc_hkpdkcmxdgazzq53jbk",
19 "name": "Black Friday 20% Off",
20 "percentage_off": 20,
21 "source": "COUPON",
22 "source_id": "coup_hkpdkcmxdgazzq53jbk",
23 "starts_at": "2026-01-01T00:00:00+0000"
24 }
25 ],
26 "automatic_tax_status": "APPLIED",
27 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
28 "collection_method": "AUTO_CHARGE",
29 "created_at": "2022-01-01T10:15:30+0000",
30 "credit_note_amount_after_payment": 10,
31 "credit_note_amount_before_payment": 10,
32 "currency": "USD",
33 "days_until_due": 1,
34 "default_tax_percent": 10,
35 "due_at": "2022-12-05T10:15:30+0000",
36 "enable_automatic_tax": true,
37 "finalized_at": "2022-12-05T10:15:30+0000",
38 "hosted_url": "https://invoice.airwallex.com/billing/invoices/payment?s=jwt_token",
39 "id": "inv_hkpd49cskgblns6iimw",
40 "last_payment_attempt_at": "2022-12-05T10:15:30+0000",
41 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
42 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
43 "memo": "Invoice memo.",
44 "metadata": {
45 "foo": "bar"
46 },
47 "next_payment_attempt_at": "2022-12-05T10:15:30+0000",
48 "number": "INV-YOLI0II9-0685",
49 "paid_at": "2022-12-05T10:15:30+0000",
50 "paid_out_of_band": false,
51 "past_payment_attempt_count": 1,
52 "payment_options": {
53 "payment_method_save": {
54 "mode": "ENABLED",
55 "next_triggered_by": "MERCHANT"
56 },
57 "payment_method_types": [
58 "card",
59 "googlepay",
60 "applepay"
61 ]
62 },
63 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
64 "payment_status": "UNPAID",
65 "pdf_url": "https://invoice.airwallex.com/billing/invoices/pdf?s=jwt_token",
66 "remaining_payment_attempt_count": 1,
67 "status": "FINALIZED",
68 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
69 "total_amount": 100,
70 "total_discount_amounts": [
71 {
72 "amount": 10,
73 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
74 }
75 ],
76 "total_tax_amount": 0,
77 "updated_at": "2022-01-01T10:15:30+0000",
78 "voided_at": "2022-12-05T10:15:30+0000"
79}
Was this section helpful?

Retrieve an invoice line item

GET /api/v1/billing/invoices/{id}/line_items/{item_id}

Retrieves the details of a line item on an Invoice.

Parameters
idrequiredstring

ID of the invoice object that this Invoice Line Item belongs to.

item_idrequiredstring

ID of the Invoice Line Item object.

Response body - 200 OK
amountnumber

The amount of the Invoice Line Item.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

created_atstring

Time when the price was created.

currencystring

The currency of the Invoice Line Item in 3-letter ISO-4217 format.

descriptionstring

Description of the Invoice Line Item.

discount_amountsarray

The amount of discount calculated per discount for this line item. The Discount applied to the invoice will be apportioned to the DiscountAmountResponses of each invoice line item

discount_amounts.amountnumber

The amount of the applied discount.

discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

idstring

ID of the Invoice Line Item object.

invoice_idstring

ID of the Invoice object that this Invoice Line Item belongs to.

labelstring

String to describe what this line item charges for.

metadataobject

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

period_ends_atstring

The end of the billing period associated with this Invoice Line Item. This value is exclusive.

period_starts_atstring

The start of the billing period associated with this Invoice Line Item. This value is inclusive.

priceobject

Price subscribed by the customer.

price.activeboolean

true if the price is available for new purchases, false otherwise.

price.created_atstring

Time when the price was created.

price.currencystring

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

price.idstring

ID of the Price object.

price.meteredboolean

Specify how to determine the quantity of the product used in each billing cycle for subscription payments. true if the quantity is dynamically determined during the billing cycle. The merchant should call the Ingest Usage Events API to submit usage data when the product is used. false if the quantity is determined when creating a subscription.

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.
  • VOLUME: the unit price is based on which tier the total quantity falls in.
  • GRADUATED: the unit price changes as the quantity increases.
price.productobject

Details of the Product object this price is associated with.

price.product.activeboolean

true if the product is available for new purchases, false otherwise.

price.product.created_atstring

Time when this product was created.

price.product.idstring

ID of the Product object.

price.product.namestring

Product name.

price.product.unitstring

Product unit.

price.product.updated_atstring

Time when this product was last updated.

price.product.descriptionstring

Product description.

price.product.metadataobject

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

price.product.tax_codestring

The tax category of the product.

price.product_idstring

ID of the Product object this price is associated with.

price.tax_includedboolean

Whether the price includes tax.

price.typestring

One of ONE_OFF or RECURRING depending on whether the price is for a one-off purchase or a recurring (subscription) purchase.

price.updated_atstring

Time when the price was last updated.

price.billing_typestring

Indicates when should the price be billed, one of

  • IN_ADVANCE: billed at the beginning of the billing cycle.
  • IN_ARREARS: billed at the end of the billing cycle.
price.descriptionstring

Price description.

price.flat_amountnumber

The fixed amount to be charged. Only required when the pricing model is FLAT.

price.lotobject

Defines how quantity is grouped into billable lots. The unit_amount is then applied per lot. If not set, quantity is treated as the number of billable lots. Only applicable for PER_UNIT price.

price.lot.rounding_modestring

Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.

price.lot.sizeinteger

The amount of quantity that constitutes a single billable lot.

price.metadataobject

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

price.meter_idstring

ID of the Meter object specifying how to calculate the usage for this price.

price.recurringobject

The frequency at which the price is charged. null for one-time charge.

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

price.recurring.period_unitstring

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

price.tiersarray

List of quantity-based pricing tiers for this price. Required when the pricing model is VOLUME or GRADUATED.

price.tiers.flat_amountnumber

The flat amount to be charged for this tier when pricing model is GRADUATED, or the overall flat amount to be charged when pricing model is VOLUME.

price.tiers.lotobject

Defines how quantity is grouped into billable lots. The unit_amount is then applied per lot. If not set, quantity is treated as the number of billable lots. Only applicable for VOLUME and GRADUATED prices.

price.tiers.lot.rounding_modestring

Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.

price.tiers.lot.sizeinteger

The amount of quantity that constitutes a single billable lot.

price.tiers.unit_amountnumber

The per-unit amount to be charged for this tier when pricing model is GRADUATED, or the overall per-unit amount to be charged when pricing model is VOLUME.

price.tiers.unit_descriptionstring

Description of the billable unit for the tier.

price.tiers.upper_boundnumber

The upper quantity limit of this tier. This tier is applicable when the quantity does not exceed the upper bound of this tier, and is greater than the upper bound of the tier below it(or 0 if this is the first tier). For the last tier, the upper bound must be left empty.

price.unit_amountnumber

The amount to be charged per product unit. Only required when the pricing model is PER_UNIT.

price.unit_descriptionstring

Description of the billable unit for the price.

quantityinteger

The product quantity.

remaining_creditable_amountnumber

The total amount currently available to be credited for this invoice line item, excluding tax and discount.

tax_amountnumber

The tax amount for this line item.

tax_breakdownarray

The tax breakdown details the exact taxes that apply to this line item.

tax_breakdown.namestring

The display name of this tax component.

tax_breakdown.tax_amountnumber

The amount of tax charged for this component.

tax_breakdown.tax_percentnumber

The tax percent applied for this component.

tax_breakdown.taxable_amountnumber

The portion of the subtotal that this tax component applies to.

tax_percentnumber

The effective tax percent of this invoice line item.

updated_atstring

Time when the price was last updated.

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/invoices/{id}/line_items/{item_id}
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id/line_items/item_id' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "amount": 2,
3 "applied_discounts": [
4 {
5 "amount_off": 10,
6 "applied_to": "SUBSCRIPTION",
7 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
8 "billing_customer_id": "bcus_7fz9qm2n4k",
9 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
10 "currency": "USD",
11 "discount_model": "PERCENTAGE",
12 "duration": {
13 "period": 3,
14 "period_unit": "MONTH"
15 },
16 "duration_type": "CUSTOM",
17 "ends_at": "2027-01-01T00:00:00+0000",
18 "id": "disc_hkpdkcmxdgazzq53jbk",
19 "name": "Black Friday 20% Off",
20 "percentage_off": 20,
21 "source": "COUPON",
22 "source_id": "coup_hkpdkcmxdgazzq53jbk",
23 "starts_at": "2026-01-01T00:00:00+0000"
24 }
25 ],
26 "created_at": "2022-01-01T10:15:30+0000",
27 "currency": "USD",
28 "description": "This is a description.",
29 "discount_amounts": [
30 {
31 "amount": 10,
32 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
33 }
34 ],
35 "id": "iit_hkpd49cskgblnsnzgm1",
36 "invoice_id": "inv_hkpd49cskgblns6iimw",
37 "label": "Tier 0 (First 10) - Per unit fee",
38 "metadata": {
39 "foo": "bar"
40 },
41 "period_ends_at": "2022-01-05T10:15:30+0000",
42 "period_starts_at": "2022-01-01T10:15:30+0000",
43 "price": {
44 "active": true,
45 "billing_type": "IN_ADVANCE",
46 "created_at": "2022-01-01T10:15:30+0000",
47 "currency": "USD",
48 "description": "Standard option: $10 / month.",
49 "flat_amount": 0,
50 "id": "pri_hkpd7fedfgb004apkvs",
51 "lot": {
52 "rounding_mode": "UP",
53 "size": 10
54 },
55 "metadata": {
56 "foo": "bar"
57 },
58 "meter_id": "<string>",
59 "metered": false,
60 "pricing_model": "GRADUATED",
61 "product": {
62 "active": true,
63 "created_at": "2022-01-01T10:15:30+0000",
64 "description": "The license to use software in one month.",
65 "id": "prd_hkpd1x2gbgazzvcd42w",
66 "metadata": {
67 "foo": "bar"
68 },
69 "name": "Software License",
70 "tax_code": "pct_0504010000",
71 "unit": "month",
72 "updated_at": "2022-01-01T10:15:30+0000"
73 },
74 "product_id": "prd_hkpd1x2gbgazzvcd42w",
75 "recurring": {
76 "period": 1,
77 "period_unit": "MONTH"
78 },
79 "tax_included": false,
80 "tiers": [
81 {
82 "unit_amount": 10,
83 "upper_bound": 20
84 },
85 {
86 "flat_amount": 20
87 }
88 ],
89 "type": "RECURRING",
90 "unit_amount": 0,
91 "unit_description": "<string>",
92 "updated_at": "2022-01-01T10:15:30+0000"
93 },
94 "quantity": 1,
95 "remaining_creditable_amount": 100,
96 "tax_amount": 1.5,
97 "tax_breakdown": [
98 {
99 "name": "GST",
100 "tax_amount": 10,
101 "tax_percent": 10,
102 "taxable_amount": 100
103 }
104 ],
105 "tax_percent": 7.5,
106 "updated_at": "2022-01-01T10:15:30+0000"
107}
Was this section helpful?

Get list of invoice line items

GET /api/v1/billing/invoices/{id}/line_items

Retrieves a list of Invoice Line Items based on the query parameters.

Parameters
idrequiredstring

ID of the Invoice object that the Invoice Line Items belong to.

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

Response body - 200 OK
itemsarray

Paged results.

items.amountnumber

The amount of the Invoice Line Item.

items.applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

items.applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
items.applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

items.applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

items.applied_discounts.created_atstring

Time when the Discount was created.

items.applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
items.applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
items.applied_discounts.idstring

ID of the Discount object.

items.applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

items.applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
items.applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

items.applied_discounts.updated_atstring

Time when the Discount was updated.

items.applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

items.applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

items.applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

items.applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

items.applied_discounts.duration.periodinteger

The number of period units.

items.applied_discounts.duration.period_unitstring

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

items.applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

items.applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

items.applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

items.created_atstring

Time when the price was created.

items.currencystring

The currency of the Invoice Line Item in 3-letter ISO-4217 format.

items.discount_amountsarray

The amount of discount calculated per discount for this line item. The Discount applied to the invoice will be apportioned to the DiscountAmountResponses of each invoice line item

items.discount_amounts.amountnumber

The amount of the applied discount.

items.discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

items.idstring

ID of the Invoice Line Item object.

items.invoice_idstring

ID of the Invoice object that this Invoice Line Item belongs to.

items.priceobject

Price subscribed by the customer.

items.price.activeboolean

true if the price is available for new purchases, false otherwise.

items.price.created_atstring

Time when the price was created.

items.price.currencystring

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

items.price.idstring

ID of the Price object.

items.price.meteredboolean

Specify how to determine the quantity of the product used in each billing cycle for subscription payments. true if the quantity is dynamically determined during the billing cycle. The merchant should call the Ingest Usage Events API to submit usage data when the product is used. false if the quantity is determined when creating a subscription.

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.
  • VOLUME: the unit price is based on which tier the total quantity falls in.
  • GRADUATED: the unit price changes as the quantity increases.
items.price.productobject

Details of the Product object this price is associated with.

items.price.product.activeboolean

true if the product is available for new purchases, false otherwise.

items.price.product.created_atstring

Time when this product was created.

items.price.product.idstring

ID of the Product object.

items.price.product.namestring

Product name.

items.price.product.unitstring

Product unit.

items.price.product.updated_atstring

Time when this product was last updated.

items.price.product.descriptionstring

Product description.

items.price.product.metadataobject

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

items.price.product.tax_codestring

The tax category of the product.

items.price.product_idstring

ID of the Product object this price is associated with.

items.price.tax_includedboolean

Whether the price includes tax.

items.price.typestring

One of ONE_OFF or RECURRING depending on whether the price is for a one-off purchase or a recurring (subscription) purchase.

items.price.updated_atstring

Time when the price was last updated.

items.price.billing_typestring

Indicates when should the price be billed, one of

  • IN_ADVANCE: billed at the beginning of the billing cycle.
  • IN_ARREARS: billed at the end of the billing cycle.
items.price.descriptionstring

Price description.

items.price.flat_amountnumber

The fixed amount to be charged. Only required when the pricing model is FLAT.

items.price.lotobject

Defines how quantity is grouped into billable lots. The unit_amount is then applied per lot. If not set, quantity is treated as the number of billable lots. Only applicable for PER_UNIT price.

items.price.lot.rounding_modestring

Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.

items.price.lot.sizeinteger

The amount of quantity that constitutes a single billable lot.

items.price.metadataobject

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

items.price.meter_idstring

ID of the Meter object specifying how to calculate the usage for this price.

items.price.recurringobject

The frequency at which the price is charged. null for one-time charge.

items.price.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.price.recurring.period_unitstring

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

items.price.tiersarray

List of quantity-based pricing tiers for this price. Required when the pricing model is VOLUME or GRADUATED.

items.price.tiers.flat_amountnumber

The flat amount to be charged for this tier when pricing model is GRADUATED, or the overall flat amount to be charged when pricing model is VOLUME.

items.price.tiers.lotobject

Defines how quantity is grouped into billable lots. The unit_amount is then applied per lot. If not set, quantity is treated as the number of billable lots. Only applicable for VOLUME and GRADUATED prices.

items.price.tiers.lot.rounding_modestring

Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.

items.price.tiers.lot.sizeinteger

The amount of quantity that constitutes a single billable lot.

items.price.tiers.unit_amountnumber

The per-unit amount to be charged for this tier when pricing model is GRADUATED, or the overall per-unit amount to be charged when pricing model is VOLUME.

items.price.tiers.unit_descriptionstring

Description of the billable unit for the tier.

items.price.tiers.upper_boundnumber

The upper quantity limit of this tier. This tier is applicable when the quantity does not exceed the upper bound of this tier, and is greater than the upper bound of the tier below it(or 0 if this is the first tier). For the last tier, the upper bound must be left empty.

items.price.unit_amountnumber

The amount to be charged per product unit. Only required when the pricing model is PER_UNIT.

items.price.unit_descriptionstring

Description of the billable unit for the price.

items.updated_atstring

Time when the price was last updated.

items.descriptionstring

Description of the Invoice Line Item.

items.labelstring

String to describe what this line item charges for.

items.metadataobject

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

items.period_ends_atstring

The end of the billing period associated with this Invoice Line Item. This value is exclusive.

items.period_starts_atstring

The start of the billing period associated with this Invoice Line Item. This value is inclusive.

items.quantityinteger

The product quantity.

items.remaining_creditable_amountnumber

The total amount currently available to be credited for this invoice line item, excluding tax and discount.

items.tax_amountnumber

The tax amount for this line item.

items.tax_breakdownarray

The tax breakdown details the exact taxes that apply to this line item.

items.tax_breakdown.namestring

The display name of this tax component.

items.tax_breakdown.tax_amountnumber

The amount of tax charged for this component.

items.tax_breakdown.tax_percentnumber

The tax percent applied for this component.

items.tax_breakdown.taxable_amountnumber

The portion of the subtotal that this tax component applies to.

items.tax_percentnumber

The effective tax percent of this invoice line item.

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

404

Not Found. Possible error codes: resource_not_found

500

Server Error. Possible error codes: internal_error

GET /api/v1/billing/invoices/{id}/line_items
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id/line_items' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "items": [
3 {
4 "amount": 2,
5 "applied_discounts": [
6 {
7 "amount_off": 10,
8 "applied_to": "SUBSCRIPTION",
9 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
10 "billing_customer_id": "bcus_7fz9qm2n4k",
11 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
12 "currency": "USD",
13 "discount_model": "PERCENTAGE",
14 "duration": {
15 "period": 3,
16 "period_unit": "MONTH"
17 },
18 "duration_type": "CUSTOM",
19 "ends_at": "2027-01-01T00:00:00+0000",
20 "id": "disc_hkpdkcmxdgazzq53jbk",
21 "name": "Black Friday 20% Off",
22 "percentage_off": 20,
23 "source": "COUPON",
24 "source_id": "coup_hkpdkcmxdgazzq53jbk",
25 "starts_at": "2026-01-01T00:00:00+0000"
26 }
27 ],
28 "created_at": "2022-01-01T10:15:30+0000",
29 "currency": "USD",
30 "description": "This is a description.",
31 "discount_amounts": [
32 {
33 "amount": 10,
34 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
35 }
36 ],
37 "id": "iit_hkpd49cskgblnsnzgm1",
38 "invoice_id": "inv_hkpd49cskgblns6iimw",
39 "label": "Tier 0 (First 10) - Per unit fee",
40 "metadata": {
41 "foo": "bar"
42 },
43 "period_ends_at": "2022-01-05T10:15:30+0000",
44 "period_starts_at": "2022-01-01T10:15:30+0000",
45 "price": {
46 "active": true,
47 "billing_type": "IN_ADVANCE",
48 "created_at": "2022-01-01T10:15:30+0000",
49 "currency": "USD",
50 "description": "Standard option: $10 / month.",
51 "id": "pri_hkpd7fedfgb004apkvs",
52 "lot": {
53 "rounding_mode": "UP",
54 "size": 10
55 },
56 "metadata": {
57 "foo": "bar"
58 },
59 "metered": false,
60 "pricing_model": "GRADUATED",
61 "product": {
62 "active": true,
63 "created_at": "2022-01-01T10:15:30+0000",
64 "description": "The license to use software in one month.",
65 "id": "prd_hkpd1x2gbgazzvcd42w",
66 "metadata": {
67 "foo": "bar"
68 },
69 "name": "Software License",
70 "tax_code": "pct_0504010000",
71 "unit": "month",
72 "updated_at": "2022-01-01T10:15:30+0000"
73 },
74 "product_id": "prd_hkpd1x2gbgazzvcd42w",
75 "recurring": {
76 "period": 1,
77 "period_unit": "MONTH"
78 },
79 "tax_included": false,
80 "tiers": [
81 {
82 "unit_amount": 10,
83 "upper_bound": 20
84 },
85 {
86 "flat_amount": 20
87 }
88 ],
89 "type": "RECURRING",
90 "updated_at": "2022-01-01T10:15:30+0000"
91 },
92 "quantity": 1,
93 "remaining_creditable_amount": 100,
94 "tax_amount": 1.5,
95 "tax_breakdown": [
96 {
97 "name": "GST",
98 "tax_amount": 10,
99 "tax_percent": 10,
100 "taxable_amount": 100
101 }
102 ],
103 "tax_percent": 7.5,
104 "updated_at": "2022-01-01T10:15:30+0000"
105 }
106 ],
107 "page_after": "<string>",
108 "page_before": "<string>"
109}
Was this section helpful?

Update invoice line items in an invoice

POST /api/v1/billing/invoices/{id}/update_line_items

This is only possible when the status of an Invoice is in DRAFT. You can update up to 100 line items at a time. This bulk operation is atomic.

Parameters
idrequiredstring

ID of the Invoice object that this Invoice Line Item belongs to.

Request body
line_itemsrequiredarray

List of Invoice Line Item to be updated.

line_items.idrequiredstring

ID of the Invoice Line Item.

line_items.descriptionstring

Description of the Invoice Line Item.

line_items.discountsarray

Desired set of invoice line item level discounts. If provided, replaces all existing 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.typestring

Specifies how to obtain a new discount. One of: COUPON.

line_items.metadataobject

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

line_items.quantityinteger

The product quantity.

line_items.tax_percentnumber

The effective tax percent of this subscription item.

Response body - 200 OK
amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
bank_transfer_instructions.account_numberstring

Bank account number.

bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
bank_transfer_instructions.ibanstring

IBAN number.

bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

created_atstring

Time when this invoice was created.

credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

due_atstring

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

enable_automatic_taxboolean

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

finalized_atstring

The time that the invoice draft was finalized.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

idstring

ID of the Invoice object.

last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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.

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.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

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

next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

paid_atstring

The time that the invoice was paid.

paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription that generated this invoice, if any.

total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

total_tax_amountnumber

The aggregate amounts calculated for all line items.

updated_atstring

Time when this invoice was last updated.

voided_atstring

The time that the invoice was voided.

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/invoices/{id}/update_line_items
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id/update_line_items' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "line_items": [
> {
> "discounts": [
> {
> "coupon": {
> "id": "coup_abc123"
> },
> "type": "COUPON"
> }
> ],
> "id": "iit_sgstjv2p9h24g7trp1e",
> "metadata": {
> "foo": "bar"
> },
> "quantity": 1,
> "tax_percent": 5
> }
> ]
>}'
Response (200 OK)
1{
2 "amount_due": 100,
3 "applied_discounts": [
4 {
5 "amount_off": 10,
6 "applied_to": "SUBSCRIPTION",
7 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
8 "billing_customer_id": "bcus_7fz9qm2n4k",
9 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
10 "currency": "USD",
11 "discount_model": "PERCENTAGE",
12 "duration": {
13 "period": 3,
14 "period_unit": "MONTH"
15 },
16 "duration_type": "CUSTOM",
17 "ends_at": "2027-01-01T00:00:00+0000",
18 "id": "disc_hkpdkcmxdgazzq53jbk",
19 "name": "Black Friday 20% Off",
20 "percentage_off": 20,
21 "source": "COUPON",
22 "source_id": "coup_hkpdkcmxdgazzq53jbk",
23 "starts_at": "2026-01-01T00:00:00+0000"
24 }
25 ],
26 "automatic_tax_status": "APPLIED",
27 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
28 "collection_method": "AUTO_CHARGE",
29 "created_at": "2022-01-01T10:15:30+0000",
30 "credit_note_amount_after_payment": 10,
31 "credit_note_amount_before_payment": 10,
32 "currency": "USD",
33 "days_until_due": 1,
34 "default_tax_percent": 10,
35 "due_at": "2022-12-05T10:15:30+0000",
36 "enable_automatic_tax": true,
37 "finalized_at": "2022-12-05T10:15:30+0000",
38 "hosted_url": "https://invoice.airwallex.com/billing/invoices/payment?s=jwt_token",
39 "id": "inv_hkpd49cskgblns6iimw",
40 "last_payment_attempt_at": "2022-12-05T10:15:30+0000",
41 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
42 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
43 "memo": "Invoice memo.",
44 "metadata": {
45 "foo": "bar"
46 },
47 "next_payment_attempt_at": "2022-12-05T10:15:30+0000",
48 "number": "INV-YOLI0II9-0685",
49 "paid_at": "2022-12-05T10:15:30+0000",
50 "paid_out_of_band": false,
51 "past_payment_attempt_count": 1,
52 "payment_options": {
53 "payment_method_save": {
54 "mode": "ENABLED",
55 "next_triggered_by": "MERCHANT"
56 },
57 "payment_method_types": [
58 "card",
59 "googlepay",
60 "applepay"
61 ]
62 },
63 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
64 "payment_status": "UNPAID",
65 "pdf_url": "https://invoice.airwallex.com/billing/invoices/pdf?s=jwt_token",
66 "remaining_payment_attempt_count": 1,
67 "status": "FINALIZED",
68 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
69 "total_amount": 100,
70 "total_discount_amounts": [
71 {
72 "amount": 10,
73 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
74 }
75 ],
76 "total_tax_amount": 0,
77 "updated_at": "2022-01-01T10:15:30+0000",
78 "voided_at": "2022-12-05T10:15:30+0000"
79}
Was this section helpful?

Delete invoice line items within an invoice

POST /api/v1/billing/invoices/{id}/delete_line_items

This is only possible when the status of an Invoice is in DRAFT. You can delete up to 100 line items at a time. This bulk operation is atomic.

Parameters
idrequiredstring

ID of the Invoice object that this Invoice Line Item belongs to.

Request body
line_item_idsrequiredarray

List of Invoice Line Item IDs to be deleted.

Response body - 200 OK
amount_duenumber

The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.

applied_discountsarray

List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.

applied_discounts.applied_tostring

Specifies the type of object this discount applies to. Possible values:

  • SUBSCRIPTION: Applies to an entire subscription.
  • SUBSCRIPTION_ITEM: Applies to a specific item within a subscription.
  • INVOICE: Applies to an entire invoice.
  • INVOICE_LINE_ITEM: Applies to a specific line item on an invoice.
applied_discounts.applied_to_idstring

ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.

applied_discounts.billing_customer_idstring

The ID of the billing customer to whom the coupon is applied.

applied_discounts.created_atstring

Time when the Discount was created.

applied_discounts.discount_modelstring

Specified how to calculate the discount amount when applied, one of

  • FLAT: fixed amount off.
  • PERCENTAGE: percentage off.
applied_discounts.duration_typestring

Determines how long the coupon's discount remains active after being applied. Possible values:

  • ONCE: Applies only to the first charge of a subscription or a one-off invoice.
  • CUSTOM: Applies to all charges within a specified number of billing cycles, as defined by duration.
  • INDEFINITELY: Applies to all future charges for the subscription until it is removed.
applied_discounts.idstring

ID of the Discount object.

applied_discounts.namestring

Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.

applied_discounts.sourcestring

Source of the Discount. Possible values:

  • COUPON: the discount is applied through a coupon.
applied_discounts.starts_atstring

Time when the discount takes effect. For discounts applied to a subscription or subscription item, this corresponds to the start date of the first billing period.

applied_discounts.updated_atstring

Time when the Discount was updated.

applied_discounts.amount_offnumber

The fixed amount to deduct when discount_model is FLAT.

applied_discounts.checkout_idstring

The ID of the Checkout where this discount was redeemed, if applicable.

applied_discounts.currencystring

The currency of amount_off when discount_model is FLAT.

applied_discounts.durationobject

The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.

applied_discounts.duration.periodinteger

The number of period units.

applied_discounts.duration.period_unitstring

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

applied_discounts.ends_atstring

The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.

applied_discounts.percentage_offnumber

The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.

applied_discounts.source_idstring

ID of the creating source, e.g. is the ID of the coupon if source = COUPON.

automatic_tax_statusstring

The automatic tax status of this invoice.

APPLIED

The automatic tax is applied.

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.

DISABLED

The automatic tax is disabled.

bank_transfer_instructionsobject

Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.

bank_transfer_instructions.account_namestring

Name of the account holder receiving the transfer.

bank_transfer_instructions.currencystring

Currency of the receiving account (3-letter ISO-4217 code).

bank_transfer_instructions.account_categorystring

Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.

CHECKING
SAVINGS
BUSINESS
bank_transfer_instructions.account_numberstring

Bank account number.

bank_transfer_instructions.bank_codestring

Code identifying the bank. Applicable in markets including Singapore and Hong Kong.

bank_transfer_instructions.bank_namestring

Name of the financial institution in which the receiving account is domiciled.

bank_transfer_instructions.branch_codestring

Code identifying the bank branch. Used together with bank_code.

bank_transfer_instructions.bsb_numberstring

Bank State Branch (BSB) number. Applicable only to accounts in Australia.

bank_transfer_instructions.charge_typestring

Indicates who bears the bank charges on the transfer. Returned only for international (SWIFT) transfers. Omitted for local transfers. Possible value:

  • OUR: The payer covers all transfer charges so the full amount is received.
OUR
bank_transfer_instructions.ibanstring

IBAN number.

bank_transfer_instructions.institution_numberstring

Institution number identifying the bank. Applicable only to accounts in Canada.

bank_transfer_instructions.merchant_addressobject

The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.

bank_transfer_instructions.merchant_address.country_codestring

Two-letter ISO 3166-1 country code of the recipient's address.

bank_transfer_instructions.merchant_address.postcodestring

Postal or ZIP code of the recipient's address.

bank_transfer_instructions.merchant_address.statestring

State, province, or region of the recipient's address.

bank_transfer_instructions.merchant_address.street_addressarray

Street address of the recipient, given as one or more address lines.

bank_transfer_instructions.merchant_address.suburbstring

Suburb or city of the recipient's address.

bank_transfer_instructions.referencestring

Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.

bank_transfer_instructions.routing_numberstring

Bank routing number. Applicable only to accounts in the United States.

bank_transfer_instructions.sort_codestring

Bank sort code. Applicable only to accounts in the United Kingdom.

bank_transfer_instructions.swift_codestring

Bank SWIFT or BIC code.

bank_transfer_instructions.transit_numberstring

Bank transit number. Applicable only to accounts in Canada.

billing_customer_idstring

ID of the Billing Customer who this Invoice is issued to.

collection_methodstring

Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.

created_atstring

Time when this invoice was created.

credit_note_amount_after_paymentnumber

The total amount of all credit notes issued for this invoice after invoice payment.

credit_note_amount_before_paymentnumber

The total amount of all credit notes issued for this invoice before invoice payment.

currencystring

The currency of the Invoice in 3-letter ISO-4217 format.

days_until_dueinteger

Number of days from invoice finalization until payment is due.

default_tax_percentnumber

The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.

due_atstring

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

enable_automatic_taxboolean

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

finalized_atstring

The time that the invoice draft was finalized.

footerstring

Additional payment instructions or supplementary information that merchants can share with their customers. Displayed in the Invoice PDF.

hosted_urlstring

URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.

idstring

ID of the Invoice object.

last_payment_attempt_atstring

Time of last payment attempt. Only applicable when subscription_id is not null.

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.

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.

memostring

String used to describe the object. Referenced as memo or invoice note in Webapp.

metadataobject

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

next_payment_attempt_atstring

Time of next payment attempt. Only applicable when subscription_id is not null.

numberstring

A unique, identifying string that appears on emails sent to the customer for this invoice.

paid_atstring

The time that the invoice was paid.

paid_out_of_bandboolean

Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.

past_payment_attempt_countinteger

The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.

payment_optionsobject

Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.

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 digital invoice 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 digital invoice page and set their display order. Only methods supported for the specified currency and the customer's country code will appear on the digital invoice page.

payment_source_idstring

ID of the Payment Source to pay for the invoice.
If collection_method is CHARGE_ON_CHECKOUT, a Payment Source is automatically created during invoice payment when payment_options.payment_method_save.next_triggered_by is MERCHANT and payment_options.payment_method_save.mode is ENABLED, or when it is COLLECT_CONSENT and the customer has given consent.

payment_statusstring

Status of the payment for the invoice, one of UNPAID and PAID.

pdf_urlstring

The link to download the PDF for the invoice. The URL will be valid for 35 days. If the invoice has not been finalized yet, this will be null.

remaining_payment_attempt_countinteger

The number of the remaining payment attempts. If 0, no more payment attempts would be triggered automatically for this invoice. Only applicable when subscription_id is not null.

statusstring

Status of the invoice. Once the invoice is created, it will be defaulted to DRAFT, and once the invoice is finalized, it will turn to FINALIZED. When an invoice is voided, it will become VOIDED.

subscription_idstring

ID of the Subscription that generated this invoice, if any.

total_amountnumber

The total amount of the invoice, including tax and discount if applicable.

total_discount_amountsarray

The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.

total_discount_amounts.amountnumber

The amount of the applied discount.

total_discount_amounts.applied_discount_idstring

ID of the Discount object which is applied.

total_tax_amountnumber

The aggregate amounts calculated for all line items.

updated_atstring

Time when this invoice was last updated.

voided_atstring

The time that the invoice was voided.

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/invoices/{id}/delete_line_items
$curl --request POST \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices/invoice_id/delete_line_items' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "line_item_ids": [
> "iit_hkpd49cskgblnsnzgm1",
> "iit_cs8e0ZgQzd2QnCxVpzu"
> ]
>}'
Response (200 OK)
1{
2 "amount_due": 100,
3 "applied_discounts": [
4 {
5 "amount_off": 10,
6 "applied_to": "SUBSCRIPTION",
7 "applied_to_id": "sub_hkpdkcmxdgazzq53jbk",
8 "billing_customer_id": "bcus_7fz9qm2n4k",
9 "checkout_id": "bco_sgstcdcpnh8sv3awiwo",
10 "currency": "USD",
11 "discount_model": "PERCENTAGE",
12 "duration": {
13 "period": 3,
14 "period_unit": "MONTH"
15 },
16 "duration_type": "CUSTOM",
17 "ends_at": "2027-01-01T00:00:00+0000",
18 "id": "disc_hkpdkcmxdgazzq53jbk",
19 "name": "Black Friday 20% Off",
20 "percentage_off": 20,
21 "source": "COUPON",
22 "source_id": "coup_hkpdkcmxdgazzq53jbk",
23 "starts_at": "2026-01-01T00:00:00+0000"
24 }
25 ],
26 "automatic_tax_status": "APPLIED",
27 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
28 "collection_method": "AUTO_CHARGE",
29 "created_at": "2022-01-01T10:15:30+0000",
30 "credit_note_amount_after_payment": 10,
31 "credit_note_amount_before_payment": 10,
32 "currency": "USD",
33 "days_until_due": 1,
34 "default_tax_percent": 10,
35 "due_at": "2022-12-05T10:15:30+0000",
36 "enable_automatic_tax": true,
37 "finalized_at": "2022-12-05T10:15:30+0000",
38 "hosted_url": "https://invoice.airwallex.com/billing/invoices/payment?s=jwt_token",
39 "id": "inv_hkpd49cskgblns6iimw",
40 "last_payment_attempt_at": "2022-12-05T10:15:30+0000",
41 "legal_entity_id": "le_ib2DZgZJN72T7bObvNuMYQ",
42 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
43 "memo": "Invoice memo.",
44 "metadata": {
45 "foo": "bar"
46 },
47 "next_payment_attempt_at": "2022-12-05T10:15:30+0000",
48 "number": "INV-YOLI0II9-0685",
49 "paid_at": "2022-12-05T10:15:30+0000",
50 "paid_out_of_band": false,
51 "past_payment_attempt_count": 1,
52 "payment_options": {
53 "payment_method_save": {
54 "mode": "ENABLED",
55 "next_triggered_by": "MERCHANT"
56 },
57 "payment_method_types": [
58 "card",
59 "googlepay",
60 "applepay"
61 ]
62 },
63 "payment_source_id": "psrc_d3Ds20ae5VihKs092",
64 "payment_status": "UNPAID",
65 "pdf_url": "https://invoice.airwallex.com/billing/invoices/pdf?s=jwt_token",
66 "remaining_payment_attempt_count": 1,
67 "status": "FINALIZED",
68 "subscription_id": "sub_hkpdkcmxdgazzq53jbk",
69 "total_amount": 100,
70 "total_discount_amounts": [
71 {
72 "amount": 10,
73 "applied_discount_id": "disc_hkpdkcmxdgazzq53jbk"
74 }
75 ],
76 "total_tax_amount": 0,
77 "updated_at": "2022-01-01T10:15:30+0000",
78 "voided_at": "2022-12-05T10:15:30+0000"
79}
Was this section helpful?