# Cashout Update Status Endpoint

## Cashout Update Status Endpoint

<mark style="color:orange;">`PUT`</mark> `https://api-stg.directa24.com/v3/cashout/status`

This API allows you to change the status of a cashout

#### Headers

| Name                                                | Type   | Description        |
| --------------------------------------------------- | ------ | ------------------ |
| Content-Type<mark style="color:red;">\*</mark>      | string | `application/json` |
| Payload-Signature<mark style="color:red;">\*</mark> | string | Control Signature  |

#### Request Body

| Name                                           | Type   | Description                                                                                           |
| ---------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- |
| login<mark style="color:red;">\*</mark>        | String | Your D24 CASHOUTS API login key                                                                       |
| pass<mark style="color:red;">\*</mark>         | string | Your D24 CASHOUTS API pass key                                                                        |
| cashout\_id<mark style="color:red;">\*</mark>  | number | The ID of the cashout to asign status to. It is the one generated by D24 when the cashout was created |
| external\_id<mark style="color:red;">\*</mark> | string | The ID of the cashout to check status of. It is the one you sent when the cashout was created         |
| status<mark style="color:red;">\*</mark>       | string | The status to be assigned to the cashout                                                              |

{% tabs %}
{% tab title="200 The status of the cashout was successfully retrieved" %}

```java
{
    "cashout_status": 1,
    "cashout_status_description": "Completed"
}

{
    "cashout_status": 3,
    "cashout_status_description": "Rejected",
    "rejection_code": 0,
    "rejection_reason": "Test"
}
```

{% endtab %}

{% tab title="401 Invalid credentials error" %}

```java
{
    "code": 401,
    "message": "Invalid credentials."
}
```

{% endtab %}

{% tab title="412 The cashout ID was not found" %}

```java
{
    "code": 509,
    "message": "Cashout not found with this ID"
}
```

{% endtab %}
{% endtabs %}

## Cashout Update Status Request

### Request Example

```java
// HEADERS
Content-Type: application/json 
Payload-Signature: 2e5023770760ea0a02230bff1a6dab934fe3b47a5e3d43854b58676600ee3868 

// BODY
{ 
   "login": "cashout_login",  
   "pass": "cashout_pass", 
   "external id": "MP 50a07faa4564009bdc73900895a6029"
   "cashout id": "97875"
   "status": "ON_HOLD"
}
```

### Request Fields Description

| Field         | Format                | Description                                                                                                                                                                                                                                               |
| ------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `login`       | String. Length 32 max | Your Pandablue **CASHOUTS** API Key, it can be found on the Merchant Panel: Settings -> API Access. Notice there are specific Cashout credentials                                                                                                         |
| `pass`        | String. Length 32 max | Your Pandablue **CASHOUTS** API Passphrase, it can be found on the Merchant Panel: Settings -> API Access. Notice there are specific Cashout credentials                                                                                                  |
| `cashout_id`  | Number                | Identifier of the cashout on Pandablue end. It is the one returned by the [Create Cashout Endpoint](https://docs.pandablue.com/api-documentation/cashouts-api/endpoints/cashout-creation-endpoint)                                                        |
| `external_id` | String                | Identifier of the cashout on the Merchant end. It is the one you sent while [Creating the Cashout request](https://docs.pandablue.com/api-documentation/cashouts-api/endpoints/cashout-creation-endpoint). You can opt to send this field or `cashout_id` |
| `status`      | String                | Status to be assigned to the cashout                                                                                                                                                                                                                      |

### Request Payload Signature

he Payload-Signature of the Cashout Update Status Endpoint is calculated by hashing the whole JSON payload of the request using HMAC256 and your secret key (API Signature) to encrypt it.

[Click here](https://docs.pandablue.com/api-documentation/cashouts-api/technical-and-security-aspects/calculating-the-payload-signature) for further instructions.

&#x20;

## Cashout Update Status Response

### Response Example

```java

{
    "code": 510,
    "message": "Invalid status transition"
}
```

### Response Fields Description

| Field                        | Format | Description                                                                                                                                             |
| ---------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cashout_status`             | Number | Status code of the cashout. [See list of status](https://docs.pandablue.com/api-documentation/api-codes#cashout-status-codes)                           |
| `cashout_status_description` | String | Description of the status                                                                                                                               |
| `rejection_code`             | Number | Rejection code if sent by the bank. [See list of rejection codes](https://docs.pandablue.com/api-documentation/api-codes#cashout-rejection-error-codes) |
| `rejection_reason`           | String | Reason of the rejection if sent by the bank                                                                                                             |

## Status Flow

[Click here](https://docs.pandablue.com/api-documentation/api-codes#cashout-status-codes) to see each Cashout Status meaning.

### Cashout Status Flow

&#x20;

![Cashout Status Flow Diagram](https://1770394879-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M792I7hN0PzC-Sx95CP%2F-MEhIEdI0LJuMtqX3Ntd%2F-MEhM7tjzaYE5_JN6TKA%2FCashouts%20Status%20Flow%20v3.svg?alt=media\&token=720e6ebc-768f-4889-b1e8-b573e449a2b5)

{% hint style="info" %}

1. DECLINED: The DECLINED status is not a status by itself. It means the transaction couldn't be created because of an error with the data, the customer or the merchant configuration. No transaction will change its status from DECLINED.
2. PENDING: Once the cashout is in PENDING status, it means it was successfully created and that it will be send for processing soon, changing to DELIVERED. It can also be manually changed to ON\_HOLD or CANCELLED.
3. ON\_HOLD: A cashout will be created with ON\_HOLD status only if specified while creating the cashout with *on\_hold: true.* Otherwise, it can be manually set to ON\_HOLD from the Merchant Panel. If a cashout is ON\_HOLD, it won't be send for processing until you manually go and set it to PENDING from the Merchant Panel. It can still be CANCELLED.
4. CANCELLED: It means you didn't want to proceed with the cashout and it was CANCELLED through the Merchant Panel or through the Cancel Cashout Endpoint. Final status.
5. DELIVERED: As soon as the cashout is sent to the bank for processing, its status will change to DELIVERED. At which point it can't be cancelled anymore.
6. COMPLETED: If the cashout was successfully completed, its status will be set to COMPLETED. Final status\*.
7. REJECTED: If the cashout was rejected by the bank, its status will be set to REJECTED. Final status.
   {% endhint %}

* There are cases in which the bank confirms us that a payout was successful and after a few days, it gets rejected by the beneficiary's bank therefore the status on our platform will change to REJECTED as well. Those are very corner cases but should be considered.

## Status codes

Check all the possible status codes in the following page:

{% content-ref url="../api-codes" %}
[api-codes](https://docs.pandablue.com/api-documentation/cashouts-api/api-codes)
{% endcontent-ref %}
