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) Integrations

If 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

ParameterRequired?TypeDescription
idYesStringThe uuid of the existing Preauth Transaction

Error Codes

HTTP StatusError CodeMeaningResolutionMessage
200AP009Not authorized to update transactionCheck id parameter is accurateUnauthorized
200AP300Unable to connect to user bank accountConfirm bank connection was not removed. Reconnect bank if persistsWe're having issues connecting to your bank. Please reconnect or contact [email protected].
200AP302User has insufficient funds for transactionAdd funds to account or reach out to [email protected] for more information.Available balance does not meet requirement - contact [email protected] for more information.
200AP312Preauth has already been capturedTransaction has already been captured. Nothing needs to be donePreauth has already been captured by Transaction #{transactionId}
200AP313Preauth capture ineligible. It has either expired or been canceledCreate a new preauth transaction or reach out to [email protected] for more information.Preauthorized Transaction with status of {status} not eligible for capture
200AP700Missing required parameterProvide 'id' parameterMissing 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.

📘

To create a webhook subscription, visit our API Guide

Refer to this page


Did this page help you?