# Obtener Redes

## Entornos disponibles

* **Producción**: `https://api.payvalida.com/api/v4/merchants/nets`
* **Sandbox**: `https://api-test.payvalida.com/api/v4/merchants/nets`

Todas las peticiones deben autenticarse mediante un **checksum** (query parameters), el cual se construye utilizando el algoritmo `SHA-512` con la siguiente estructura:

```
checksum = SHA512(merchant + timestamp + fixedhash)
```

Donde:

* `merchant`: Nombre del comercio asignado por Payválida.
* `timestamp`: Marca de tiempo en formato ISO 8601 (Ejemplo: 2025-06-09T15:29:35.437Z)
* `fixedhash`: Valor fijo confidencial proporcionado al comercio por Payválida.

{% hint style="danger" %}
Es fundamental mantener el `fixedhash` seguro. No debe ser expuesto en el frontend ni compartido con terceros.
{% endhint %}

***

#### Headers requeridos

```http
Content-Type: application/json
Accept: application/json
```

#### Parámetros de consulta (query parameters)

| Parámetro | Tipo   | Requerido | Descripción                                    |
| --------- | ------ | --------- | ---------------------------------------------- |
| merchant  | string | Sí        | Identificador del comercio.                    |
| timestamp | string | Sí        | Marca de tiempo en formato UNIX epoch.         |
| checksum  | string | Sí        | SHA-512 de `merchant + timestamp + fixedhash`. |

#### Ejemplo de solicitud

```http
GET https://api-test.payvalida.com/api/v4/merchants/nets?merchant=kuanto&timestamp=2025-06-09T15:29:35.437Z&checksum=abc123...
Content-Type: application/json
Accept: application/json
```

#### Respuesta exitosa

```json
{
  "CODE": "0000",
  "DESC": "OK",
  "DATA": {
    "total": 2,
    "nets": [
      {
        "id": 1,
        "name": "RED_EJEMPLO",
        "tradeName": "Red ejemplo 1 LTDA",
        "imageUrl": "https://imagespayvalida.com/foobar.png",
        "cashin": {
          "number": "102030",
          "instructions": "Indica en el cajero el número de convenio: 102030||Luego sigue las instrucciones en pantalla para completar el pago."
        }
      },
      {
        "id": 2,
        "name": "RED_EJEMPLO_2",
        "tradeName": "Red ejemplo 2 S.A.",
        "imageUrl": "https://imagespayvalida.com/foobar2.png",
        "cashin": {
          "number": "102031",
          "instructions": "Recuerda mencionar al cajero el número de convenio: 102031||Asegúrate de seguir las instrucciones que te proporcionen para completar el pago."
        }
      }
    ]
  }
}
```

#### Campos de la respuesta

* `CODE`: Código de respuesta. `"0000"` indica éxito.
* `DESC`: Descripción del resultado.
* `DATA.total`: Número total de redes disponibles.
* `DATA.nets`: Arreglo de objetos que representan cada red.

Cada red contiene:

<table><thead><tr><th>Campo</th><th width="87.94921875">Tipo</th><th width="264.15234375">Descripción</th><th>Puede llegar vacío</th></tr></thead><tbody><tr><td>id</td><td>integer</td><td>ID interno de la red.</td><td>No</td></tr><tr><td>name</td><td>string</td><td>Nombre de la red.</td><td>No</td></tr><tr><td>tradeName</td><td>string</td><td>Nombre comercial de la red.</td><td>No</td></tr><tr><td>imageUrl</td><td>string</td><td>URL logo de la red</td><td>Si</td></tr><tr><td>cashin.number</td><td>string</td><td>Número de convenio.</td><td>No</td></tr><tr><td>cashin.instructions</td><td>string</td><td>Instrucciones para el usuario final. Las instrucciones incluyen saltos de línea, estos serán representados por dos pipes seguidos (<code>||</code>) en la respuesta. Por ejemplo: "PENDIENTE\nA PROCESAR" se entregará como "PENDIENTE||A PROCESAR".</td><td>Si</td></tr></tbody></table>

***

#### Ejemplo en cURL

```bash
curl -X GET "https://api-test.payvalida.com/api/v4/merchants/nets?merchant=kuanto&timestamp=2025-06-09T15:29:35.437Z&checksum=abcdef1234567890" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json"
```

***

### Posibles errores

La API puede responder con los siguientes códigos de error en caso de solicitudes malformadas o fallas internas. Todos los errores mantienen la misma estructura de respuesta, cambiando los valores de `CODE` y `DESC`.

#### Formato de error

```json
{
  "CODE": "0001",
  "DESC": "Invalid body"
}
```

#### Tabla de errores

| CODE | DESC                  | Descripción                                               |
| ---- | --------------------- | --------------------------------------------------------- |
| 0001 | Invalid body          | La estructura de los parámetros enviados no es válida.    |
| 0002 | Internal server error | Error interno del servidor. Intente nuevamente más tarde. |


---

# 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.payvalida.com/api-marca-blanca-efectivo-espanol/metodo/obtener-redes.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.
