> For the complete documentation index, see [llms.txt](https://vitawallet.gitbook.io/vita-business-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vitawallet.gitbook.io/vita-business-documentation/gestion-de-transacciones/listar-transacciones.md).

# Listar transacciones

## List Transactions

<mark style="color:blue;">`GET`</mark> `api.vitawallet.io/api/businesses/transactions?page=:page&count=:count`

Este método permite listar todas las transacciones de un negocio, soporta paginación y filtros.

#### Path Parameters

| Name               | Type   | Description                                                                                                                                                                                                                                       |
| ------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sender\_wallet     | string | Filtrar transacciones por la wallet (**UUID**) que envía la transacción.                                                                                                                                                                          |
| recipient\_wallet  | string | Filtrar transacciones por la wallet (**UUID**) que recibe la transacción.                                                                                                                                                                         |
| status             | string | <p>Filtrar transacciones por el estado de la transacción.<br><br>Estados soportados:<br>- <strong>started</strong><br>- <strong>completed</strong><br>- <strong>pending</strong><br>- <strong>denied</strong><br>- <strong>processed</strong></p> |
| transactions\_type | string | Filtrar transacciones por el tipo de transacción.                                                                                                                                                                                                 |
| currency           | string | <p>Filtrar transacciones por una determinada moneda.<br><br>Moneda soportada:<br><strong>clp</strong> (pesos chilenos)</p>                                                                                                                        |
| count              | number | <p>Cantidad de transacciones.<br><strong>default: 20</strong></p>                                                                                                                                                                                 |
| page               | number | Numero de pagina.                                                                                                                                                                                                                                 |

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

```
{
    "transactions": [
        {
            "id": "1",
            "type": "business_transaction",
            "attributes": {
                "recipient_wallet": {
                    "token": "i789iuji78oi78",
                    "uuid": "0748559-2e50-43f1-b4c0-0196de0295db",
                    "balances": {
                        "clp": 12000
                    },
                    "is_master": true,
                    "created_at": "2020-01-15T20:37:17.926Z"
                },
                "sender_wallet": null,
                "status": "completed",
                "order": "12345678901010000121234",
                "currency": "clp",
                "category": "recharge",
                "amount": "12000.0",
                "total": "12000.0",
                "fee_value": "0.0",
                "total_fee": "0.0",
                "created_at": "2020-03-24T20:37:17.926Z"
            }
        },
        {
            "id": "2",
            "type": "business_transaction",
            "attributes": {
                "recipient_wallet": {
                    "token": "iops87eopss478oios",
                    "uuid": "023d6e20-2e50-43f1-b4c0-0196de0295db",
                    "balances": {
                        "clp": 20000
                    },
                    "is_master": false,
                    "created_at": "2020-02-05T20:37:17.926Z"
                },
                "sender_wallet": null,
                "status": "completed",
                "order": "123456789010100001212347",
                "currency": "clp",
                "category": "recharge",
                "amount": "20000.0",
                "total": "20000.0",
                "fee_value": "0.0",
                "total_fee": "0.0",
                "created_at": "2020-03-24T20:44:32.994Z"
            }
        }
    ],
    "total": 2,
    "count": 20
}
```

{% endtab %}
{% endtabs %}

### SDK

{% tabs %}
{% tab title="Node" %}
Note que el método **get** puede recibir un parámetro opcional, que ayuda a identificar el número de página que desea obtener y la cantidad de elementos.

```javascript
import Business from 'vita-business-node';

try {
    const transactions = await Business.transactions().get({page, count});
} catch {}
```

{% endtab %}
{% endtabs %}

## Get Transaction

<mark style="color:blue;">`GET`</mark> `api.vitawallet.io/api/businesses/transactions/:id`

Este método permite obtener la información de una transacción mediante su id.

#### Path Parameters

| Name | Type   | Description           |
| ---- | ------ | --------------------- |
| id   | string | Id de la transacción. |

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

```
{
    "transaction": {
        "id": "1",
        "type": "business_transaction",
        "attributes": {
            "recipient_wallet": {
                "token": "i789iuji78oi78",
                "uuid": "0748559-2e50-43f1-b4c0-0196de0295db",
                "balances": {
                    "clp": 12000
                },
                "is_master": true,
                "created_at": "2020-01-15T20:37:17.926Z"
            },
            "sender_wallet": null,
            "status": "completed",
            "order": "12345678901010000121234",
            "currency": "clp",
            "category": "recharge",
            "amount": "12000.0",
            "total": "12000.0",
            "fee_value": "0.0",
            "total_fee": "0.0",
            "created_at": "2020-03-24T20:37:17.926Z"
        }
    }
}
```

{% endtab %}
{% endtabs %}

### SDK

{% tabs %}
{% tab title="Node" %}
Note que el módulo **transactions** puede recibir ahora el id de la transacción a buscar.

El método **get** es el encargado de hacer la solicitud a los servicios de Vita Business

```javascript
import Business from 'vita-business-node';

try {
    const transactions = await Business.transactions(id).get();
} catch {}
```

{% endtab %}
{% endtabs %}
