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

# Authorization Updates

> Simulate authorization updates on existing transactions, such as when a merchant adjusts the amount before settlement.

<Warning>
  **Beta Feature**

  The Transaction Simulations feature is currently in beta. API endpoints and behavior may change as we continue to refine the product. Simulation endpoints are available in development environments only — production returns `404 Not Found`.
</Warning>

Simulate an authorization update on an existing transaction — for example, when a merchant adjusts the amount before settlement. This simulates an ISO 0120 authorization update message.

Use this to test how your integration handles authorization amount changes, such as a restaurant adding a tip or a gas station adjusting the final pump amount.

## Endpoint

```
PATCH /v1/simulate/transactions/:transactionId/authorize
```

## Path parameters

| Parameter       | Type          | Required | Description                                  |
| --------------- | ------------- | -------- | -------------------------------------------- |
| `transactionId` | string (UUID) | Yes      | The ID of an existing transaction to update. |

## Headers

| Header         | Type               | Required | Description                                                      |
| -------------- | ------------------ | -------- | ---------------------------------------------------------------- |
| `Api-Key`      | string             | Yes      | Your tenant API key. The tenant scope is resolved from this key. |
| `Content-Type` | `application/json` | Yes      | —                                                                |

## Body

| Field    | Type    | Required | Description                                                                          |
| -------- | ------- | -------- | ------------------------------------------------------------------------------------ |
| `amount` | integer | Yes      | The new transaction amount in cents (merchant currency). Must be a positive integer. |

```json title="Example request" theme={null}
{
  "amount": 6000
}
```

## Response

A successful response returns the transaction ID and status.

```json title="200 OK" theme={null}
{
  "transactionId": "f3a1c92e-1b3d-4d1e-bb22-12c0a4d5b8f9",
  "status": "authorized"
}
```

| Field           | Type          | Description                           |
| --------------- | ------------- | ------------------------------------- |
| `transactionId` | string (UUID) | The transaction ID.                   |
| `status`        | string        | The transaction status: `authorized`. |

## Errors

| Status                      | When                                                                                                                                                          |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `400 Bad Request`           | Invalid body (missing or negative `amount`), transaction already settled or closed, no card associated with the transaction, or the card has no processor ID. |
| `404 Not Found`             | Endpoint not available in production, simulations are not enabled for your tenant, or the transaction does not exist.                                         |
| `500 Internal Server Error` | Invalid currency or unhandled error during simulation.                                                                                                        |

## Behavior notes

* **Transaction must be open.** You can only update authorizations that have not yet settled or closed.
* **FX conversion applies.** The new amount is converted using the transaction's original merchant and billing currencies.
* **Triggers webhooks.** The update fires the same authorization update webhooks as a real update.

## Example

```bash theme={null}
curl -X PATCH https://api-dev.rain.xyz/v1/simulate/transactions/f3a1c92e-1b3d-4d1e-bb22-12c0a4d5b8f9/authorize \
  -H "Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 6000
  }'
```
