> For the complete documentation index, see [llms.txt](https://docs.ccpayment.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ccpayment.com/ccpayment-v1.0-api/withdrawal-api-integration/create-a-withdrawal-order.md).

# Create a withdrawal order

### **Create withdrawal order**

## Return to Withdrawal Order Creation Information

<mark style="color:green;">`POST`</mark> `https://admin.ccpayment.com/ccpayment/v1/withdraw`

Return a receiving address and order infor

#### Headers

| Name                                           | Type   | Description                                                                                                                                                         |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Sign<mark style="color:red;">\*</mark>         | string | SHA-256 (APPID + APP Secret +timestamp+<mark style="color:red;">**body (json string)**</mark>). [Signature guide](/ccpayment-v1.0-api/to-get-started/signature.md). |
| Timestamp<mark style="color:red;">\*</mark>    | string | Timestamp in seconds (10-digit). The request is valid for two minutes.                                                                                              |
| Appid<mark style="color:red;">\*</mark>        | string | Merchant's unique credential. Find it on the [Developer page](https://admin.ccpayment.com/developer/config)                                                         |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json; charset=utf-8                                                                                                                                     |

#### Request Body

| Name                                                  | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                       |
| ----------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| merchant\_order\_id<mark style="color:red;">\*</mark> | string  | Order ID in Merchant's system. A unique ID for every order                                                                                                                                                                                                                                                                                                                                                        |
| address<mark style="color:red;">\*</mark>             | string  | <p>Case 1: Pass the Cwallet ID or Email address linked to Cwallet account If a user wants to withdraw to his Cwallet account </p><p></p><p>Case 2: Pass the receiving address if the user wants to withdraw to his Web3 wallet. </p><p></p><p>Note: SATS uses the invoice as a receiving address. Each invoice can only accept one payment.</p>                                                                   |
| token\_id<mark style="color:red;">\*</mark>           | string  | <p>Tell CCPayment's server which coin and network should be used for the transaction. You can get the token\_id by calling the interface or finding it <a href="https://bit.ly/CCsupportedcoins">on this sheet</a>.</p><p></p><p>If the withdrawal is to Cwallet, any token\_id of the coin will be ok. </p><p></p><p>If the withdrawal is to external addresses, only the corresponding token\_id will work.</p> |
| value<mark style="color:red;">\*</mark>               | string  | Withdrawal amount                                                                                                                                                                                                                                                                                                                                                                                                 |
| memo                                                  | Integer | Pass memo parameter if the receiving address requires a memo. If a memo is required and it is not filled, or filled incorrectly, the asset may be lost                                                                                                                                                                                                                                                            |
| merchant\_pays\_fee                                   | bool    | <p>Ture: the network fee charged from the merchant.<br>False when not specified: the network fee charged from the user. <br>The received amount = withdrawal amount- network fee</p>                                                                                                                                                                                                                              |

{% tabs %}
{% tab title="200: OK Success (200)/Fail (200)" %}
{% tabs %}
{% tab title="Success (200)" %}

#### **Response (Success 200)**

**Header**

<table><thead><tr><th width="134">Name</th><th width="188">Value</th><th width="118">Required</th><th width="82">Type</th><th width="299">Description</th></tr></thead><tbody><tr><td>Appid</td><td>202302010636261620672405236006912</td><td>Y</td><td>String</td><td>Merchant's unique credential. Find it on the <a href="https://admin.ccpayment.com/developer/config">Developer page</a></td></tr><tr><td>Timestamp</td><td>1677152490</td><td>Y</td><td>String</td><td>Timestamp in seconds (10-digit). The request is valid for two minutes.</td></tr><tr><td>Sign</td><td>871f0223c66ea72435208d03603a0cb00b90f6ac4a4ba725d00164d967e291f6</td><td>Y</td><td>String</td><td>SHA-256(appId + appSecret + timestamp+<mark style="color:red;"><strong>body(json string)</strong></mark>)</td></tr></tbody></table>

**Body**

```json
{
    "code": 10000,
    "msg": "success",
    "data": {
           "order_id": "202307270722481684464338564370432",
           "record_id": "202307270722481684464338581147648",
           "network_fee": "0",
           "network_coin_id":"217d4c3b-4f84-4416-bf1a-a1d15d7d2f50",
           "network_symbol":"TRX",
           "network_fee_value":"0.85",
           "net_receivable": "0.05" 
          }
}
```

**Parameters**

<table><thead><tr><th width="193">Name</th><th width="173">Value</th><th data-type="checkbox">Required </th><th>Type</th><th width="153">Description</th></tr></thead><tbody><tr><td>code</td><td>10000</td><td>true</td><td>integer</td><td></td></tr><tr><td>msg</td><td>Success</td><td>true</td><td>string</td><td>This message only represents the status of the order creation and not the transaction result. <br>The results of the transaction will be pushed in the <a href="https://doc.ccpayment.com/ccpayment-for-developer/webhook-notification/withdraw-webhook-notification">webhook notification</a>.</td></tr><tr><td>data</td><td></td><td>true</td><td>object</td><td></td></tr><tr><td>data.order_id</td><td>202301090616511612332555323101184</td><td>true</td><td>string</td><td>Merchant order ID</td></tr><tr><td>data.record_id</td><td>202301090616511612332555323101184</td><td>true</td><td>string</td><td>Trading record: one transaction generates one unique</td></tr><tr><td>data.network_fee</td><td>0</td><td>true</td><td>string</td><td>Network fee. Withdrawal to Cwallet address charges 0 network fee.</td></tr><tr><td>data.network_coin_id</td><td>8e5741cf-6e51-4892-9d04-3d40e1dd0128</td><td>false</td><td>string</td><td>Coin ID for network fee crypto.</td></tr><tr><td>data.network_fee_crypto</td><td>TRX</td><td>false</td><td>string</td><td><a href="https://docs.google.com/spreadsheets/d/1Wbr11YMX8p093ucbDDehyAI0HIOxVHpzQCRnTwWgThA/edit#gid=0">Crypto</a> unit of network fee.</td></tr><tr><td>data.network_fee_value</td><td>0.85</td><td>false</td><td>string</td><td>Network fee value in usd.</td></tr><tr><td>data.net_receivable</td><td>0.05</td><td>true</td><td>string</td><td>Amount of withdrawal will be received</td></tr></tbody></table>
{% endtab %}

{% tab title="Fail (200)" %}

#### **Response (Fail 200)**

```json
{
	"code": 224066,
	"msg": "Service error, pleaser try again",
	"data": null
}
```

<table><thead><tr><th>Name</th><th>Value</th><th width="108" data-type="checkbox">Required</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>224066</td><td>true</td><td>Number</td><td></td></tr><tr><td>msg</td><td>Service error, please try again</td><td>true</td><td>String</td><td></td></tr><tr><td>data</td><td></td><td>true</td><td>Object</td><td></td></tr></tbody></table>
{% endtab %}

{% tab title="Remarks" %}
As a security measure, we will sign the returned data (and according to this only { code: 10000 } should be signed, but it's signing all the returned body.). Additionally, it will return Appid, Sign, Timestamp  in the header of the response.  The signature method SHA-256 (appid+appSecret+Timestamp+body).

Please use the data with caution if the signature verification fails. It indicates that the data has been tampered with.
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

#### **Request Body Example**

{% tabs %}
{% tab title="Request Body" %}

```json
{
  "token_id": "fdf0e8b0-ebf5-44f0-a335-21c121b73fc8",
  "address": "rwyQp3eC5j6AumcptZhfmiXAykpeswZKeJ",
  // Pass Cwallet id or Email address if the withdrawal is to Cwallet account
  "merchant_order_id": "3735077979050379",
  "merchant_pays_fee": false      
  "value": "10"
  "memo": "573049"// Pass memo parameter if the receiving address requires a memo
}
```

{% endtab %}

{% tab title="Remark" %}
The body of HTTP is a json string .

Add the content in body of HTTP to the signature. Ensure the body content matches the signature content. As soon as CCPayment receives the request, the body content will be read and the signature will be verified.
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.ccpayment.com/ccpayment-v1.0-api/withdrawal-api-integration/create-a-withdrawal-order.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.
