Airwallex logo

Step 3: Transact on behalf of the connected account

Step 3: Transact on behalf of the connected account

Using the Airwallex account id of the account connected to your platform, you will be able to transact on behalf of the connected account in line with the authorisation level provided using the regular Airwallex API endpoints.

For example, you will be able to:

  • Open a global account - submit a request to open a new global account for the connected account in your chosen currency. This account can be used for the purpose of receiving funds via the local clearing system or via SWIFT.
  • Create a new transfer - debit your platform’s wallet and move funds to the connected account’s wallet
  • Create a new charge or a new transfer on behalf your merchant - debit the connected account’s wallet to move funds to your platform’s wallet
  • Create a new conversion - debit the connected account’s wallet in one currency, convert funds to another currency and credit funds to the connected account’s wallet in the target currency
  • Create a new payout - debit the connected account’s wallet to payout to a bank account
  • Get balances - view the wallet balances of the connected account

To call the API endpoint on behalf of the connected account, simply specify the account ID using the x-on-behalf-of header. You can see a sample conversion request for the connected account 133097196 below:

curl -X POST \
'http://api-demo.airwallex.com/api/v1/conversions/create' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI4Mjg5NTRiNC02ZjgzLTQ1MTktYWZkOC00NmQ2MTViMjMxOTkiLCJzdWIiOiJlYWQzOWQzZS1lMWU2LTQ3MjUtOWE0OS1iYmNhYTM5Y2Y2MzUiLCJpYXQiOjE1NDcxMjAzMzQsImV4cCI6MTU0NzEzMjMzNH0.ZFI38fBQUE5g48ndrtoBbutXjmMBPJJDmLDYcofu66g' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-H 'x-on-behalf-of: 133097196' \
-d '{
"buy_amount": "10000",
"buy_currency": "USD",
"client_data": "string",
"reason": "Settling invoices",
"request_id": "67f687fe-dcf4-4462-92fa-203353a01d9d96",
"sell_currency": "AUD",
"settlement_date": "2018-12-11",
"term_agreement": true
 }'