Airwallex logo
Airwallex logoAirwallex logo

Balances

Copy for LLMView as Markdown

Different types of balances such as available and pending can be retrieved to reflect the present balances under your Airwallex account.

Endpoints
GET /api/v1/balances/current
GET /api/v1/balances/history

Get current balances

GET /api/v1/balances/current

Get available and pending balances for every currency

Parameters
account_typestring

The type of account to query. Supported values: cash, yield, credit.

Response body - 200 OK - Multiple values
account_typestring

Account Type. One of: cash, yield, or credit

available_amountnumber

For account type CASH, Available balance. Customer deposits will be added to the available balance once processed, including any settled conversions bought in this currency

For account type CREDIT, the Available amount reflects the remaining credit you can use.

For account type YIELD, Total market value of all holdings.

currencystring

Currency of the account balance

pending_amountnumber

For account type CASH, amount that will become available once currency conversion(s) have been settled.

For account type YIELD, amount that will become available once Yield order(s) have been settled.

prepayment_amountnumber

Prepayment balance. Amount of money that is held in your Airwallex account as collateral for future transfer/conversion.

For account type CASH only.

reserved_amountnumber

Reserved balance. Amount of money that is held in your Airwallex account.

For account type CASH, consist of pending outbound payment.

For account type CREDIT, consist of card transactions authorized but not yet captured.

total_amountnumber

For account type CASH, Total account balance (Available + Pending + Reserved).

For account type CREDIT, the total outstanding balance on the credit account. Negative sign indicates the amount owed.

For account type YIELD, Total market value of all holdings. Equal to available amount.

Errors
Error statusDescription
401

Possible errors: credentials_invalid, credentials_expired

403

forbidden

429

too_many_requests

500

service_unavailable

GET /api/v1/balances/current
$curl --request GET \
> --url 'https://api-demo.airwallex.com/api/v1/balances/current' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1[
2 {
3 "account_type": "cash",
4 "available_amount": 100000,
5 "currency": "AUD",
6 "pending_amount": 50000,
7 "prepayment_amount": 0,
8 "reserved_amount": 0,
9 "total_amount": 150000
10 }
11]
Was this section helpful?

Get balance history

GET /api/v1/balances/history

Get balance history for an account based on the transaction currency. The response contains records where each record represents a change to the balance. You can filter results using the date range parameters, from_post_at and to_post_at, representing the time the balance change occurred in your Wallet. The date range should be within 7 days when using page_num to paginate through history. Alternatively, you can paginate using the page parameter to retrieve either the previous page or the next page of results.

Parameters
account_typestring

The type of account to query. Supported values: cash, yield, credit.

currencystring

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

from_post_atstring

The start date (inclusive) of the date range during which balance activity occurred in your Wallet. Specify the date in ISO8601 format. If not specified, from_post_at defaults to 7 days before to_post_at.

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. Passing page=0 will override the 7 day default for null date ranges, enabling a complete search of the Wallet balance records.

page_numinteger

The page number of the page to be retrieved. Page numbers range from 0 to a maximum value of 10000.

page_sizeinteger

A limit on the number of records to be returned on a page, between 10 and 2000. The default is 100.

request_idstring

request_id from clients for the transaction

to_post_atstring

The end date (exclusive) of the date range during which the balance activity occurred in your Wallet. Specify the date in ISO8601 format. Defaults to today if neither this field nor from_post_at are specified. If from_post_at is specified, then to_post_at defaults to 7 days after the from_post_at date.

Response body - 200 OK
has_moreboolean

A flag which identifies whether there are more results in forward direction.

itemsarray

List items

items.account_typestring

Account Type. One of: cash, yield, or credit

items.amountnumber

The amount of this balance change

items.balancenumber

The balance after this balance change occurred.

For account type CASH and YIELD, tracks spendable amount.

For account type CREDIT, tracks utilized credit balance.

items.currencystring

The currency of this balance change

items.descriptionstring

The description for this balance change

items.feenumber

The fee amount occurred with same currency, the account who paid this fee will receive this field

items.idstring

The Unique identifier of the balance activity

items.posted_atstring

The time this change posted to balance

items.sourcestring

The unique identifier of the source transaction

items.source_typestring

The original transaction type. One of: DEPOSIT, CONVERSION, PAYMENT, CHARGE, TRANSFER, ADJUSTMENT, FEE, ISSUING, PAYMENT_SETTLEMENT, PAYMENT_RESERVE, PAYMENT_REFUND, PAYMENT_REFUND_FAILED, DIRECT_DEBIT, PAYOUT, PURCHASE, BATCH_PAYOUT, YIELD, REPAYMENT, WITHHOLDING_TAX

items.transaction_typestring

The transaction type of the balance history. One of: PAYMENT, PRE_CHARGEBACK_ACCEPTED, REFUND_CHARGEBACK_RECEIVED, REFUND_CHARGEBACK_WITHDRAWN, SECOND_CAPTURE_WITHDRAWN, DISPUTE, SECOND_DISPUTE, DISPUTE_REVERSAL, DISPUTE_LOST, DISPUTE_WON, REFUND, REFUND_REVERSAL, REFUND_FAILURE, PAYMENT_RESERVE_HOLD, PAYMENT_RESERVE_RELEASE, PAYOUT, PAYOUT_FAILURE, PAYOUT_REVERSAL, CONVERSION_SELL, CONVERSION_BUY, CONVERSION_REVERSAL, DEPOSIT, DEPOSIT_REVERSAL, ADJUSTMENT, FEE, DD_CREDIT, DD_DEBIT, DC_CREDIT, DC_DEBIT, DC_DEBIT_REVERSAL, ISSUING_AUTHORISATION_HOLD, ISSUING_AUTHORISATION_RELEASE, ISSUING_CAPTURE, ISSUING_REFUND, SPLIT, SPLIT_REVERSAL, LENDER_FUNDS_BORROWED, LENDER_FUNDS_RETURNED, DIRECT_DEBIT, DIRECT_DEBIT_REVERSAL, HOLD, HOLD_RELEASE, RETURN_TO_FUNDING_SOURCE, PURCHASE, PURCHASE_REVERSAL, TRANSFER, PREPAYMENT, PREPAYMENT_RELEASE, REPAYMENT_DEDUCTION, REPAYMENT_FUNDING, TRANSFER_OUT, TRANSFER_IN, TRANSFER_OUT_REVERSAL, TRANSFER_IN_REVERSAL, WITHHOLDING_TAX, WITHHOLDING_TAX_REVERSAL, null

page_afterstring

A bookmark for use in pagination to retrieve the next page of results. Provide this identifier in the page request parameter in a subsequent call to retrieve the next page of results. The value will be null for the last page.

page_beforestring

A bookmark for use in pagination to retrieve the previous page of results. Provide this identifier in the page request parameter in a subsequent call to retrieve the previous page of results. The value will be null for the first page.

Errors
Error statusDescription
400

Possible errors: invalid_argument

401

Possible errors: credentials_invalid, credentials_expired

403

forbidden

404

not_found

500

service_unavailable

GET /api/v1/balances/history
$curl --request GET \
> --url 'https://api-demo.airwallex.com/api/v1/balances/history' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "has_more": true,
3 "items": [
4 {
5 "account_type": "cash",
6 "amount": 50,
7 "balance": 1050,
8 "currency": "AUD",
9 "description": "Pay AUD 50.00",
10 "fee": 25,
11 "id": "0197f322-6667-7d76-b848-bfccedb2a97e",
12 "posted_at": "2017-04-01T03:52:34+0800",
13 "source": "a08c0f2f-3f26-4443-b5df-fad15582eb94",
14 "source_type": "CONVERSION",
15 "transaction_type": "CONVERSION_BUY"
16 }
17 ],
18 "page_after": "Nzc5OTlmN2MtZjVhYi0zMWI2LTlmMGMtYzA1NWRkNzY5Mzk0OkFGVEVS",
19 "page_before": "NzY5NmZjMmYtOWExMS0zN2Y0LWJkMWUtYWM1YzdjODQ5ZDg1OkJFRk9SRQ=="
20}
Was this section helpful?