> ## Documentation Index
> Fetch the complete documentation index at: https://pay3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /api/approvals/:txId/approve — Approve a Transaction

> POST /api/approvals/:txId/approve — approves a pending transaction and submits it to the Stellar network, returning the updated transaction record.

Approve a transaction that is waiting in the manual review queue. Once you call this endpoint, Pay3 immediately signs the Stellar transaction envelope and broadcasts it to the network — no further action is needed on your part. The response is the updated transaction record, which will include the Stellar transaction hash once the network confirms the payment. Approval requests expire 2 minutes after they are created, so act promptly after retrieving the pending list.

## Endpoint

```
POST /api/approvals/:txId/approve
```

## Authentication

All requests must include a valid bearer token in the `Authorization` header, or a `pay3_session` cookie obtained during wallet authentication.

```
Authorization: Bearer <token>
```

## Path parameters

**txId** `string` *required*

The UUID of the **transaction** to approve. Obtain this from the `transactionId` field in [GET /api/approvals/pending](https://pay3.mintlify.site/api-reference/approvals/list.md).

## Request body

No request body is required.

## Response

Returns the updated transaction record after submission. The shape mirrors the objects returned by [GET /api/transactions/:id](https://pay3.mintlify.site/api-reference/transactions/get.md).

**id** `string` *required*

UUID of the transaction.

**status** `string` *required*

Updated transaction status. Will be `SUBMITTING` immediately after approval while the Stellar network processes the payment, and will eventually transition to `SUCCESS` or `FAILED`.

**stellarTransactionHash** `string`

The Stellar transaction hash. Populated once the transaction reaches `SUCCESS`. May be `null` if the network confirmation has not yet been received at the time the response is returned — poll [GET /api/transactions/:id](https://pay3.mintlify.site/api-reference/transactions/get.md) to retrieve the final hash.

**action** `string` *required*

Always `TRANSFER` for transactions that pass through the approval queue.

**asset** `string` *required*

Asset code transferred.

**amount** `string` *required*

Transfer amount as a decimal string.

**recipientAddress** `string` *required*

Destination Stellar G-address.

**policyDecision** `string` *required*

Always `PENDING_APPROVAL` for transactions that went through the approval queue.

**completedAt** `string`

ISO 8601 timestamp when the transaction reached `SUCCESS`. `null` if network confirmation is still pending.

## Error responses

| Status | Meaning |
| - | - |
| `400 Bad Request` | The provided `txId` is not a valid UUID. |
| `401 Unauthorized` | Missing or invalid bearer token. |
| `404 Not Found` | No pending approval request exists for the given `txId`, it does not belong to your account, or it has already been acted upon. |
| `410 Gone` | The approval request has expired (the 2-minute window elapsed before you approved). The transaction status is now `EXPIRED`. |

> [!WARNING]
>
> **Approval is irreversible.** The moment you call this endpoint the transaction is signed and submitted to the Stellar network. Funds will leave your smart account immediately. There is no undo — Stellar transactions are final. Verify the `amount`, `asset`, and `recipientAddress` in the [pending approvals list](https://pay3.mintlify.site/api-reference/approvals/list.md) before approving.

## Example request

```bash theme={null}
curl -X POST https://api.pay3.dev/api/approvals/c3b2a1f0-9876-5432-fedc-ba0987654321/approve \
  -H "Authorization: Bearer <token>"
```

## Example response

```json theme={null}
{
  "id": "c3b2a1f0-9876-5432-fedc-ba0987654321",
  "action": "TRANSFER",
  "asset": "USDC",
  "amount": "75.0000000",
  "recipientAddress": "GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "recipientInput": "GBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "status": "SUCCESS",
  "policyDecision": "PENDING_APPROVAL",
  "stellarTransactionHash": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
  "rejectionReason": null,
  "aiSessionId": "e3b0c442-98fc-1c14-9afb-f4c8996fb924",
  "createdAt": "2025-07-08T14:30:00.000Z",
  "completedAt": "2025-07-08T14:30:07.345Z"
}
```

## Example error response — expired approval

```json theme={null}
{
  "error": "Gone",
  "message": "This approval request has expired and can no longer be acted on."
}
```

> [!NOTE]
>
> If `stellarTransactionHash` is `null` in the response, the Stellar network confirmation is still pending. Retrieve the final state — including the hash once confirmed — via [GET /api/transactions/:id](https://pay3.mintlify.site/api-reference/transactions/get.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.