# Check Payout Status

## Verify Disbursement

Once a disburse request is received, it becomes available for status checks. When a disbursement is submitted, its status goes into pending and when processing is completed, the status updates to either completed or failed.

To check the status of a submitted disbursement. The transactions ref is passed to the API below.

## Disburse Status

<mark style="color:green;">`POST`</mark> `https://staging.moneywaveapp.com/v1/disburse/status`

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Authorization Token |

#### Request Body

| Name | Type   | Description                           |
| ---- | ------ | ------------------------------------- |
| ref  | string | Unique transaction tracking reference |

{% tabs %}
{% tab title="200 " %}
```
{
    "status": "success",
    "data": {
        "id": 1669531,
        "amount": 50000,
        "status": "completed",
        "system_type": "wallet-disburse",
        "ref": "15260407UAKFY6K6Y",
        "flutterResponseMessage": "Successful",
        "flutterResponseCode": "00",
        "flutterReference": "TTMW001669531",
        "linkingReference": "044031974029",
        "disburseOrderId": null,
        "ipr": null,
        "iprc": null,
        "r1": null,
        "r2": null,
        "meta": "{\"narration\":\"First Payout\",\"sender\":\"Business_Name\",\"balance\":84033.39",
        "createdAt": "2018-05-11T12:13:53.000Z",
        "updatedAt": "2018-05-11T17:21:06.000Z",
        "beneficiary": {
            "accountNumber": "0234600000",
            "bankCode": "035"
        },
        "walletCharged": true,
        "refund": false,
        "reversed": false
    }
}
```
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Code" %}
```
Select a Language above ...
```
{% endtab %}

{% tab title="Node.JS" %}
```javascript
var unirest = require("unirest");
var base_url = "https://staging.moneywaveapp.com";
var req = unirest("POST", `${base_url}/v1/disburse/status`);

req.headers({
  "Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwibmFtZSI6IlRocml2ZSIsImFjY291bnROdW1iZXIiOiIwNjkwMDAwMDAiLCJiYW5rQ29kZSI6IjMwNyIsImlzQWN0aXZlIjp0cnVlLCJlbnZpcm9ubWVudCI6ImxpdmUiLCJjYW5fZ29saXZlIjp0cnVlLCJjb3VudGRvd24iOm51bGwsImNvbXBsaWFuY2UiOjgsImNvZGUiOiJNTDU4MCIsInBvc0lkIjoiMTE0NjMiLCJlYmlsbElkIjoiTVRGVyIsImlwIjpudWxsLCJjcmVhdGVkQXQiOiIyMDE2LTA5LTE2VDEzOjQ5OjIzLjAwMFoiLCJ1cGRhdGVkQXQiOiIyMDE3LTA3LTE5VDE0OjA2OjM2LjAwMFoiLCJkZWxldGVkQXQiOm51bGwsImlhdCI6MTUzMDIxMTc4MiwiZXhwIjoxNTMwMjE4OTgyfQ.gQDK03I9Jc0dO21RxsZjG0k4Px0NzTk4tRnkbV5VciU",
  "Content-Type": "application/json"
});
req.type("json");
req.send({
	"ref": "SD252849857"
});

req.end(function (res) {
  if (res.error) console.log(res.code, res.body);
  else console.log(res.body);
});
```
{% endtab %}

{% tab title="PHP" %}
```php
<?php

$curl = curl_init();
$base_url = "https://staging.moneywaveapp.com";
$header = array(
  "Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwibmFtZSI6IlRocml2ZSIsImFjY291bnROdW1iZXIiOiIwNjkwMDAwMDAiLCJiYW5rQ29kZSI6IjMwNyIsImlzQWN0aXZlIjp0cnVlLCJlbnZpcm9ubWVudCI6ImxpdmUiLCJjYW5fZ29saXZlIjp0cnVlLCJjb3VudGRvd24iOm51bGwsImNvbXBsaWFuY2UiOjgsImNvZGUiOiJNTDU4MCIsInBvc0lkIjoiMTE0NjMiLCJlYmlsbElkIjoiTVRGVyIsImlwIjpudWxsLCJjcmVhdGVkQXQiOiIyMDE2LTA5LTE2VDEzOjQ5OjIzLjAwMFoiLCJ1cGRhdGVkQXQiOiIyMDE3LTA3LTE5VDE0OjA2OjM2LjAwMFoiLCJkZWxldGVkQXQiOm51bGwsImlhdCI6MTUzMDIxMDY4MywiZXhwIjoxNTMwMjE3ODgzfQ.IO4iX_estdWbe2dHey27bj5xsZC0skXHGdFUMTQSJfI",
  "Content-Type: application/json",
);

$body = array(
  "ref" => "SD252849857"
);

curl_setopt_array($curl, array(
  CURLOPT_URL => $base_url . "/v1/disburse/status",
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 180,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_POSTFIELDS => json_encode($body),
  CURLOPT_HTTPHEADER => $header,
));

$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);


if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $decodedResponse = json_decode($response, true);

  echo "<pre>"; print_r($decodedResponse);
}
```
{% endtab %}
{% endtabs %}

## Confirming Success

When a disbursement is verified for status, the response returned contains specific fields required in determining the state of the disbursement. See the example response in the API snippet above.

A verified disbursement is **successful** only when the disburse status API response has the value below.

```
"status" : "completed"
```

There are additional fields further indicating the transaction status

```
"flutterResponseCode": "00"
```

```
"reversed": false
```

{% hint style="info" %}
When the **reversed** flag is set to true, this indicates a disbursement that was returned by the destination bank, for example due to limits on destination account.
{% endhint %}
