Airwallex logo
Airwallex logoAirwallex logo

Charges

Copy for LLMView as Markdown

A Scale Charge can be used to charge a Connected Account and credit the Platform account's wallet. This action may support processing fees and charges from your clients or business partners. Source Connected Account to be charged must have passed KYC and be in state ACTIVE.

Endpoints
GET /api/v1/charges
GET /api/v1/charges/{id}
POST /api/v1/charges/create

Get list of charges

GET /api/v1/charges

Get a list of charges created by your Airwallex account. The charges returned will be sorted by creation time.

Parameters
currencystring

Currency (3-letter ISO-4217 code)

from_created_atstring

The start date of created_at in ISO8601 format (inclusive)

page_numinteger

Page number, starts from 0.

page_sizeinteger

Number of results per page. Default value is 100, minimum 10, maximum 2000

request_idstring

Charge request_id

sourcestring

Airwallex account unique identifier

statusstring

Status of the charge, one of: NEW, PENDING, SETTLED,SUSPENDED, FAILED

to_created_atstring

The end date of created_at in ISO8601 format (inclusive)

Response body - 200 OK
has_moreboolean

A flag which identifies whether there are more results.

itemsarray

Paged results.

items.amountnumber

Amount of the charge in currency specified in the request

items.created_atstring

The time this charge was created

items.currencystring

Currency (3-letter ISO-4217 code) specified in the request

items.feenumber

Fee of the charge in currency specified in the request

items.idstring

Unique identifier for the charge

items.reasonstring

Reason for the charge instruction specified in the request

items.referencestring

User specified reference that will be displayed to the beneficiary specified in the request

items.request_idstring

Unique request identifier specified in the request

items.short_reference_idstring

Short reference for support purposes

items.sourcestring

Airwallex account unique identifier specified in the request

items.statusstring

Status of the charge. One of: NEW, PENDING,SETTLED,SUSPENDED, FAILED

items.updated_atstring

The time this charge was updated

Errors
Error statusDescription
400

Possible errors: field_required, invalid_argument

401

Possible errors: credentials_invalid, credentials_expired

429

Too many requests

500

Service unavailable

GET /api/v1/charges
$curl --request GET \
> --url 'https://api-demo.airwallex.com/api/v1/charges' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "has_more": false,
3 "items": [
4 {
5 "amount": 10000,
6 "created_at": "2017-03-22T16:08:02+1100",
7 "currency": "AUD",
8 "fee": 10,
9 "id": "d9af1614-a6a1-4d45-aae7-6858fc6d9ede",
10 "reason": "travel",
11 "reference": "PMT1936398",
12 "request_id": "7f687fe6-dcf4-4462-92fa-80335301d9d2",
13 "short_reference_id": "D220926-QZ7BTZE",
14 "source": "1936398",
15 "status": "NEW",
16 "updated_at": "2018-03-22T16:08:02+1100"
17 }
18 ]
19}
Was this section helpful?

Get a charge by ID

GET /api/v1/charges/{id}

Get the details of a charge that has previously been created. Supply the unique charge identifier that was returned at the time your created a new charge and Airwallex will return details of the corresponding charge.

Parameters
idrequiredstring

Unique identifier of the charge to retrieve

Response body - 200 OK
amountnumber

Amount of the charge in currency specified in the request

created_atstring

The time this charge was created

currencystring

Currency (3-letter ISO-4217 code) specified in the request

feenumber

Fee of the charge in currency specified in the request

idstring

Unique identifier for the charge

reasonstring

Reason for the charge instruction specified in the request

referencestring

User specified reference that will be displayed to the beneficiary specified in the request

request_idstring

Unique request identifier specified in the request

short_reference_idstring

Short reference for support purposes

sourcestring

Airwallex account unique identifier specified in the request

statusstring

Status of the charge. One of: NEW, PENDING,SETTLED,SUSPENDED, FAILED

updated_atstring

The time this charge was updated

Errors
Error statusDescription
400

Possible errors: field_required, invalid_argument

401

Possible errors: credentials_invalid, credentials_expired

429

Too many requests

500

Service unavailable

GET /api/v1/charges/{id}
$curl --request GET \
> --url 'https://api-demo.airwallex.com/api/v1/charges/charge_id' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "amount": 10000,
3 "created_at": "2017-03-22T16:08:02+1100",
4 "currency": "AUD",
5 "fee": 10,
6 "id": "d9af1614-a6a1-4d45-aae7-6858fc6d9ede",
7 "reason": "travel",
8 "reference": "PMT1936398",
9 "request_id": "7f687fe6-dcf4-4462-92fa-80335301d9d2",
10 "short_reference_id": "D220926-QZ7BTZE",
11 "source": "1936398",
12 "status": "NEW",
13 "updated_at": "2018-03-22T16:08:02+1100"
14}
Was this section helpful?

Create a new charge

POST /api/v1/charges/create

Create a charge to be applied to a connected account.

Request body
amountrequiredstring

Amount of the charge in currency, representing how much to charge

currencyrequiredstring

Currency (3-letter ISO-4217 code)

reasonrequiredstring

Reason for the charge instruction. One of: wages_salary, donation_charitable_contribution, personal_remittance, transfer_to_own_account, pension, family_support, living_expenses, education_training, travel, investment_proceeds, investment_capital, loan_credit_repayment, taxes, goods_purchased, business_expenses, medical_services, professional_business_services, technical_services, other_services, construction, freight, real_estate

referencerequiredstring

User specified reference that will be displayed to the beneficiary. 1-140 characters long

request_idrequiredstring

Unique request identifier. 1-50 characters long

sourcerequiredstring

Airwallex account unique identifier

Response body - 201 Created
amountnumber

Amount of the charge in currency specified in the request

created_atstring

The time this charge was created

currencystring

Currency (3-letter ISO-4217 code) specified in the request

feenumber

Fee of the charge in currency specified in the request

idstring

Unique identifier for the charge

reasonstring

Reason for the charge instruction specified in the request

referencestring

User specified reference that will be displayed to the beneficiary specified in the request

request_idstring

Unique request identifier specified in the request

short_reference_idstring

Short reference for support purposes

sourcestring

Airwallex account unique identifier specified in the request

statusstring

Status of the charge. One of: NEW, PENDING,SETTLED,SUSPENDED, FAILED

updated_atstring

The time this charge was updated

Errors
Error statusDescription
400

Possible errors: field_required, invalid_argument

401

Possible errors: credentials_invalid, credentials_expired

429

Too many requests

500

Service unavailable

POST /api/v1/charges/create
$curl --request POST \
> --url 'https://api-demo.airwallex.com/api/v1/charges/create' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "amount": "10000",
> "currency": "AUD",
> "reason": "travel",
> "reference": "PMT1936398",
> "request_id": "7f687fe6-dcf4-4462-92fa-80335301d9d2",
> "source": "1936398"
>}'
Response (201 Created)
1{
2 "amount": "10000",
3 "created_at": "2017-03-22T16:08:02+1100",
4 "currency": "AUD",
5 "fee": 10,
6 "id": "d9af1614-a6a1-4d45-aae7-6858fc6d9ede",
7 "reason": "travel",
8 "reference": "PMT1936398",
9 "request_id": "7f687fe6-dcf4-4462-92fa-80335301d9d2",
10 "short_reference_id": "D220926-QZ7BTZE",
11 "source": "1936398",
12 "status": "NEW",
13 "updated_at": "2018-03-22T16:08:02+1100"
14}
Was this section helpful?