> This page is for API Reference.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://okx-demo.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://okx-demo.ferndocs.com/_mcp/server.

# Get withdrawal history

GET https://www.okx.com/api/v5/asset/withdrawal-history

Retrieve the withdrawal records according to the currency, withdrawal status, and time range in reverse chronological order. Records for the last one year are available.

Reference: https://okx-demo.ferndocs.com/api/api-reference/funding/get-withdrawal-history

## Authentication

- `OK-ACCESS-KEY` header (required) — Your API key.
- `OK-ACCESS-SIGN` header (required) — Base64-encoded HMAC-SHA256 signature of the prehash string.
- `OK-ACCESS-TIMESTAMP` header (required) — ISO 8601 UTC timestamp, e.g. 2020-12-08T09:08:57.715Z.
- `OK-ACCESS-PASSPHRASE` header (required) — The passphrase you set when creating the API key.

## Request

### Query parameters

- `ccy` (string, optional) — Currency, e.g. BTC.
- `wdId` (string, optional) — Withdrawal ID.
- `clientId` (string, optional) — Client-supplied ID.
- `txId` (string, optional) — Hash record of the withdrawal.
- `type` (enum, optional) — Withdrawal type: 3=internal transfer, 4=on-chain withdrawal.
  - Allowed values: `3`, `4`
- `state` (enum, optional) — Status of withdrawal: -3=canceling, -2=canceled, -1=failed, 0=waiting withdrawal, 1=withdrawing, 2=withdraw success, 4/5/6=under review, 8=pending, 9=recharge, 10=waiting transfer, 12=pending re-review.
  - Allowed values: `-3`, `-2`, `-1`, `0`, `1`, `2`, `4`, `5`, `6`, `8`, `9`, `10`, `12`
- `after` (string, optional) — Pagination of data to return records earlier than the requested ts, Unix timestamp in milliseconds.
- `before` (string, optional) — Pagination of data to return records newer than the requested ts, Unix timestamp in milliseconds.
- `limit` (string, optional) — Number of results per request. Maximum is 100; default is 100.

## Response

### 200

Successful response

- `code` (string, optional) — Result code. `0` means success; any other value is an error code.
- `msg` (string, optional) — Error message. Empty on success.
- `data` (list of ApiV5AssetWithdrawalHistoryGetResponsesContentApplicationJsonSchemaDataItems, optional)

## Types

### ApiV5AssetWithdrawalHistoryGetResponsesContentApplicationJsonSchemaDataItems

- `ccy` (string, optional) — Currency.
- `chain` (string, optional) — Chain name, e.g. USDT-ERC20.
- `nonTradableAsset` (boolean, optional) — Whether it is a non-tradable asset.
- `amt` (string, optional) — Withdrawal amount.
- `ts` (string, optional) — Time the withdrawal request was submitted, Unix timestamp in milliseconds.
- `from` (string, optional) — Withdrawal account (email/phone/account name) for internal transfer.
- `areaCodeFrom` (string, optional) — If from is a phone number, this returns the area code.
- `to` (string, optional) — Receiving address.
- `areaCodeTo` (string, optional) — If to is a phone number, this returns the area code.
- `tag` (string, optional) — Some currencies require a tag for withdrawal. Not returned if not required.
- `pmtId` (string, optional) — Some currencies require a payment ID for withdrawal. Not returned if not required.
- `memo` (string, optional) — Some currencies require a memo for withdrawal. Not returned if not required.
- `addrEx` (string, optional) — Withdrawal address attachment, e.g. TONCOIN attachment.
- `txId` (string, optional) — Hash record of the withdrawal. Empty for internal transfers.
- `fee` (string, optional) — Withdrawal fee amount.
- `feeCcy` (string, optional) — Withdrawal fee currency, e.g. USDT.
- `state` (string, optional) — Status of withdrawal.
- `wdId` (string, optional) — Withdrawal ID.
- `clientId` (string, optional) — Client-supplied ID.

## Examples

**Response**

```json
{
  "code": "0",
  "msg": "",
  "data": [
    {
      "ccy": "ETH",
      "chain": "ETH-Ethereum",
      "nonTradableAsset": false,
      "amt": "0.029809",
      "ts": "1655251200000",
      "from": "156****359",
      "areaCodeFrom": "86",
      "to": "0xa30d1fab********7CF18C7B6C579",
      "areaCodeTo": "",
      "txId": "0x35c******b360a174d",
      "fee": "0.007",
      "feeCcy": "ETH",
      "state": "2",
      "wdId": "15447421",
      "clientId": "",
      "note": "",
      "toAddrType": "1"
    }
  ]
}
```

**SDK Code**

```python funding_getWithdrawalHistory_example
import requests

url = "https://www.okx.com/api/v5/asset/withdrawal-history"

headers = {"OK-ACCESS-KEY": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript funding_getWithdrawalHistory_example
const url = 'https://www.okx.com/api/v5/asset/withdrawal-history';
const options = {method: 'GET', headers: {'OK-ACCESS-KEY': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go funding_getWithdrawalHistory_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://www.okx.com/api/v5/asset/withdrawal-history"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("OK-ACCESS-KEY", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby funding_getWithdrawalHistory_example
require 'uri'
require 'net/http'

url = URI("https://www.okx.com/api/v5/asset/withdrawal-history")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["OK-ACCESS-KEY"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java funding_getWithdrawalHistory_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://www.okx.com/api/v5/asset/withdrawal-history")
  .header("OK-ACCESS-KEY", "<apiKey>")
  .asString();
```

```php funding_getWithdrawalHistory_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://www.okx.com/api/v5/asset/withdrawal-history', [
  'headers' => [
    'OK-ACCESS-KEY' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp funding_getWithdrawalHistory_example
using RestSharp;

var client = new RestClient("https://www.okx.com/api/v5/asset/withdrawal-history");
var request = new RestRequest(Method.GET);
request.AddHeader("OK-ACCESS-KEY", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift funding_getWithdrawalHistory_example
import Foundation

let headers = ["OK-ACCESS-KEY": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://www.okx.com/api/v5/asset/withdrawal-history")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```