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://api.sandbox-pay.aero.inc/v2/payoutTransaction

Production - POST https://api.aeropay.com/v2/payoutTransaction

Request parameters

ParameterRequired?TypeDescription
userIdYesStringThe userId of the user receiving the payout, in uuid format.
amountYesStringDictionary with currency and amount in pennies. Only USD supported at this time. Amount maximum limit: Default setting for configured in merchant portal or as defined in your Aeropay agreement.
Amount minimum limit: $0.01.
merchantIdYesIntegerYour merchantId.
bankAccountIdNoStringThe bankAccountId from the user created in the previous step. You can also retrieve this Id by calling the GET /user endpoint.
referenceIdNoStringThis unique uuid value will be associated with the transaction, and can be used to associate Aeropay transactions with your own system.
It is recommended to use a UUID value according to the standard methods (ISO/IEC 9834-8)
rtpNoBoolean

If true, payout will be attempted as RTP. If the user's bank is not participating in the RTP/FedNow networks, Aeropay will automatically waterfall the payout to same-day ACH.

If false, payout will be sent as same-day ACH.

attributesnoObjectDictionary with attributes. Tip is a standard format. Custom attributes must follow value/description dictionary formatting.
🚧

Character limit for referenceId and attributes is 64 characters.

Code Example - Request

curl --request POST \
     --url https://api.sandbox-pay.aero.inc/v2/payoutTransaction \
     --header 'Content-Type: application/json' \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {{merchant token}}' \
     --header 'Idempotency-Key: 123e4567-e89b-12d3-a456-426614174000' \
     --data '
{
  "userId": "bc81e829-d35b-43cb-acb9-d218674878be",
  "bankAccountId": 27381938,
  "amount": {
      "currency": "USD",
      "amount": 10
  },
  "merchantId" : 12345,
  "rtp": true,
  "referenceId": "newReferenceID-TestingEA"
}
'
🚧

ReferenceId

ReferenceIds are used to associate Aeropay transactions with your own system.

🔑

Idempotency-Key

Optional UUID value to ensure idempotent transaction.

Code Example - Response

{
  "transaction": {
    "id": "553a5141-2b9b-4d52-911c-f63d5ade35de",
    "amount": {
      "amount": 10,
      "currency": "USD"
    },
    "status": "pending",
    "paymentType": "payout",
    "userId": "bc81e829-d35b-43cb-acb9-d218674878be",
    "isRtp": true,
    "merchantId": 12345,
    "title": "Online Transaction",
    "referenceId": "newReferenceID-TestingEA",
    "locationId": 2,
    "userAccountId": 4336
  }
}

What’s Next

Did this page help you?