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

# Get a Disbursement

> Get a disbursement by its ID

## Prepare your request

The endpoint to use is `GET https://pay.sandbox.yabetoopay.com/v1/disbursement/{id}` for sandbox environment and `GET https://pay.api.yabetoopay.com/v1/disbursement/{id}` for production environment.

<Note>
  Secret key security: The secret key (secret\_key) must be kept confidential and
  must never be exposed in the frontend or client code. It must only be used on
  the server side.
</Note>

1. Use the secret key provided `secret_key` to authenticate yourself to the API. For security reasons, this key must only be used on the server side.
2. The request body should contain the following parameters:

```javascript theme={null}
{
    "id": "1234567890"
}
```

### Parameters

* `id`: The ID of the disbursement

## Make the request

```javascript theme={null}
const response = await fetch(
  "https://pay.sandbox.yabetoopay.com/v1/disbursement/1234567890",
  {
    method: "GET",
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${secret_key}`,
    },
  }
);

const data = await response.json();
console.log(data);
```

## Response

### 200 OK

When the disbursement was successfully retrieved, the API will return a 200 OK response with the following body:

```json theme={null}
{
  "amount": 10000,
  "currency": "XAF",
  "status": "processing",
  "firstName": "Jean",
  "lastName": "Dupont",
  "operatorName": "mtn",
  "country": "cg",
  "phone": "242066594471",
  "object": "disbursement",
  "type": 1,
  "shouldExecutedAt": "2025-03-18T09:24:57.555Z",
  "id": "wt_RMqehxy8NNi1ocJFG2SSAZMj81m6spo72vnZ",
  "createdAt": "2025-03-17T10:24:57.559+01:00",
  "updatedAt": "2025-03-17T10:24:57.559+01:00"
}
```

### 401 Unauthorized

When the secret key is invalid, the API will return a 401 Unauthorized response with the following body:

```json theme={null}
{
  "message": "Unauthorized"
}
```
