> For the complete documentation index, see [llms.txt](https://docs.qentaz.com/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.qentaz.com/documentation/dispersiones/consultar-dispersion/consulta-por-referencia.md).

# Consulta por referencia

Esta consulta te permite obtener información detallada de una dispersión específica utilizando su código de identificación. Cada dispersión está vinculada a un comercio, por lo que es importante que el código de transacción coincida con tu comercio, de lo contrario no recibirás un resultado exitoso.

{% hint style="info" %}
El **`external_reference`** es un identificador único asignado a cada transacción, siendo esta la forma en que se distinguen en Trazo.
{% endhint %}

## Ruta

<mark style="color:green;">`GET`</mark> `/v1/merchant/payout/{external_reference}`

## **Encabezado**

<table><thead><tr><th width="244.60003662109375">Name</th><th>Description</th></tr></thead><tbody><tr><td><code>x-auth-token</code><mark style="color:red;">*</mark></td><td><p>Es el código generado a partir del proceso de autenticación.</p><p><em><code>Ejemplo: 8dsa819dj736f1d87fdhd172f12ddw</code></em></p></td></tr><tr><td><code>Content-Type</code><mark style="color:red;">*</mark></td><td><p>Es el tipo de contenido que se está enviando en la solicitud.</p><p><em><code>Ejemplo: application/json</code></em></p></td></tr><tr><td><code>child-id</code></td><td>Es el código de la cuenta que se busca administrar. Es opcional. Más info en el <a href="/pages/cmdh7wawmADehdqeF0JP#user-content-guia-de-uso-paso-a-paso-operar-en-nombre-de-una-cuenta-administrada">link</a><br><em><code>Ejemplo: negociohijo</code></em></td></tr></tbody></table>

## **Respuesta**

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

```json
{
    "status": "CANCELED",
    "amount": "20000.00",
    "channel": "EMAIL",
    "type": "payout",
    "currency": "COP",
    "description": "PRUEBA",
    "reference_one": "Referencia 1",
    "reference_two": "Referencia 2",
    "reference_three": "Referencia 3",
    "reference_four": "Referencia 4",
    "merchant_phone": null,
    "merchant_email": "prueba@trazo.com",
    "receiver": {
        "phone": "573112222333",
        "email": "diego@trazo.com",
        "first_name": "DIEGO",
        "last_name": "PEREZ",
        "id_type": "CC",
        "id_number": "12345678999"
    },
    "bank_account": {
        "entity": "Banco De Occidente",
        "type": "SAVINGS",
        "number": "9876543210",
        "reference": null
    },
    "approval": {
        "name": " ",
        "method": "TOKEN",
        "date": null
    },
    "updated_at": "2024-08-27T20:02:59.928Z"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "error": "No results were found for the search query. Please check the search parameters and try again."
}
```

{% endtab %}
{% endtabs %}

## Ejemplo

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

```bash
curl --location --request GET '{{base_url}}/v1/merchant/payout/{{external_reference}}' \
--header 'x-auth-token: {{token}}' \
--data-raw ''
```

{% endtab %}

{% tab title="NodeJs (Axios)" %}

```javascript
var axios = require('axios');
var data = '';

var config = {
  method: 'get',
  url: `${base_url}/v1/merchant/payout/${external_reference}`,
  headers: { 
    'x-auth-token': token //Añadir token
  },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = f"{base_url}/v1/merchant/payout/{external_reference}"

payload = ""
headers = {
  'x-auth-token': token #Añadir token
}

response = requests.request("DELETE", url, headers=headers, data=payload)
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.qentaz.com/documentation/dispersiones/consultar-dispersion/consulta-por-referencia.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
