Creating Aeronetwork Users
In order to make use of Aeropay's user network and Aerosync's Aeronetwork SDKs, you'll need to first create users via API and access each user's aeropassuseruuid. Today, you can create users using Aeropass's POST /user endpoint to create a user's aeropassuseruuid
. Note, you'll need to use your Aeropay-specific token credentials to make this call.
Step 1: Get an Aeropay token
HTTP request
Sandbox - POST https://staging-api.aeropay.com/token
Production - POST https://api.aeropay.com/token
Request parameters
Parameter | Required? | Type | Description |
---|---|---|---|
api_key | Yes | String | API Key or user email |
api_secret | Yes | String | API Secret or user password |
scope | Yes | String | Type of token requested |
id | Yes | String | Merchant Id |
Code Example - Request
curl --request POST
--url <https://staging-api.aeropay.com/token>
--header 'Content-Type: application/json'
--header 'accept: application/json'
--data '
{
"scope": "merchant",
"api_key": "api-key-ab1341-asdflk3",
"api_secret": "api-secret-ab1341-asdflk3",
"id": "1456"
}
'
Code Example - Response
{
"TTL": 1800,
"token": "eyJ0eXAiOiJKN7YiLCJhbGciOiJIUzI1NiJ9.eyJhdXRoIjoiNDgiLCJzdWIiOiJtZXJjaGFudCIsImp0aSI6ImZhNGY2NzRmLTJkOTEtNGExNS05OTk3LTc1NWI2ZTYyZDhkYiIsImV4cCI6MTY5NDAzNTc2MSwidXNlcm5hbWUiOiJ1cy1lYXN0LTE6M2NlMjBiZDUtNzg03ZCRMjY5LWExM2UtZmM1MzIyMTk0NTAxIn0.3B1sdyVNpTW644RtpoGmQnRlp9PKGjrk91YUi0Uq2Os"
}
Step 2: Create a user
When creating a user, make sure you save the aeropass_user_uuid
value that is returned from POST /user in your database. This value will be used to reference the user when launching the Aeronetwork widget.
HTTP request
Sandbox - POST https://api.staging-pass.aeropay.com/user
Request parameters
Parameter | Required? | Type | Description |
---|---|---|---|
firstName | Yes | String | The User's first name as shown on their government ID Min xx characters Max xx characters |
lastName | Yes | String | The User's last name as shown on their government ID Min xx characters Max xx characters |
phoneNumber | Yes | String | The User's phone number Must be in international format (+11234567890) |
emailAddress | Yes | String | The User's email address Must be a valid email address |
Code Example - Request
curl --request POST \
--url https://api.staging-pass.aeropay.com/user \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data '
{
"firstName": "Jane",
"lastName": "Doe",
"phoneNumber": "+11234567890",
"emailAddress": "[email protected]"
}
Code Example - Response
{
"user": {
"pk": "AeroPassUser#2985b53c-0f7f-4622-a37d-36876d7187d6",
"sk": "details",
"aerouser_uuid": "2985b53c-0f7f-4622-a37d-36876d7187d6",
"aeropass_user_uuid": "2985b53c-0f7f-4622-a37d-36876d7187d6",
"phone_number": "+11234567890",
"email_address": [email protected],
"first_name": "Jane",
"last_name": "Doe"
},
"ttl": 1800,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uVHlwZSI6InVzZXJGb3JNZXJjaGFudCIsImV4cCI6MTczMTUzMTM3OSwicGhvbmUiOiIrMTYxNzkzOTE0MzMiLCJ1c2VybmFtZSI6InVzLWVhc3QtMTo1NThjYTE5My1mY2U4LTQ5NGItOGFhZC1iMzRjNTY0MWFiMGEiLCJzb3VyY2UiOiJhZXJvcGFzcyJ9.sJsZGyPB7WW8zlUPDXzPszxjFFRe01PInBma7mq-3qM"
}
Updated 3 days ago