Step 4 - Create a Payout
Create a Payout to your User
Now that you have linked a bank account from your user, you will be able to create a payout transaction, which moves funds from your merchant bank account to the user. These types of transactions may be used for withdrawals or rewards.
You will need to retrieve the user to check for their linked bank account. Refer to the previous step to learn more.
Create the Payout Transaction
HTTP request
Sandbox - POST https://staging-api.aeropay.com/payoutTransaction
Production - POST https://api.aeropay.com/payoutTransaction
Request parameters
Parameter | Required? | Type | Description |
---|---|---|---|
bankAccountId | No | String | The bankAccountId from the user created in the previous step. You can also retrieve this Id by calling the GET /user endpoint. |
userId | Yes | String | The userId of the user receiving the payout. |
amount | Yes | String | Amount of money. Maximum limit: Default setting for configured in merchant portal or as defined in your Aeropay agreement. Minimum limit: $0.01. |
uuid | Yes | String | This unique uuid value will be associated with the transaction, and can be used to associate Aeropay transactions with your own system. Required for X-AP-Version: 2023-06-05. Please note, you must generate the UUID according to the standard methods (ISO/IEC 9834-8) |
merchantId | Yes | String | Your merchantId. |
Code Example - Request
curl --request POST \
--url https://staging-api.aeropay.com/payoutTransaction \
--header 'Content-Type: application/json' \
--header 'X-AP-Version: 2023-06-05' \
--header 'accept: application/json' \
--header 'authorizationToken: Bearer {{token}}' \
--data '
{
"userId": "4567",
"amount": "10.99",
"bankAccountId": "27381938",
"merchantId": "143"
}
'
New transaction version!
As of 2023, we have added a new transaction version X-AP-Version: 2023-06-05 which is required for all clients to ensure the fastest and most efficient transaction creation.
Transaction UUIDs
Transaction uuids are used to associate Aeropay transactions with your own system, and must be unique to every transaction. Any transactions sent with duplicated uuids will be blocked by our system.
Code Example - Response
{
"success": true,
"error": null,
"amount": {
"currency": "USD",
"value": "10.99"
},
"merchantCategories": [
"NACHA"
],
"storeAddress": "2328 S Michigan Ave, Chicago, IL",
"attributes": [],
"uuid": "bc81e829-d35b-43cb-acb9-d218674878be",
"timestamp": "2023-09-07 17:50:08 UTC",
"merchantName": "Aeropay"
}
Updated 3 months ago