> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meru.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Consultar estado del payout

> Este endpoint permite a los comercios consultar el estado de un payout usando el ID del payout

### Parámetros

<ParamField path="payout-id" type="string" required>
  El ID del payout devuelto al crear el payout
</ParamField>

### Respuesta

<ResponseField name="success" type="boolean">
  Indica si la operación fue exitosa.
</ResponseField>

<ResponseField name="id" type="string">
  El identificador único del payout.
</ResponseField>

<ResponseField name="onBehalfOf" type="string">
  El identificador del usuario o entidad en cuyo nombre se realiza el payout.
</ResponseField>

<ResponseField name="companyId" type="string">
  El identificador de la empresa asociada a este payout.
</ResponseField>

<ResponseField name="status" type="string">
  El estado actual del payout. Valores posibles: `created`, `processing`, `completed`, `failed`, `cancelled`.
</ResponseField>

<ResponseField name="amount" type="number">
  El monto en la moneda de origen.
</ResponseField>

<ResponseField name="source" type="object">
  Detalles del pago de origen

  <Expandable title="Objeto source">
    <ResponseField name="paymentRail" type="string">
      El payment rail usado (por ejemplo, "stellar")
    </ResponseField>

    <ResponseField name="currency" type="string">
      La moneda de origen (por ejemplo, "usdc")
    </ResponseField>

    <ResponseField name="address" type="string">
      La dirección de la wallet de origen
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="destination" type="object">
  Detalles del pago de destino. La estructura depende del tipo de destino.

  <Expandable title="Objeto destination">
    <ResponseField name="type" type="string">
      El tipo de destino: "bank", "crypto\_wallet" o "qr\_code"
    </ResponseField>

    <ResponseField name="currency" type="string">
      La moneda de destino
    </ResponseField>

    <ResponseField name="details" type="object">
      Detalles específicos del destino según el tipo
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="deductFromBalance" type="boolean">
  Indica si el monto se descontó del saldo de la cuenta.
</ResponseField>

<ResponseField name="quoteId" type="string">
  El ID de cotización usado para el cálculo del tipo de cambio (si se proporcionó).
</ResponseField>

<ResponseField name="createdAt" type="string">
  La fecha y hora (ISO 8601) de cuándo se creó el payout.
</ResponseField>

<ResponseField name="completedAt" type="string">
  La fecha y hora (ISO 8601) de cuándo se completó el payout (presente solo si el estado es `completed`).
</ResponseField>

<ResponseField name="failedAt" type="string">
  La fecha y hora (ISO 8601) de cuándo falló el payout (presente solo si el estado es `failed`).
</ResponseField>

<ResponseField name="failureReason" type="string">
  El motivo de la falla (presente solo si el estado es `failed`).
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request GET 'https://stablecoin-api.sandbox.getmeru.com/v1/payouts/3ddd0e5b-6276-4b48-b756-c1fcc9a2efd1' \
  --header 'Content-Type: application/json' \
  --header 'api-key: <api-key>'
  ```

  ```js Javascript theme={null}
  const response = await fetch('https://stablecoin-api.sandbox.getmeru.com/v1/payouts/3ddd0e5b-6276-4b48-b756-c1fcc9a2efd1', {
    method: 'GET',
    headers: {
      'Content-Type': 'application/json',
      'api-key': '<api-key>'
    }
  });

  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "id": "3ddd0e5b-6276-4b48-b756-c1fcc9a2efd1",
    "onBehalfOf": "123",
    "companyId": "123",
    "status": "completed",
    "amount": 1000,
    "source": {
      "paymentRail": "stellar",
      "currency": "usdc",
      "address": "123123"
    },
    "destination": {
      "type": "bank",
      "currency": "cop",
      "details": {
        "country": "CO",
        "accountType": "savings",
        "bankAccountNumber": "1234567890",
        "bankCode": "876",
        "beneficiary": {
          "email": "beneficiary@example.com",
          "documentType": "CC",
          "documentNumber": "12345678",
          "firstName": "John",
          "lastName": "Doe",
          "phone": "+573001234567",
          "city": "Bogotá",
          "state": "Cundinamarca",
          "address": "Calle 123 #45-67",
          "country": "CO",
          "type": "individual"
        }
      }
    },
    "deductFromBalance": true,
    "quoteId": "efaaf971-6d8b-4f36-be36-187c9f68fc06",
    "createdAt": "2024-01-15T10:00:00Z",
    "completedAt": "2024-01-15T10:25:00Z"
  }
  ```
</ResponseExample>

### Respuestas de error

<ResponseExample>
  ```json 401 theme={null}
  {
    "success": false,
    "error": "Unauthorized. Please check your authentication credentials."
  }
  ```

  ```json 404 theme={null}
  {
    "success": false,
    "error": "Payout not found."
  }
  ```
</ResponseExample>
