# Withdraw

## Withdraw Payout Order

<mark style="color:green;">`POST`</mark> `https://example.com/payment/withdraw/payout`

#### Headers

| Name                                           | Type             | Description |
| ---------------------------------------------- | ---------------- | ----------- |
| x-api-key<mark style="color:red;">\*</mark>    | String           | api key     |
| x-signature<mark style="color:red;">\*</mark>  | String           | signature   |
| Content-Type<mark style="color:red;">\*</mark> | application/json | -           |

#### Request Body

| Name                                          | Type   | Description                                                                        |
| --------------------------------------------- | ------ | ---------------------------------------------------------------------------------- |
| refId<mark style="color:red;">\*</mark>       | String | reference/transaction id                                                           |
| amount<mark style="color:red;">\*</mark>      | Number | amount                                                                             |
| userId<mark style="color:red;">\*</mark>      | String | Used for searching in the BO when you want to view transactions separated by user. |
| accountName<mark style="color:red;">\*</mark> | String | Bank Account Name                                                                  |
| accountNo<mark style="color:red;">\*</mark>   | String | Bank Account Number                                                                |
| bankCode<mark style="color:red;">\*</mark>    | String | Bank Code                                                                          |
| extendParams                                  | Object | Used for adding data to be sent back in the callback.                              |
| timestamp<mark style="color:red;">\*</mark>   | Date   | ISO Date (UTC+0)                                                                   |

### Example Request

```
{
    "refId": "REF_ID",
    "amount": 100,
    "userId": "USER_ID",
    "accountName": "whalepay",
    "accountNo": "1234567890",
    "bankCode": "KBANK",
    "extendParams": {
        "username": "whalepay",
    },
    "timestamp": "2023-02-05T16:34:57.956Z"
}
```

{% tabs %}
{% tab title="200: OK Success" %}
{% code overflow="wrap" %}

```javascript
{
    "data": {
        "status": "QUEUED",
        "refId": "REF_ID",
        "transactionId": "PO1675614323G8HBANB5",
        "amount": 100,
        "method": "Payout",
        "payee": {
            "accountNo": "1112223333",
            "accountName": "Compay",
            "bankCode": "KBANK",
        },
        "extendParams": {
            "username": "compay",
        },
        "fee": 0,
        "transferAmount": 100,
        "successTime": null,
        "timestamp": "2023-02-05T16:25:23.708Z"
    },
    "code": 0,
    "msg": "Success",
    "cause": ""
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Insufficient Balance" %}

```javascript
{
    "data": {},
    "code": 1004,
    "msg": "Insufficient Balance",
    "cause": "Available balance less than amount(1,000.00)"
}
```

{% endtab %}
{% endtabs %}

<mark style="color:red;">**Remark.**</mark>

We prefer use code for verify transaction success or not.

`code == 0` is mean import you transaction in to system already.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.whalepay.one/api-document/common-api/withdraw.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
