Search...
Log inGet started
Airwallex logo
Home
Core API
Payments
Transactional FX
Payouts
Issuing
Back to home
OverviewUnderstanding Payments for PlatformsChoose your Payments for Platforms solution
Use cases
Hold & convert funds
Connected accounts
Connected accounts overviewOnboard connected accounts
KYC and onboarding
Handle KYC RFI
KYB and onboarding
Embedded KYB componentHosted Onboarding
Native API
Payment Method Onboarding Requirement
Handle Payment Enablement RFI
Onboard multiple connected accountsMove funds between accounts
Error codes

Hosted Onboarding

Hosted KYB is the recommended solution for platforms to activate payment methods for customers without having to build your own full-fledged payment activation form around Airwallex APIs.

Our hosted form dynamically takes care of collecting required information to activate payment methods, customized by business scenario and payment methods. You’ll directly leverage our UX optimizations for error handling. You can also customize the visual appearance of the onboarding form to reflect your brand.

Through Hosted Payment Method Activation, a platform can

  • Via an API, retrieve a Hosted flow link unique to a connected account
  • Direct the end user who clicks on the link into an Airwallex-hosted environment to complete a white-labeled payment activation form
  • After the payment activation form is complete, the end user is automatically redirected back into your environment (or to any return URL of choice)

Before you begin

Step 1: Create an account and pre-fill information

POST /api/v1/accounts/create

Handle response and error logic. Make sure to save the account_id for this account from the response.

JSON

Step 2: Create hosted 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 (from Step 2), and the hosted flow template id (from Step 1).

Request

JSON

Response

JSON

From the response, make sure to save the hosted flow id mapped to the account.

Error responses could include:

  • 400 (template not found, account id not found)
  • 403 (not authorized for this action/account, account status is SUSPENDED – that is, disabled or failed KYC)
  • 500 (server error)

Step 3: Authorize the user into the hosted flow

POST /api/v1/hosted_flows/{id}/authorize

Explicitly authorize the user to access this created hosted flow instance. Redirect the user to the url link in the response.

Request

JSON

Response

JSON

Error responses could include:

  • 400 (hosted flow already finished)
  • 403 (not authorized for this action/account/flow)
  • 404 (hosted flow instance id not found)
  • 500 (server error)

Step 4: Handle re-entry

The user may exit the hosted onboarding form without finishing and attempt to re-enter later. If the user has not exited but the session expired, we will show a session prompt that lasts for 60 seconds before we logout the user with error code TOKEN_EXPIRED.

In order to handle re-entry,

  • Check if a saved hosted flow instance id for the account exists (from Step 3).
  • If the account has a saved hosted flow, re-authorize the user: Call the POST /api/v1/hosted_flows/{id}/authorize endpoint to retrieve a link with a new authorization code
  • Redirect the user to the new url from the response.

Error handling

Error codeMessageNext steps
TOKEN_EXPIREDAuthorization code has expired
UNAUTHORISEDUnauthorised. Invalid token also results in this error
INVALID_ACTION_STATUSAction of hosted flow instance has a status that is not valid to operate onUnrecoverable error. Example is the account’s KYB application is rejected.
FLOW_INSTANCE_NOT_FOUNDHosted flow instance is not foundCreate a new hosted flow instance as described in Step 2
SUBMIT_FAILEDKYB submission failureRetry submission if network error or contact Airwallex support.
UNKNOWNUnidentified errorsContact Airwallex support
On this page