> For the complete documentation index, see [llms.txt](https://docs.payvalida.com/api-cashout/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payvalida.com/api-cashout/api-cashout-en/register/register-operation.md).

# Register Operation

## Register Operation

<mark style="color:green;">`POST`</mark> `https://api.payvalida.com/cashout/v1/operation`

`URL Sandbox: https://api-test.payvalida.com/v1`**`/operation/`**

This method registers a cashout operation, authorizing the delivery of cash to the requester

#### Request Body

| Name                    | Type   | Description                                                                                                                                                               |
| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| merchant                | string | ID of the commerce/merchant that owns the operation (Max 30 characters).                                                                                                  |
| checksum                | string | <p>Checksum encoded in SHA512<br>(merchant+operation+amount+currency+<br>document+FIXED\_HASH) (512 characters).</p>                                                      |
| operation               | string | Operation ID generated by the commerce/merchant. Must be unique (40 characters).                                                                                          |
| amount                  | number | <p>Operation amount (20 characters)<br><br><strong>\*In Peru it must only contain one decimal digit</strong></p>                                                          |
| currency                | string | ISO code of the currency of the operation (3 characters)                                                                                                                  |
| description             | string | Short description of the operation (Max 50 characters)                                                                                                                    |
| document                | number | ID of the end user that executes the operation (Max 20 characters)                                                                                                        |
| otpLength               | number | Length of the OTP (default 4, 4 <= otpLength <= 12) (between 4 and 12 characters)                                                                                         |
| expire                  | string | Expiration date of the operation (YYYY-MM-DD format, default 30 days) (8 characters).                                                                                     |
| transactionCost         | number | Amount the commerce will charge the user for the operation (default 0) (Max 10 characters).                                                                               |
| beneficiaryDocumentType | string | <p>Type of document of the person who will receive the money.<br>Allowed values Peru:<br>- DNI<br>- RUC<br>- CE<br><br><strong>\*Required for Peru merchants</strong></p> |
| beneficiaryName         | string | <p>Name of the person whom will receive the money.<br><br><strong>\*Required for Guatemala and Peru merchants</strong></p>                                                |
| beneficiaryLastName     | string | <p>Lastname of the person whom will receive the money.<br><br><strong>\*Required for Ecuador and Peru merchants</strong></p>                                              |
| email                   | string | <p>email of the person whom will receive the money.<br><br><strong>\*Required for Peru merchants</strong></p>                                                             |
| cellphone               | string | <p>cellphone without indicative of the person whom will receive the money.<br><br><strong>\*Required for Peru merchants</strong></p>                                      |

{% tabs %}
{% tab title="200 Returns a JSON following this structure:" %}

```
{  
   "code":"0000",
   “text”:”OK”,
   "data":{  
      "amount":"150000.0",
      “transactionCost”:”2000.0”,
      "currency":"COP”,
      "description":"Retiro de intereses al 15092019",
      "document":"1001007878",
      "otp":"*********",
      “operation”:”1452782”,
      “expire”:”2019-12-31”
      “payvalidaCode”:1234567890,
      “balance”:900234900,
   }
}
```

{% endtab %}

{% tab title="Request Example Peru" %}

```json
{
    "merchant": "kuanto_pe",
    "beneficiaryName": "jhon",
    "beneficiaryLastName": "doe",
    "beneficiaryDocumentType": "RUC",
    "operation": "test-globokas-105",
    "amount": 13.3,
    "currency": "PEN",
    "description": "description test globokas 105",
    "document": "48764951234",
    "cellphone": "987654321",
    "email": "test@test.com",
    "expire": "2024-04-28",
    "checksum": "2ad8a93af77184a42c735143db57fb443eaa2656d29e88d293e9448c75142b5442d91aed293c42ca6aa241ad65c1fd293ca1cb38c344c0f6e89580be07be4d5d"
}
```

{% endtab %}
{% endtabs %}

## **Response data**

**code:** Code of the result, "0000" indicates success, any other indicates an error&#x20;

**text:** Contains the message associated with the **code** that was sent.&#x20;

**data:** Contains the transaction data (for successful results)&#x20;

* **amount:** Transaction amount &#x20;
* **transactionCost:** The cost the user assumes for executing the transaction&#x20;
* **currency:** Registered currency for the cashout operation&#x20;
* **description:** Description of the operation&#x20;
* **document:** Identification number&#x20;
* **otp:** Generated OTP for the operation (If the SMS parameter is true, this value is not provided)&#x20;
* **operation:** Operation ID, generated by the commerce/merchant&#x20;
* **expire:** Expiration date of the operation &#x20;
* **payvalidaCode:** Operation ID in Payvalida&#x20;
* **balance:** Available balance for operations&#x20;

{% hint style="info" %}
The CURRENCY parameter only accepts USD and the local currency, corresponding to the country where the commerce was registered. If USD is received, the system automatically converts it to the local currency.
{% endhint %}

All registered operations start with a **PENDIENTE** (pending) status.

{% hint style="warning" %}
The "expire" field indicates the date on which withdrawals cannot be made.
{% endhint %}
