# Cashout Status Endpoint

## Endpoint  Estado de Retiro

<mark style="color:green;">`POST`</mark> `https://api-stg.tupayonline.com/v3/cashout/status`

#### 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 | <p>(max length: 32) </p><p>Tupay "Withdrawals" login key, found in the merchant dashboard under Settings -> API Access. </p> |
| external\_id<mark style="color:red;">\*</mark> | string | <p>(max length: 100)</p><p>Unique ID for withdrawals from your side</p>                                                      |
| cashout\_id<mark style="color:red;">\*</mark>  | number | The withdrawal ID to check the status. It is the one that TuPay generated when the withdrawal was created.                   |
| pass<mark style="color:red;">\*</mark>         | string | <p>(max length: 32) </p><p>Tupay "Withdrawals" Passphrase key, found in the merchant panel under Settings -> API Access.</p> |

{% tabs %}
{% tab title="200 Withdrawal request created successfully." %}

```bash
{
    "cashout_status": 1,
    "cashout_status_description": "Completed"
}
{
    "cashout_status": 3,
    "cashout_status_description": "Rejected",
    "rejection_code": 808,
    "rejection_reason": "ERROR_OTHER"
}
```

{% endtab %}

{% tab title="401 The specified credentials are incorrect." %}

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

{% endtab %}

{% tab title="412 Withdrawal not found with this ID" %}

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

{% endtab %}
{% endtabs %}

## <mark style="color:blue;">Request Example</mark>

```java
{ 
    "login": "cashout_login", 
    "pass": "cashout_pass", 
    "cashout_id": 11954,
    "external_id":"s2kdfm39494"
}
```

## <mark style="color:blue;">Withdrawal Status Flow</mark>

<figure><img src="https://3506309250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9pqDQmo5HSlku7L1tVhp%2Fuploads%2F0biwMOOmGkkQfy9OGfsP%2Fimage.png?alt=media&#x26;token=62b8ccd2-ed15-421b-8e95-374476c2f7fd" alt=""><figcaption></figcaption></figure>

## <mark style="color:blue;">Status Code</mark>

<table><thead><tr><th width="94" align="center">Code</th><th width="165" align="center">Meaning</th><th>Description</th></tr></thead><tbody><tr><td align="center">0</td><td align="center"><img src="https://2476386583-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M792I7hN0PzC-Sx95CP%2F-M9UZX6c7bK760aeWd8v%2F-M9Uq6hh3MZ301JtlBh4%2FUntitled%20Diagram.svg?alt=media&#x26;token=41bf91d1-9560-4eca-ae31-31076fa4318a" alt=""></td><td>The withdrawal was accepted by Tupay, but it has not yet been sent to the bank. It can still be cancelled.</td></tr><tr><td align="center">1</td><td align="center"><img src="https://2476386583-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M792I7hN0PzC-Sx95CP%2F-M9UZX6c7bK760aeWd8v%2F-M9UsDlL5PDQXBDL5CUD%2FCOMPLETED.svg?alt=media&#x26;token=92d1f295-7b3c-4ad5-b0ce-eb123df5b7ed" alt=""></td><td>The money arrived in the client's account.</td></tr><tr><td align="center">2</td><td align="center"><img src="https://2476386583-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M792I7hN0PzC-Sx95CP%2F-M9UZX6c7bK760aeWd8v%2F-M9UsJ4Co_cg-RzJZT6c%2FCANCELLED.svg?alt=media&#x26;token=740308bc-8d16-47b4-b463-5dcb696664f5" alt="" data-size="original"></td><td>The withdrawal was canceled by you.</td></tr><tr><td align="center">3</td><td align="center"><img src="https://3506309250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9pqDQmo5HSlku7L1tVhp%2Fuploads%2FTVbAtvFqiLKAkbEg8Rjh%2Fimage.png?alt=media&#x26;token=321d8d83-abeb-4121-a66a-7726cd6f20d9" alt="" data-size="original"></td><td>The withdrawal was canceled by the bank (invalid document, invalid account, etc.)</td></tr><tr><td align="center">4</td><td align="center"><img src="https://3506309250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9pqDQmo5HSlku7L1tVhp%2Fuploads%2FO3gBvJRztx8UofQUshMC%2Fimage.png?alt=media&#x26;token=86c0a3bc-c57e-4f47-9be9-a8755112af2c" alt="" data-size="original"></td><td>The withdrawal was sent to the bank for processing. Now it can no longer be canceled</td></tr><tr><td align="center">5</td><td align="center"><img src="https://3506309250-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9pqDQmo5HSlku7L1tVhp%2Fuploads%2FSc6OQRjHeBxwEIQ8Dysv%2Fimage.png?alt=media&#x26;token=b5bcdf59-3d00-426b-920e-df4a4fd2ac92" alt="" data-size="original"></td><td>The withdrawal was placed on hold. They can move it back to pending when necessary.</td></tr></tbody></table>
