# Pre-Autorización

<div align="left"><figure><img src="https://3635475909-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MIa0RFEe6TfbpnP9FlP-887967055%2Fuploads%2FUyitxSAu5fQ9nSghMaDh%2FAn%CC%83adir%20un%20ti%CC%81tulo.png?alt=media&#x26;token=b29b7e7a-3d52-4b3e-9b0a-69f35c73528f" alt=""><figcaption></figcaption></figure></div>

{% hint style="success" %}
**Producción**: [https://api.payvalida.com/v4/merchant/preauthorization](https://api.payvalida.com/v4/preauthorization)
{% endhint %}

{% hint style="success" %}
**Sandbox**: <https://api-test.payvalida.com/v4/merchant/preauthorization>
{% endhint %}

{% tabs %}
{% tab title="Request" %}

<table><thead><tr><th width="189">Campo</th><th width="111">Requerido</th><th width="103">Tipo</th><th width="202">Descripción</th></tr></thead><tbody><tr><td>merchantName</td><td>sí</td><td>string</td><td>Nombre del merchant</td></tr><tr><td>orderId</td><td>sí</td><td>string</td><td>Id de la orden creado por el merchant previamente en el <a href="https://docs.payvalida.com/api-recaudo/ordenes-de-compra/registrar">API Recaudo</a></td></tr><tr><td>checksum</td><td>sí</td><td>string</td><td>sha512(merchantName + orderId + fixed_hash)</td></tr><tr><td>amount</td><td>sí</td><td>string</td><td>Monto por el cual se va a realizar la pre-autorización</td></tr><tr><td>token</td><td>sí</td><td>string</td><td>Identificador del token creado anteriormente para la tarjeta</td></tr><tr><td>typeDi</td><td>no</td><td>string</td><td>Tipo de documento del usuario.<br><br><strong>Colombia</strong>:<br>CC,CE,PP,NIT</td></tr><tr><td>di</td><td>no</td><td>string</td><td>Número de documento de usuario</td></tr></tbody></table>

{% endtab %}

{% tab title="Request (ejemplo)" %}

```json
{
"merchantName": "my_merchant_name",
"orderId": "1234567890",
"checksum":"90037d4ae7d310c1c4c50ce630c54af850587533a900099cde381ac68aa8af1cc959b9820e77a48fb403c460a8630729bc37e2a9d47be9e3e846982fa7c56de0",
"amount": 70500.00,
"token": "12345678901234",
"typeDi": "CC",
"di": "1234567890",
}
```

{% endtab %}

{% tab title="Response" %}

<table><thead><tr><th width="328">CODE</th><th>DESC</th></tr></thead><tbody><tr><td>0000</td><td>APPROVED</td></tr><tr><td>0001</td><td>REJECTED</td></tr><tr><td>0010</td><td>wrong request</td></tr><tr><td>0011</td><td>invalid request</td></tr><tr><td>0012</td><td>payment invalid</td></tr><tr><td>0013</td><td>the reference is not registered or is invalid</td></tr><tr><td>0016</td><td>error processing transaction</td></tr></tbody></table>
{% endtab %}

{% tab title="Response (ejemplo)" %}

```json
{
    "CODE": "0000",
    "DESC": "APPROVED"
}
```

{% endtab %}
{% endtabs %}
