---
updatedAt: 2026-08-05T19:17:03.000Z
agentTools:
  projectIndex: https://dev.aero.inc/llms.txt
---

# 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.

<Callout icon="👍" theme="okay">
  ### 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**
</Callout>

## Step 6A - Capture the Preauth Transaction

### HTTP request

**Sandbox** - `POST https://api.sandbox-pay.aero.inc/v2/capturePreauthTransaction`<br />**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 <support@aeropay.com>.   |
| 200         | AP302      | User has insufficient funds for transaction                        | Add funds to account or reach out to <support@aeropay.com> for more information.             | Available balance does not meet requirement - contact <support@aeropay.com> 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 <support@aeropay.com> 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

```asp curl
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

```json
{
    "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": "begona.andresm@aeropay.com",
        "merchantId": 1057,
        "userAccountId": 1717,
        "locationId": 1147
    }
}
```

<Callout icon="👍" theme="okay">
  ### 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.
</Callout>

## 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.

<Callout icon="📘" theme="info">
  ### To create a webhook subscription, visit our API Guide

  [Refer to this page](https://dev.aero.inc/docs/subscriptions)
</Callout>