# Pre Authorization

Reserve a fixed amount on a payment mean.

* The amount you want to debit may **be lower** than the reserved amount, but **not higher**
* Chargingthe pre authorisation works with **certainty**
* Pre Authorizations last around **5 days** (this duration depends on the issuer)

{% hint style="warning" %}
Not all payment provider support pre-authorizations.\
Visit our [PSP Feature](https://docs.payrexx.com/merchant/bezahldienste/funktionsmatrix) article to find a suitable payment provider.
{% endhint %}

## Process

### Gateway Creation

Pre-authorizations can easily be implemented using the Payrexx Gateway.\
Use the parameter **reservation** to do so.

{% content-ref url="/pages/-Mguz7bjqS3lWfKhQ2HU" %}
[Build Your Gateway](/developer/guides/gateway/build.md)
{% endcontent-ref %}

### Customer Authorization

This step is identical to the "payment" step in the [Gateway documentation](/developer/guides/gateway/build.md#payment).\
With a pre-authorization, the only difference is that the amount is not debited but reserved.

Also a [transaction webhook](broken://pages/-MdH-49ly2WkM5gq1xze) with the transaction status **reserved** will be triggered.

### Charge Reserved Amount

#### Get Transaction ID

The transaction ID is present in the [transaction Webhook](broken://pages/-MdH-49ly2WkM5gq1xze)*.*

You can find this ID also if you [retrieve a Gateway](https://developers.payrexx.com/reference#retrieve-a-gateway) through the Payrexx API.\
Small hint on where to find the transaction ID in the retrieve a Gateway respone:

```yaml
{
    "status": "success",
    "data": [
        {
            "id": 1,
            "status": "reserved",
            "invoices": [
                {
                    "transactions": [
                        {
                            "id": 2012844,
                        }
                    ],
                }
            ],
        }
    ]
}
```

#### Execute Charge

Use [Charge a Pre-Authorized/Reserved Transaction](https://developers.payrexx.com/reference-link/charge-a-pre-authorized-reserved-transaction) to make a charge on the reserved transaction. You will need the ID of the transaction with status "reserved" to do so!

{% hint style="warning" %}
There is no possibility to make further charges using this authorized transaction.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payrexx.com/developer/guides/gateway/payment-types/pre-authorization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
