Hosted Flows
Airwallex Hosted Flows enable a Platform to redirect end users into Airwallex-hosted web pages to complete a variety of activity flows. Platforms can deliver hosted flows via a secure, short-lived link unique to each connected account. After completion of a flow, the user is redirected back to the platform. Hosted flows are available for accounts created via API.
Currently supported flows:
onboarding– Submit KYC information needed to activate the account.
Contact your Airwallex Account Manager to start using hosted flows.
Your Account Manager will create a flow template, which defines the series of steps the end user will proceed through. Then, you can create a flow instance for a particular connected account and direct users to the provided URL.
POST /api/v1/hosted_flows/createGET /api/v1/hosted_flows/{id}POST /api/v1/hosted_flows/{id}/authorize
Create flow
POST /api/v1/hosted_flows/create
Create a hosted flow instance for an account. Specify the account_id of the connected account for which you are creating the flow, and the hosted flow template provided by Airwallex.
Account unique identifier of the connected account for which the hosted flow instance is created
If set, the user will be redirected to this URL if an error occurs, with an extra query parameter ahfi_id
A set of key-value pairs that you can attach to the hosted flow
The user be redirected to this URL after finishing the flow, with an extra query parameter ahfi_id, this field is only required if Airwallex is hosting the experience
Unique identifier of the template that the created flow instance will follow
Unique identifier of the hosted flow instance.
The metadata set when creating the flow
The result of the flow execution, containing optional additional information for each flow action if status is FINISHED. It is usually empty.
The status of the flow instance. One of INIT, PROCESSING or FINISHED
The URL by which only users with Airwallex login credentials can enter the flow. For your own users, make sure to authorize the flow next. This link is unique to the connected account_id specified in the request and expires after 15 seconds.
| Error status | Description |
|---|---|
| 400 | ["Your account does not have a flow template" ,"Account does not exist." "Invalid value for return_url." ] |
| 401 | Possible errors: |
| 429 | Too many requests |
| 500 | Service unavailable |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/hosted_flows/create' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "account_id": "acct_wst1AJZWbOx2Ijf-PDS123w",> "error_url": "<string>",> "metadata": {},> "return_url": "<string>",> "template": "<string>">}'
1{2 "id": "ahfi_Y9_AbPkQQQe0K81XcHLy5w",3 "metadata": {},4 "result": {},5 "status": "INIT",6 "url": "<string>"7}
Get flow
GET /api/v1/hosted_flows/{id}
Get the AWX Hosted Flow instance by its unique identifier
Unique identifier of the hosted flow instance
Unique identifier of the hosted flow instance.
The metadata set when creating the flow
The result of the flow execution, containing optional additional information for each flow action if status is FINISHED. It is usually empty.
The status of the flow instance. One of INIT, PROCESSING or FINISHED
The URL by which only users with Airwallex login credentials can enter the flow. For your own users, make sure to authorize the flow next. This link is unique to the connected account_id specified in the request and expires after 15 seconds.
| Error status | Description |
|---|---|
| 401 | Possible errors: |
| 429 | Too many requests |
| 500 | Service unavailable |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/hosted_flows/hosted_flow_id' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "id": "ahfi_Y9_AbPkQQQe0K81XcHLy5w",3 "metadata": {},4 "result": {},5 "status": "INIT",6 "url": "<string>"7}