Airwallex logo
Airwallex logoAirwallex logo

Create an account invitation link

POST /api/v1/accounts/invitation_links/create

Request body
account_idstring

Id of Airwallex account to be invited. Required for scale_connect mode, optional for oauth2 mode. When provided, account must already be connected to partner or platform.

moderequiredstring

Invitation link mode. One of oauth2, scale_connect.

oauth2object

OAuth parameters, if invitation link mode is oauth2

oauth2.redirect_urirequiredstring

The platform callback URL redirected to after auth.

oauth2.response_typerequiredstring

This tells the Airwallex authorization server that the platform is initiating a Scale Invitation Link flow with OAuth mode. One of code.

oauth2.scoperequiredarray

The permissions the platform is requesting from the user.

oauth2.statestring

The platform generates a random string and includes it in the request. It should then check that the same value is returned after the user authorizes the app. Max length is 100 characters.

scale_connectobject

Scale connect parameters, if invitation link mode is scale_connect

scale_connect.redirect_urirequiredstring

The platform callback URL redirected to after scale connect.

metadataobject

A set of key-value pairs that you can attach to an Account object. This can be useful for storing additional information about the account in a structured format. You can specify up to 5 keys, with key names up to 20 characters long and values up to 150 characters long.

identifierstring

The identifier that the platform uses to identify a merchant, usually a unique merchant identifier. In oauth2 mode, identifier will be included in the query parameter when redirecting a user back to the client's redirect_uri. Max length is 1000 characters.

prefilled_formdataarray

Data pre-filled by platform during new user signup.

prefilled_formdata.fieldrequiredstring

the field name of pre filled form data

email, first_name, last_name, mobile_number, business_name, country, contact_name

prefilled_formdata.valuerequiredstring

The field value of pre-filled form data.

prefilled_formdata.verifiedboolean

Whether the platform has verified the value.

prefilled_formdata.editableboolean

Whether the user can edit the value.

Response body - 201 Created
account_idstring

Invite Airwallex account Id.

created_atstring

Time the account link was created.

expire_atstring

Time the account link will expire.

idstring

Airwallex account link unique identifier.

identifierstring

The identifier that the platform uses to identify a merchant, usually a unique merchant identifier. In oauth2 mode, identifier will be included in the query parameter when redirecting a user back to the client's redirect_uri. Max length is 1000 characters.

metadataobject

A set of key-value pairs that you can attach to an Account object. This can be useful for storing additional information about the account in a structured format. You can specify up to 5 keys, with key names up to 20 characters long and values up to 150 characters long.

modestring

Invitation link mode.

oauth2object

OAuth parameters, if invitation link mode is oauth2

oauth2.redirect_uristring

The platform callback URL redirected to after auth.

oauth2.response_typestring

This tells the Airwallex authorization server that the platform is initiating a Scale Invitation Link flow with OAuth mode. One of code.

oauth2.scopearray

The permissions the platform is requesting from the user.

oauth2.statestring

The platform generates a random string and includes it in the request. It should then check that the same value is returned after the user authorizes the app. Max length is 100 characters.

prefilled_formdataarray

Data pre-filled by platform during new user signup.

prefilled_formdata.fieldstring

the field name of pre filled form data

email, first_name, last_name, mobile_number, business_name, country, contact_name

prefilled_formdata.valuestring

The field value of pre-filled form data.

prefilled_formdata.verifiedboolean

Whether the platform has verified the value.

prefilled_formdata.editableboolean

Whether the user can edit the value.

scale_connectobject

Scale connect parameters, if invitation link mode is scale_connect

scale_connect.redirect_uristring

The platform callback URL redirected to after scale connect.

urlstring

URL provided by Airwallex for the end user to use in order to complete their OAuth 2.0 authorization.

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/accounts/invitation_links/create
$curl --request POST \
> --url 'https://api-demo.airwallex.com/api/v1/accounts/invitation_links/create' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "account_id": "acct_hm-QFRVYO4-InXeIsCPKOg",
> "mode": "oauth2",
> "oauth2": {
> "redirect_uri": "https://oauth.pstmn.io/v1/callback",
> "response_type": "code",
> "scope": [
> "r:awx_action:balances_view",
> "r:awx_action:settings.account_details_view"
> ],
> "state": "xcoiv98y2kd22vusuye3kch"
> },
> "scale_connect": {
> "redirect_uri": "https://www.pstmn.io/v1/callback"
> },
> "metadata": {
> "id": "1"
> },
> "identifier": "2fe425fd",
> "prefilled_formdata": [
> {
> "field": "email",
> "value": "[email protected]",
> "verified": true,
> "editable": false
> }
> ]
>}'
Response (201 Created)
1{
2 "account_id": "acct_hm-QFRVYO4-InXeIsCPKOg",
3 "created_at": "2021-07-13T15:56:57.006071Z",
4 "expire_at": "2021-08-12T15:56:57.006071Z",
5 "id": "link_V8CoOYobPMyBKyL-S59DtA",
6 "identifier": "2fe425fd",
7 "metadata": {
8 "id": "1"
9 },
10 "mode": "oauth2",
11 "oauth2": {
12 "redirect_uri": "https://oauth.pstmn.io/v1/callback",
13 "response_type": "code",
14 "scope": [
15 "r:awx_action:balances_view",
16 "r:awx_action:settings.account_details_view"
17 ],
18 "state": "xcoiv98y2kd22vusuye3kch"
19 },
20 "prefilled_formdata": [
21 {
22 "field": "email",
23 "value": "[email protected]",
24 "verified": true,
25 "editable": false
26 }
27 ],
28 "scale_connect": {
29 "redirect_uri": "https://www.pstmn.io/v1/callback"
30 },
31 "url": "https://demo.airwallex.com/connect/scale?invitationId=link_V8CoOYobPMyBKyL-S59DtA"
32}
Was this section helpful?

Get an account invitation link by ID

GET /api/v1/accounts/invitation_links/{id}

Parameters
idrequiredstring

Airwallex invitation link unique identifier

Response body - 200 OK
account_idstring

Invite Airwallex account Id.

created_atstring

Time the account link was created.

expire_atstring

Time the account link will expire.

idstring

Airwallex account link unique identifier.

identifierstring

The identifier that the platform uses to identify a merchant, usually a unique merchant identifier. In oauth2 mode, identifier will be included in the query parameter when redirecting a user back to the client's redirect_uri. Max length is 1000 characters.

metadataobject

A set of key-value pairs that you can attach to an Account object. This can be useful for storing additional information about the account in a structured format. You can specify up to 5 keys, with key names up to 20 characters long and values up to 150 characters long.

modestring

Invitation link mode.

oauth2object

OAuth parameters, if invitation link mode is oauth2

oauth2.redirect_uristring

The platform callback URL redirected to after auth.

oauth2.response_typestring

This tells the Airwallex authorization server that the platform is initiating a Scale Invitation Link flow with OAuth mode. One of code.

oauth2.scopearray

The permissions the platform is requesting from the user.

oauth2.statestring

The platform generates a random string and includes it in the request. It should then check that the same value is returned after the user authorizes the app. Max length is 100 characters.

prefilled_formdataarray

Data pre-filled by platform during new user signup.

prefilled_formdata.fieldstring

the field name of pre filled form data

email, first_name, last_name, mobile_number, business_name, country, contact_name

prefilled_formdata.valuestring

The field value of pre-filled form data.

prefilled_formdata.verifiedboolean

Whether the platform has verified the value.

prefilled_formdata.editableboolean

Whether the user can edit the value.

scale_connectobject

Scale connect parameters, if invitation link mode is scale_connect

scale_connect.redirect_uristring

The platform callback URL redirected to after scale connect.

urlstring

URL provided by Airwallex for the end user to use in order to complete their OAuth 2.0 authorization.

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/accounts/invitation_links/{id}
$curl --request GET \
> --url 'https://api-demo.airwallex.com/api/v1/accounts/invitation_links/invitation_link_id' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json'
Response (200 OK)
1{
2 "account_id": "acct_hm-QFRVYO4-InXeIsCPKOg",
3 "created_at": "2021-07-13T15:56:57.006071Z",
4 "expire_at": "2021-08-12T15:56:57.006071Z",
5 "id": "link_V8CoOYobPMyBKyL-S59DtA",
6 "identifier": "2fe425fd",
7 "metadata": {
8 "id": "1"
9 },
10 "mode": "oauth2",
11 "oauth2": {
12 "redirect_uri": "https://oauth.pstmn.io/v1/callback",
13 "response_type": "code",
14 "scope": [
15 "r:awx_action:balances_view",
16 "r:awx_action:settings.account_details_view"
17 ],
18 "state": "xcoiv98y2kd22vusuye3kch"
19 },
20 "prefilled_formdata": [
21 {
22 "field": "email",
23 "value": "[email protected]",
24 "verified": true,
25 "editable": false
26 }
27 ],
28 "scale_connect": {
29 "redirect_uri": "https://www.pstmn.io/v1/callback"
30 },
31 "url": "https://demo.airwallex.com/connect/scale?invitationId=link_V8CoOYobPMyBKyL-S59DtA"
32}
Was this section helpful?