Simulate deposits into your Global Account
You can conduct unit and end-to-end testing of your integration using Create a global account deposit API. This sandbox simulation endpoint creates a production-like deposit into your Global Accounts in the demo environment only.
Key test scenarios include:
- Triggering webhook event notifications for global accounts
- Viewing deposits in the Global Accounts transaction list on the Airwallex web app
- Retrieving deposits via Get global accounts transactions API, Get list of financial transactions API, and Get balance history API
A platform account can call Create a global account deposit API on behalf of a connected account using the x-on-behalf-of
header.
Step 1: Obtain your access token
Use obtain access token API to obtain an access token to call our API endpoints.
Example request
curl --location --request POST 'https://api-demo.airwallex.com/api/v1/authentication/login' \
--header 'Content-Type: application/json' \
--header 'x-client-id: [client_id]' \
--header 'x-api-key: [api_key]' \
--header 'Authorization: Bearer null' \
--data-raw ''
Example response
{
"expires_at": "2022-02-22T06:48:39+0000",
"token": "[jwt_token]"
}
Step 2: Retrieve the Global Account ID
Open a Global Account (if you haven't already opened one) through our open a global account API endpoint.
Get the Global Account id from the response or by calling get a list of global accounts API endpoint.
Example request
curl --location --request GET 'https://api-demo.airwallex.com/api/v1/global_accounts' \
--header 'Content-Type: application/json' \
--header 'x-client-id: [client_id]' \
--header 'x-api-key: [api_key]' \
--header 'Authorization: Bearer [jwt_token]' \
--data-raw ''
Example response
{
"has_more": false,
"items": [
{
"id": "486b8317-9135-4399-81c9-9c5397365d0f",
"request_id": "713a042a-c820-42a5-8584-14b5a50f3e6e",
"account_number": "87535504221",
"account_name": "Alan API Test",
"institution_name": "Standard Chartered Bank (Hong Kong) Ltd",
"account_routing_type": "bank_code",
"account_routing_value": "003",
"swift_code": "SCBLHKHH",
"status": "ACTIVE",
"nick_name": "HKD Global Account 1",
"currency": "HKD",
"country_code": "HK",
"payment_methods": [
"SWIFT",
"LOCAL"
],
"clearing_systems": [
"ACH",
"RTGS",
"FPS"
],
"branch_code": "875"
}
],
"total_count": 1
}
Step 3: Simulate a deposit
Input the mandatory fields of global_account_id
from step 2 and a deposit amount with our create a Global Account deposit API endpoint.
Example request
curl --request POST \
--url 'https://api-demo.airwallex.com/api/v1/simulation/deposit/create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your_bearer_token>' \
--data '{ \
"amount": 1000, \
"global_account_id": "7f687fe6-dcf4-4462-92fa-80335301d9d2", \
"payer_bankname": "Test bank", \
"payer_country": "HK", \
"payer_name": "1000", \
"reference": "test", \
"status": "PENDING" \
}'
Example response
{
"amount": 10000,
"create_time": "2017-03-22T16:08:02+1100",
"currency": "AUD",
"deposit_type": "CREDIT",
"fee_amount": 10,
"fee_currency": {
"currency_code": "string",
"precision": 0,
"value": "string"
},
"id": "90b98dc6-63a0-403f-816b-ac5305b42a11",
"payer_country": "HK",
"payer_name": "AMZNnt70paD1",
"reference": "test",
"status": "PENDING"
}