Invoices
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).
POST /api/v1/billing/invoices/createPOST /api/v1/billing/invoices/previewPOST /api/v1/billing/invoices/{id}/updatePOST /api/v1/billing/invoices/{id}/deleteGET /api/v1/billing/invoices/{id}GET /api/v1/billing/invoicesPOST /api/v1/billing/invoices/{id}/finalizePOST /api/v1/billing/invoices/{id}/mark_as_paidPOST /api/v1/billing/invoices/{id}/voidPOST /api/v1/billing/invoices/{id}/payPOST /api/v1/billing/invoices/{id}/add_line_itemsGET /api/v1/billing/invoices/{id}/line_items/{item_id}GET /api/v1/billing/invoices/{id}/line_itemsPOST /api/v1/billing/invoices/{id}/update_line_itemsPOST /api/v1/billing/invoices/{id}/delete_line_items
Create an invoice
POST /api/v1/billing/invoices/create
Creates a one-off Invoice.
ID of the Billing Customer who will be charged.
The currency of the Invoice in 3-letter ISO-4217 format.
Unique request ID specified by the merchant.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Number of days from invoice finalization until payment is due. Only one of days_until_due and due_at should be passed.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive. Defaults to 0.
List of discounts to be applied to the invoice. Invoice line item discounts are applied before invoice discounts. Currently, only one element is supported.
Coupon to redeem into a discount for this resource. Only required when type = COUPON.
id of the Coupon object.
Specifies how to obtain the discount. One of: COUPON.
Due date set by the merchant for this invoice, if any. Only one of days_until_due and due_at should be passed.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically. Defaults to false.
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.
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.
String used for merchants to share a custom message to their customers. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Unique invoice number specified by the merchant. If omitted, Airwallex generates one automatically.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
ID of the Billing Customer who this Invoice is issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Time when this invoice was created.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
ID of the Invoice object.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
The time that the invoice was voided.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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">}'
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}
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).
ID of the Billing Customer who this Invoice is to be issued to.
A future timestamp in the first billing cycle as the reference point to align the future billing date.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive. Defaults to 0.
List of discounts to be applied to the invoice. Invoice line item discounts are applied before invoice discounts. Currently, only one element is supported.
Coupon to redeem into a discount for this resource. Only required when type = COUPON.
id of the Coupon object.
Specifies how to obtain the discount. One of: COUPON.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically. Defaults to false.
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.
List of Subscription Items to be used for generating the invoice.
ID of the Price subscribed by the customer. The Price's recurring values must match the recurring values set out in this subscription.
List of discounts to be applied to the invoice. Invoice line item discounts are applied before invoice discounts. Currently, only one element is supported.
Coupon to redeem into a discount for this resource. Only required when type = COUPON.
id of the Coupon object.
Specifies how to obtain the discount. One of: COUPON.
The product quantity. Defaults to 1.
The effective tax percent of this invoice line item.
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.
Time when the subscription started or scheduled to start. Defaults to start immediately after creation.
ID of the Subscription object.
The end time of the trial if applicable.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
ID of the Billing Customer who will be charged.
Time when this invoice will be created.
The currency of the Invoice in 3-letter ISO-4217 format.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive. Defaults to 0.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The preview invoice items.
The amount of the Invoice Line Item.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The currency of the Invoice Line Item in 3-letter ISO-4217 format.
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
The amount of the applied discount.
ID of the Discount object which is applied.
Price subscribed by the customer.
true if the price is available for new purchases, false otherwise.
Time when the price was created.
Currency of the price (in 3-letter ISO-4217 format).
ID of the Price object.
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.
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.
ID of the Product object this price is associated with.
Whether the price includes tax.
One of ONE_OFF or RECURRING depending on whether the price is for a one-off purchase or a recurring (subscription) purchase.
Time when the price was last updated.
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 description.
The fixed amount to be charged. Only required when the pricing model is FLAT.
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.
Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.
The amount of quantity that constitutes a single billable lot.
A set of string key-value pairs that you can attach to this object for storing additional information.
ID of the Meter object specifying how to calculate the usage for this price.
The frequency at which the price is charged. null for one-time charge.
The number of period units between subscription billing cycles. For example, the billing cycle is bi-monthly if period=2 and period_unit=MONTH.
Specifies billing frequency. One of DAY, WEEK, MONTH or YEAR.
List of quantity-based pricing tiers for this price. Required when the pricing model is VOLUME or GRADUATED.
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.
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.
Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.
The amount of quantity that constitutes a single billable lot.
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.
Description of the billable unit for the tier.
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.
The amount to be charged per product unit. Only required when the pricing model is PER_UNIT.
Description of the billable unit for the price.
The product quantity.
The end of the billing period associated with this Invoice Line Item. This value is exclusive.
The start of the billing period associated with this Invoice Line Item. This value is inclusive.
The tax amount for this line item.
The tax breakdown details the exact taxes that apply to this line item.
The display name of this tax component.
The amount of tax charged for this component.
The tax percent applied for this component.
The portion of the subtotal that this tax component applies to.
The effective tax percent of this invoice line item.
ID of the legal entity to be used for the Invoice as billing entity.
ID of the Subscription which generated this invoice, if any.
The total amount of the invoice.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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">}'
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": 2088 },89 {90 "flat_amount": 2091 }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": 100104 }105 ],106 "tax_percent": 5107 }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}
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.
ID of the Invoice object.
ID of the Billing Customer who this Invoice is to be issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due. Only one of days_until_due and due_at should be passed.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Desired set of invoice-level discounts. If provided, replaces all existing discounts. Currently, only one element is supported.
Coupon to redeem into a discount for this resource. Only required when type = COUPON.
id of the Coupon object.
Specifies how to obtain a new discount. One of: COUPON.
Due date set by the merchant for this invoice, if any. Only one of days_until_due and due_at should be passed.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
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 settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
ID of the Billing Customer who this Invoice is issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Time when this invoice was created.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
ID of the Invoice object.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
The time that the invoice was voided.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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">}'
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}
Delete a draft invoice
POST /api/v1/billing/invoices/{id}/delete
Delete a draft Invoice.
ID of the Invoice object.
Indicates whether the delete command was executed successfully.
ID of the Invoice object.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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'
1{2 "deleted": true,3 "id": "inv_hkpd49cskgblns6iimw"4}
Retrieve an invoice
GET /api/v1/billing/invoices/{id}
Retrieves the details of an Invoice.
ID of the Invoice object.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
ID of the Billing Customer who this Invoice is issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Time when this invoice was created.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
ID of the Invoice object.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
The time that the invoice was voided.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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'
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}
Get list of invoices
GET /api/v1/billing/invoices
Retrieves a list of Invoices based on the query parameters.
ID of the Billing Customer who the invoice is addressed to.
The start date of created_at in ISO8601 format (inclusive).
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.
Number of Invoices per page. Defaults to 20.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
ID of the Subscription which generated this invoice, if any.
The end date of created_at in ISO8601 format (exclusive).
Paged results.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
ID of the Billing Customer who this Invoice is issued to.
Time when this invoice was created.
The currency of the Invoice in 3-letter ISO-4217 format.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
ID of the Invoice object.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The time that the invoice was voided.
The page cursor used for searching after page.
The page cursor used for search before page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$curl --request GET \> --url 'https://api.sandbox.airwallex.com/api/v1/billing/invoices' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
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}
Finalize an invoice
POST /api/v1/billing/invoices/{id}/finalize
Finalizes a draft invoice.
ID of the Invoice object.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
ID of the Billing Customer who this Invoice is issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Time when this invoice was created.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
ID of the Invoice object.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
The time that the invoice was voided.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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'
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}
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.
ID of the Invoice object.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
ID of the Billing Customer who this Invoice is issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Time when this invoice was created.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
ID of the Invoice object.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
The time that the invoice was voided.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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'
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}
Void an invoice
POST /api/v1/billing/invoices/{id}/void
Void a finalized Invoice.
ID of the Invoice object.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
ID of the Billing Customer who this Invoice is issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Time when this invoice was created.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
ID of the Invoice object.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
The time that the invoice was voided.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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'
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}
Pay an Invoice
POST /api/v1/billing/invoices/{id}/pay
Pay a finalized AUTO_CHARGE Invoice using an existing Payment Source.
Unique identifier of the Invoice object.
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.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
ID of the Billing Customer who this Invoice is issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Time when this invoice was created.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
ID of the Invoice object.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
The time that the invoice was voided.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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">}'
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}
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.
ID of the Invoice object that this Invoice Line Item belongs to.
List of Invoice Line Item to be created.
Description of the Invoice Line Item.
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.
Coupon to redeem into a discount for this resource. Only required when type = COUPON.
id of the Coupon object.
Specifies how to obtain the discount. One of: COUPON.
A set of string key-value pairs that you can attach to this object for storing additional information.
One-time price definition following the same schema as the Price resource. Exactly one of price_id or price is required.
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.
Price description.
The fixed amount to be charged. Only required when the pricing model is FLAT.
One-time product definition following the same schema as the Product. Exactly one of product_id or product is required.
Product name.
Product description. Used for internal classification and identification.
A set of string key-value pairs that you can attach to this object for storing additional information.
The tax category of the product.
Product unit.
ID of the Product object this price is associated with. Exactly one of product_id or product is required.
Whether the price includes tax. Defaults to false.
The amount to be charged per product unit. Only required when the pricing model is PER_UNIT.
ID of the price object. Exactly one of price or price_id is required.
The product quantity.
The effective tax percent of this subscription item.
Unique request ID specified by the merchant.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
ID of the Billing Customer who this Invoice is issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Time when this invoice was created.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
ID of the Invoice object.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
The time that the invoice was voided.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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">}'
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}
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.
ID of the invoice object that this Invoice Line Item belongs to.
ID of the Invoice Line Item object.
The amount of the Invoice Line Item.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
Time when the price was created.
The currency of the Invoice Line Item in 3-letter ISO-4217 format.
Description of the Invoice Line Item.
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
The amount of the applied discount.
ID of the Discount object which is applied.
ID of the Invoice Line Item object.
ID of the Invoice object that this Invoice Line Item belongs to.
String to describe what this line item charges for.
A set of string key-value pairs that you can attach to this object for storing additional information.
The end of the billing period associated with this Invoice Line Item. This value is exclusive.
The start of the billing period associated with this Invoice Line Item. This value is inclusive.
Price subscribed by the customer.
true if the price is available for new purchases, false otherwise.
Time when the price was created.
Currency of the price (in 3-letter ISO-4217 format).
ID of the Price object.
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.
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.
Details of the Product object this price is associated with.
true if the product is available for new purchases, false otherwise.
Time when this product was created.
ID of the Product object.
Product name.
Product unit.
Time when this product was last updated.
Product description.
A set of string key-value pairs that you can attach to this object for storing additional information.
The tax category of the product.
ID of the Product object this price is associated with.
Whether the price includes tax.
One of ONE_OFF or RECURRING depending on whether the price is for a one-off purchase or a recurring (subscription) purchase.
Time when the price was last updated.
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 description.
The fixed amount to be charged. Only required when the pricing model is FLAT.
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.
Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.
The amount of quantity that constitutes a single billable lot.
A set of string key-value pairs that you can attach to this object for storing additional information.
ID of the Meter object specifying how to calculate the usage for this price.
The frequency at which the price is charged. null for one-time charge.
The number of period units between subscription billing cycles. For example, the billing cycle is bi-monthly if period=2 and period_unit=MONTH.
Specifies billing frequency. One of DAY, WEEK, MONTH or YEAR.
List of quantity-based pricing tiers for this price. Required when the pricing model is VOLUME or GRADUATED.
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.
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.
Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.
The amount of quantity that constitutes a single billable lot.
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.
Description of the billable unit for the tier.
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.
The amount to be charged per product unit. Only required when the pricing model is PER_UNIT.
Description of the billable unit for the price.
The product quantity.
The total amount currently available to be credited for this invoice line item, excluding tax and discount.
The tax amount for this line item.
The tax breakdown details the exact taxes that apply to this line item.
The display name of this tax component.
The amount of tax charged for this component.
The tax percent applied for this component.
The portion of the subtotal that this tax component applies to.
The effective tax percent of this invoice line item.
Time when the price was last updated.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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'
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": 1054 },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": 2084 },85 {86 "flat_amount": 2087 }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": 100103 }104 ],105 "tax_percent": 7.5,106 "updated_at": "2022-01-01T10:15:30+0000"107}
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.
ID of the Invoice object that the Invoice Line Items belong to.
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.
Number of invoiceItems per page. Defaults to 20.
Paged results.
The amount of the Invoice Line Item.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
Time when the price was created.
The currency of the Invoice Line Item in 3-letter ISO-4217 format.
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
The amount of the applied discount.
ID of the Discount object which is applied.
ID of the Invoice Line Item object.
ID of the Invoice object that this Invoice Line Item belongs to.
Price subscribed by the customer.
true if the price is available for new purchases, false otherwise.
Time when the price was created.
Currency of the price (in 3-letter ISO-4217 format).
ID of the Price object.
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.
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.
Details of the Product object this price is associated with.
true if the product is available for new purchases, false otherwise.
Time when this product was created.
ID of the Product object.
Product name.
Product unit.
Time when this product was last updated.
Product description.
A set of string key-value pairs that you can attach to this object for storing additional information.
The tax category of the product.
ID of the Product object this price is associated with.
Whether the price includes tax.
One of ONE_OFF or RECURRING depending on whether the price is for a one-off purchase or a recurring (subscription) purchase.
Time when the price was last updated.
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 description.
The fixed amount to be charged. Only required when the pricing model is FLAT.
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.
Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.
The amount of quantity that constitutes a single billable lot.
A set of string key-value pairs that you can attach to this object for storing additional information.
ID of the Meter object specifying how to calculate the usage for this price.
The frequency at which the price is charged. null for one-time charge.
The number of period units between subscription billing cycles. For example, the billing cycle is bi-monthly if period=2 and period_unit=MONTH.
Specifies billing frequency. One of DAY, WEEK, MONTH or YEAR.
List of quantity-based pricing tiers for this price. Required when the pricing model is VOLUME or GRADUATED.
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.
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.
Specifies how to round the calculated lots when the total quantity is not an exact multiple of the size. One of UP.
The amount of quantity that constitutes a single billable lot.
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.
Description of the billable unit for the tier.
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.
The amount to be charged per product unit. Only required when the pricing model is PER_UNIT.
Description of the billable unit for the price.
Time when the price was last updated.
Description of the Invoice Line Item.
String to describe what this line item charges for.
A set of string key-value pairs that you can attach to this object for storing additional information.
The end of the billing period associated with this Invoice Line Item. This value is exclusive.
The start of the billing period associated with this Invoice Line Item. This value is inclusive.
The product quantity.
The total amount currently available to be credited for this invoice line item, excluding tax and discount.
The tax amount for this line item.
The tax breakdown details the exact taxes that apply to this line item.
The display name of this tax component.
The amount of tax charged for this component.
The tax percent applied for this component.
The portion of the subtotal that this tax component applies to.
The effective tax percent of this invoice line item.
The page cursor used for searching after page.
The page cursor used for search before page.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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'
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": 1055 },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": 2084 },85 {86 "flat_amount": 2087 }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": 100101 }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}
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.
ID of the Invoice object that this Invoice Line Item belongs to.
List of Invoice Line Item to be updated.
ID of the Invoice Line Item.
Description of the Invoice Line Item.
Desired set of invoice line item level discounts. If provided, replaces all existing discounts. Currently, only one element is supported.
Coupon to redeem into a discount for this resource. Only required when type = COUPON.
id of the Coupon object.
Specifies how to obtain a new discount. One of: COUPON.
A set of string key-value pairs that you can attach to this object for storing additional information.
The product quantity.
The effective tax percent of this subscription item.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
ID of the Billing Customer who this Invoice is issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Time when this invoice was created.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
ID of the Invoice object.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
The time that the invoice was voided.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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> }> ]>}'
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}
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.
ID of the Invoice object that this Invoice Line Item belongs to.
List of Invoice Line Item IDs to be deleted.
The total amount remaining to be paid on this invoice. When the amount due reaches 0, the invoice payment status transitions to PAID.
List of discounts that are applied to the invoice. Discounts of invoice line items are applied before invoice discounts.
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.
ID of the specific target object the discount is applied to. Must correspond to the object type defined in applied_to.
The ID of the billing customer to whom the coupon is applied.
Time when the Discount was created.
Specified how to calculate the discount amount when applied, one of
FLAT: fixed amount off.PERCENTAGE: percentage off.
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.
ID of the Discount object.
Name of the discount. For discounts created from a coupon, defaults to the coupon name at creation time.
Source of the Discount. Possible values:
COUPON: the discount is applied through a coupon.
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.
Time when the Discount was updated.
The fixed amount to deduct when discount_model is FLAT.
The ID of the Checkout where this discount was redeemed, if applicable.
The currency of amount_off when discount_model is FLAT.
The duration of the discount to apply, when duration_type is CUSTOM. null if duration_type is ONCE or INDEFINITELY.
The number of period units.
Specifies duration. One of DAY, WEEK, MONTH, YEAR
The timestamp when the discount expires. Present only when the associated coupon's duration_type is CUSTOM.
The percentage between 0 to 100 to be applied to deduct when discount_model is PERCENTAGE.
ID of the creating source, e.g. is the ID of the coupon if source = COUPON.
The automatic tax status of this invoice.
APPLIEDThe automatic tax is applied.
LOCATION_NOT_SUPPORTEDAutomatic tax calculation isn't supported in the customer's location.
LOCATION_NOT_REGISTERED_BY_MERCHANTThe merchant isn't registered to collect tax in the customer's location.
ADDRESS_INCOMPLETEThe customer address was insufficient or invalid to determine the correct tax.
DISABLEDThe automatic tax is disabled.
Bank transfer instructions for paying this Invoice. Included when bank transfer is enabled, the Invoice currency is supported, and the Billing Customer is eligible.
Name of the account holder receiving the transfer.
Currency of the receiving account (3-letter ISO-4217 code).
Category of the receiving bank account. One of CHECKING, SAVINGS, or BUSINESS.
CHECKINGSAVINGSBUSINESSBank account number.
Code identifying the bank. Applicable in markets including Singapore and Hong Kong.
Name of the financial institution in which the receiving account is domiciled.
Code identifying the bank branch. Used together with bank_code.
Bank State Branch (BSB) number. Applicable only to accounts in Australia.
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.
OURIBAN number.
Institution number identifying the bank. Applicable only to accounts in Canada.
The recipient's registered business address, used when making an international (SWIFT) transfer. Returned only for SWIFT transfers. Omitted for local transfers.
Two-letter ISO 3166-1 country code of the recipient's address.
Postal or ZIP code of the recipient's address.
State, province, or region of the recipient's address.
Street address of the recipient, given as one or more address lines.
Suburb or city of the recipient's address.
Unique payment reference to include with the bank transfer to match the payment to this Invoice. Available after the Invoice is finalized.
Bank routing number. Applicable only to accounts in the United States.
Bank sort code. Applicable only to accounts in the United Kingdom.
Bank SWIFT or BIC code.
Bank transit number. Applicable only to accounts in Canada.
ID of the Billing Customer who this Invoice is issued to.
Specify how payment is collected, one of AUTO_CHARGE, CHARGE_ON_CHECKOUT or OUT_OF_BAND.
Time when this invoice was created.
The total amount of all credit notes issued for this invoice after invoice payment.
The total amount of all credit notes issued for this invoice before invoice payment.
The currency of the Invoice in 3-letter ISO-4217 format.
Number of days from invoice finalization until payment is due.
The tax percent between 0 and 100 to be applied to each Line Item's price. The tax will be exclusive.
Due date set by the merchant for this invoice, if any.
Whether automatic tax is enabled for this invoice. When enabled, the system attempts to calculate taxes automatically.
The time that the invoice draft was finalized.
URL of the hosted page where customers can view and pay this invoice. The URL is valid for 35 days.
ID of the Invoice object.
Time of last payment attempt. Only applicable when subscription_id is not null.
ID of the legal entity to be used as billing entity. You can find this ID in the Airwallex web app > Settings.
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.
String used to describe the object. Referenced as memo or invoice note in Webapp.
A set of string key-value pairs that you can attach to this object for storing additional information.
Time of next payment attempt. Only applicable when subscription_id is not null.
A unique, identifying string that appears on emails sent to the customer for this invoice.
The time that the invoice was paid.
Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Airwallex.
The number of payment attempts made on this invoice so far. Only applicable when subscription_id is not null.
Payment settings of this Invoice. Only applicable if collection_method is CHARGE_ON_CHECKOUT.
Settings for saving this payment method for future use.
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.
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.
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.
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.
Status of the payment for the invoice, one of UNPAID and PAID.
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.
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.
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.
ID of the Subscription that generated this invoice, if any.
The total amount of the invoice, including tax and discount if applicable.
The aggregate amounts calculated per discount across all Invoice Line Items and the Invoice.
The amount of the applied discount.
ID of the Discount object which is applied.
The aggregate amounts calculated for all line items.
Time when this invoice was last updated.
The time that the invoice was voided.
| Error status | Description |
|---|---|
| 400 | Bad Request. Possible error codes: |
| 401 | Unauthorized. Possible error codes: |
| 404 | Not Found. Possible error codes: |
| 500 | Server Error. Possible error codes: |
$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"> ]>}'
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}