Step 6 - Capture a Preauth Transaction
Execute the Preauth Transaction to move funds
In the previous step, we created a Preauth Transaction to store the details of a future transaction.
In this step, we will now capture a preauthorized transaction, finalizing the movement of funds. The transaction keeps the same id throughout its lifecycle — capturing a preauth does not generate a new transaction id in v2.
The id of the Preauthorized Transaction object is included in the body to specify the preauthorizedTransaction being captured. The response will return that same id, now representing the finalized Aeropay Transaction.
Point of Sale (POS) IntegrationsIf you're using Aeropay preauthorized transactions for purchases with an point of sale (POS), we recommend listening to a callback from the POS that the order has been completed to trigger the call to Aeropay's POST /v2/capturePreauthTransaction
Step 6A - Capture the Preauth Transaction
HTTP request
Sandbox - POST https://api.sandbox-pay.aero.inc/v2/capturePreauthTransaction
Production - POST https://api.aeropay.com/v2/capturePreauthTransaction
Request parameters
| Parameter | Required? | Type | Description |
|---|---|---|---|
| id | Yes | String | The uuid of the existing Preauth Transaction |
Error Codes
| HTTP Status | Error Code | Meaning | Resolution | Message |
|---|---|---|---|---|
| 200 | AP009 | Not authorized to update transaction | Check id parameter is accurate | Unauthorized |
| 200 | AP300 | Unable to connect to user bank account | Confirm bank connection was not removed. Reconnect bank if persists | We're having issues connecting to your bank. Please reconnect or contact [email protected]. |
| 200 | AP302 | User has insufficient funds for transaction | Add funds to account or reach out to [email protected] for more information. | Available balance does not meet requirement - contact [email protected] for more information. |
| 200 | AP312 | Preauth has already been captured | Transaction has already been captured. Nothing needs to be done | Preauth has already been captured by Transaction #{transactionId} |
| 200 | AP313 | Preauth capture ineligible. It has either expired or been canceled | Create a new preauth transaction or reach out to [email protected] for more information. | Preauthorized Transaction with status of {status} not eligible for capture |
| 200 | AP700 | Missing required parameter | Provide 'id' parameter | Missing Required Parameter 'id' |
Code Example - Request
curl --request POST \
--url https://api.sandbox-pay.aero.inc/v2/capturePreauthTransaction \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'authorization: Bearer {{token}}' \
--data '{"id":"1253024f75-f7d1-45b7-8e4d-4449fed355ab34"}'Code Example - Response
{
"transaction": {
"id": "1253024f75-f7d1-45b7-8e4d-4449fed355ab34",
"amount": {
"currency": "USD",
"amount": 222
},
"status": "live",
"userId": "d5e17cbf-92ad-44e7-b483-19dba7adaaa4",
"description": "Online Transaction",
"attributes": {
"key": {
"value": "KEY VALUE",
"description": "KEY DESCRIPTION"
}
},
"createdDate": "2026-01-02T11:59:44+00:00",
"expiryDate": "2026-01-04T11:59:44+00:00",
"userName": "Begos Andres",
"userEmail": "[email protected]",
"merchantId": 1057,
"userAccountId": 1717,
"locationId": 1147
}
}
Notice the id in the response matches the id you passed in the request. Capturing a preauth in v2 does not create a separate transaction resource with its own id — it finalizes the same transaction, with the amount specified in the preauth.This differs from v1, where capture created a new, separate Aeropay Transaction id.
Step 6B - Handle Webhooks
If you have an active webhook subscription, you will receive the transaction_completed webhook immediately after the resource has been created.
Updated 7 days ago

