Airwallex logo

Billing Transactions

Copy for LLMView as Markdown

A Billing Transaction describes a transaction on your invoice such as a payment or refund.

Endpoints
GET /api/v1/billing/billing_transactions/{id}
GET /api/v1/billing/billing_transactions

Retrieve a Billing Transaction

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

Retrieves the details of a Billing Transaction.

Path parameters
idrequiredstring

ID of the Billing Transaction object.

Response body - 200 OK
amountnumber

The total amount of this billing transaction.

billing_customer_idstring

ID of the Billing Customer who is making this Billing Transaction

cancelled_atstring

Time when this billing transaction was cancelled.

created_atstring

Time when this billing transaction was created.

currencystring

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

external_idstring

ID of the Payment Intent associated with the Billing Transaction.

idstring

ID of the Billing Transaction object.

invoice_idstring

ID of the Invoice this billing transaction is associated with.

linked_payment_account_idstring

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

metadataobject

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

out_of_bandboolean

Returns true if the billing transaction was manually marked as succeeded, returns false if the transaction hasn't succeeded yet or was processed on Airwallex.

payment_source_idstring

ID of the Payment Source for which this billing transaction is made.

statusstring

Status of the billing transaction, one of CREATED, SUCCEEDED, CANCELLED and FAILED.

succeeded_atstring

The time that the billing transaction succeeded.

typestring

Type of the billing transaction. One of PAYMENT or REFUND.

updated_atstring

Time when this billing transaction was last updated.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error

401

Unauthorized. Possible error codes: unauthorized

404

Not Found. Possible error codes: resource_not_found

500

Server Error. Possible error codes: internal_error

GET /api/v1/billing/billing_transactions/{id}
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/billing_transactions/billing_transaction_id' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "amount": 19.99,
3 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
4 "cancelled_at": "2023-06-15T12:30:00+0000",
5 "created_at": "2023-06-15T12:30:00+0000",
6 "currency": "USD",
7 "external_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",
8 "id": "btxn_hkst2n8dxh3h6vaiq9i",
9 "invoice_id": "inv_hkpd49cskgblns6iimw",
10 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
11 "metadata": {
12 "order_id": "ORD-12345"
13 },
14 "out_of_band": false,
15 "payment_source_id": "psrc_sgstvjkjjh7lzraf39f",
16 "status": "SUCCEEDED",
17 "succeeded_at": "2023-06-15T12:35:01+0000",
18 "type": "PAYMENT",
19 "updated_at": "2023-06-15T12:30:00+0000"
20}
Was this section helpful?

List all Billing Transactions

GET /api/v1/billing/billing_transactions

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

Query parameters
invoice_idrequiredstring

ID of the Invoice this Billing Transaction is associated with.

from_created_atstring

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

pagestring

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

page_sizeinteger

Number of Billing Transactions per page. Defaults to 20.

to_created_atstring

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

Response body - 200 OK
itemsarray

Paged results.

items.amountnumber

The total amount of this billing transaction.

items.billing_customer_idstring

ID of the Billing Customer who is making this Billing Transaction

items.created_atstring

Time when this billing transaction was created.

items.currencystring

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

items.idstring

ID of the Billing Transaction object.

items.statusstring

Status of the billing transaction, one of CREATED, SUCCEEDED, CANCELLED and FAILED.

items.updated_atstring

Time when this billing transaction was last updated.

items.cancelled_atstring

Time when this billing transaction was cancelled.

items.external_idstring

ID of the Payment Intent associated with the Billing Transaction.

items.invoice_idstring

ID of the Invoice this billing transaction is associated with.

items.linked_payment_account_idstring

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

items.metadataobject

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

items.out_of_bandboolean

Returns true if the billing transaction was manually marked as succeeded, returns false if the transaction hasn't succeeded yet or was processed on Airwallex.

items.payment_source_idstring

ID of the Payment Source for which this billing transaction is made.

items.succeeded_atstring

The time that the billing transaction succeeded.

items.typestring

Type of the billing transaction. One of PAYMENT or REFUND.

page_afterstring

The page cursor used for searching after page.

page_beforestring

The page cursor used for search before page.

Errors
Error statusDescription
400

Bad Request. Possible error codes: validation_error

401

Unauthorized. Possible error codes: unauthorized

500

Server Error. Possible error codes: internal_error

GET /api/v1/billing/billing_transactions
$curl --request GET \
> --url 'https://api.sandbox.airwallex.com/api/v1/billing/billing_transactions' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "items": [
3 {
4 "amount": 19.99,
5 "billing_customer_id": "bcus_hkpd7fedfgb004apkvs",
6 "cancelled_at": "2023-06-15T12:30:00+0000",
7 "created_at": "2023-06-15T12:30:00+0000",
8 "currency": "USD",
9 "external_id": "int_e65tkXCSzJrsMpTrzoFrjaau53",
10 "id": "btxn_hkst2n8dxh3h6vaiq9i",
11 "invoice_id": "inv_hkpd49cskgblns6iimw",
12 "linked_payment_account_id": "acct_ncI2nypPKSq2VXKxscAcg",
13 "metadata": {
14 "order_id": "ORD-12345"
15 },
16 "out_of_band": false,
17 "payment_source_id": "psrc_sgstvjkjjh7lzraf39f",
18 "status": "SUCCEEDED",
19 "succeeded_at": "2023-06-15T12:35:01+0000",
20 "type": "PAYMENT",
21 "updated_at": "2023-06-15T12:30:00+0000"
22 }
23 ],
24 "page_after": "<string>",
25 "page_before": "<string>"
26}
Was this section helpful?