Managing Multiple MerchantIds
Aeropay Merchant IDs
Every merchant in Aeropay is given a unique merchantId value. If your platform or brand requires an integration with multiple merchantIds within the same platform, you can follow the guidance below on how to handle this flow.
Example Use Cases
- Sportsbook platform operates in a number of jurisdictions, defined by state lines. Each of these jurisdictions has a different bank account, so they must be treated as different Aeropay merchants. Users have a single login to this Sportsbhook platform, but will pay different Aeropay merchants depending on their location. Given these MIDs are separated by location, a use case like this is less likely to have users paying at multiple MIDs.
- E-commerce marketplace hosts multiple companies' inventory on its platform. Users have a single login to this marketplace and can make payments with Aeropay at any of the merchants. Given these MIDs are hosted on the same marketplace and can be interchanged easily, a use case like this is more likely to have users paying at multiple MIDs.
Creating Users at Multiple MIDs
When Aeropay users are created via POST /user, a merchant-scoped token is used. During user creation, the user is "associated" to that underlying merchant. This means that in a use case of multiple merchantIds for a given platform, a user must be "created" at each of the merchantIds. If a user is not created at a given merchant, the user will not be "associated" with that merchant, and you will receive an error when trying to fetch a userForMerchant token.
As a result, there are two recommendations for how to handle creating users across multiple MIDs. For the use cases below, let's say there are two merchantIds: MID 1234 and MID 7890
- When the user first signs up with Aeropay, they want to make a payment to MID 1234. Because you expect users to often make payments at both MIDs, it makes sense to create the user at both MIDs upfront.
- Call POST /user with the 1234 merchant-scoped token.
- Ensure you have the
X-API-Header: 1.1set
- Ensure you have the
- If a network user, follow the steps to POST /confirmUser
- Immediately after a successful call to POST /user or POST /confirmUser, make a second call to POST /user with the 7890 merchant-scoped token.
- Given this user will now be a "network user", order to not force a double MFA on this user, you should call POST /user for the second merchant with the
X-API-Header: 1.0. This will bypass the confirmUser MFA step so the user is not forced to enter an Aeropay MFA code multiple times.
- Given this user will now be a "network user", order to not force a double MFA on this user, you should call POST /user for the second merchant with the
- Complete the steps for the user to make a payment
// Create user at first merchant with 1.1 header
curl --request POST \
--url https://api.sandbox-pay.aero.inc/user \
--header 'Content-Type: application/json' \
--header 'X-API-Version: 1.1' \
--header 'accept: application/json' \
--header 'authorizationToken: Bearer {{merchant token 1234}}' \
--data '
{
"first_name": "Stephanie",
"last_name": "Jones",
"phone_number": "+11234567890",
"email": "[email protected]"
}
'
// If network user, confirm the user
curl --request POST \
--url https://api.sandbox-pay.aero.inc/confirmUser \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'authorizationToken: Bearer {{merchant token 1234}}' \
--data '
{
"userId": "USER ID",
"code": "12345",
"phone_number": "+13245558998"
}
'
// If above successfull, create user at second merchant, with 1.0 header
curl --request POST \
--url https://api.sandbox-pay.aero.inc/user \
--header 'Content-Type: application/json' \
--header 'X-API-Version: 1.0' \
--header 'accept: application/json' \
--header 'authorizationToken: Bearer {{merchant token 7890}}' \
--data '
{
"first_name": "Stephanie",
"last_name": "Jones",
"phone_number": "+11234567890",
"email": "[email protected]"
}
'
Reporting for Multiple MIDs
Transaction Reports
Aeropay's SFTP and analytics dashboard reports are split out by merchantId. For a given platform, we are able to provide both an individual merchantId view of the merchant portal, analytics dashboard, and SFTP report. We are also able to provide a roll-up view of this information for simplicity, depending on your preference. Please reach out to your Aeropay Client Success Manager to make these configurations.
Webhooks and API Reports
Please note you will also have to subscribe to all webhook topics for each merchantIds, as webhook topic subscriptions are scoped at the merchant level. Any API-based transaction reports that your team pulls will also have to be done for all merchantIds.
Updated about 2 months ago
