# P2p
P2P trading
# Get account information
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/account/get_user_info'
query_param = ''
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/account/get_user_info"
query_param=""
body_param=''
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/account/get_user_info
Get account information
To query the spot account balance, use the Spot API GET /spot/accounts.
Example responses
200 Response
{
"timestamp": 1767151138.989862,
"method": "--",
"code": 0,
"message": "success",
"data": {
"is_self": true,
"user_timest": "2025/11/19",
"counterparties_num": 12,
"email_verified": "1",
"verified": "1",
"has_phone": "1",
"user_name": "merchant_demo",
"user_note": "Preferred counterparty",
"complete_transactions": "128",
"paid_transactions": "68",
"accepted_transactions": "60",
"transactions_used_time": "300",
"cancelled_used_time_month": "2",
"complete_transactions_month": "32",
"complete_rate_month": 96,
"orders_buy_rate_month": 53,
"is_black": 0,
"is_follow": 0,
"have_traded": 1,
"biz_uid": "biz_uid_demo_9f3a7c",
"blue_vip": 0,
"work_status": 1,
"registration_days": 42,
"first_trade_days": 30,
"need_replenish": 0,
"merchant_info": {
"type": "0",
"market": "USD"
},
"online_status": 1,
"work_hours": null,
"transactions_month": 6400.5,
"transactions_all": 28600.75,
"trade_versatile": false
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pMerchantUserInfoResponse |
Response Schema
Status Code 200
P2pMerchantUserInfoResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» is_self | boolean | Whether self |
| »» user_timest | string | User registration time (formatted string) |
| »» counterparties_num | integer | Number of counterparties |
| »» email_verified | string | Whether email is verified. 1: yes; 0: no. |
| »» verified | string | Whether KYC is completed. 1: yes; 0: no. |
| »» has_phone | string | Whether a phone number is bound. 1: yes; 0: no. |
| »» user_name | string | Username |
| »» user_note | string | User note information |
| »» complete_transactions | string | Total completed orders |
| »» paid_transactions | string | Number of completed buy orders |
| »» accepted_transactions | string | Number of completed sell orders |
| »» transactions_used_time | string | Average time to confirm receipt |
| »» cancelled_used_time_month | string | Cancellation time in last 30 days |
| »» complete_transactions_month | string | Number of completed orders in last 30 days |
| »» complete_rate_month | number | Completion rate in last 30 days |
| »» orders_buy_rate_month | number | Buy order ratio in last 30 days |
| »» is_black | integer | Whether the user is blocked. 1: yes; 0: no. |
| »» is_follow | integer | Whether you follow this user. 1: yes; 0: no. |
| »» have_traded | integer | Whether you have traded with this user before. 1: yes; 0: no. |
| »» biz_uid | string | Encrypted UID |
| »» blue_vip | integer | Blue V Crown Shield |
| »» work_status | integer | Merchant work status |
| »» registration_days | integer | Registration days |
| »» first_trade_days | integer | Days since first trade |
| »» need_replenish | integer | Whether additional margin is required. 1: yes; 0: no. |
| »» merchant_info | object | Markets where user can place orders |
| »»» type | string | none |
| »»» market | string | none |
| »» online_status | integer | Merchant online status: 1 online; 0 offline. |
| »» work_hours | object|null | Merchant online status details |
| »» transactions_month | number | 30-day transaction volume |
| »» transactions_all | number | Total transaction volume |
| »» trade_versatile | boolean | Single user or composite user |
| » version | string | none |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Get counterparty information
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/account/get_counterparty_user_info'
query_param = ''
body='{"biz_uid":"biz_uid_demo_9f3a7c"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/account/get_counterparty_user_info"
query_param=""
body_param='{"biz_uid":"biz_uid_demo_9f3a7c"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/account/get_counterparty_user_info
Get counterparty information
Body parameter
{
"biz_uid": "biz_uid_demo_9f3a7c"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | GetCounterpartyUserInfoRequest | true | none |
| » biz_uid | body | string | true | Counterparty crypto UID from order list or detail field its_uid. |
Example responses
200 Response
{
"timestamp": 1767152416.755602,
"method": "--",
"code": 0,
"message": "success",
"data": {
"user_timest": "2025/11/19",
"email_verified": "1",
"verified": "1",
"has_phone": "1",
"user_name": "counterparty_demo",
"user_note": "",
"complete_transactions": "86",
"paid_transactions": "44",
"accepted_transactions": "42",
"transactions_used_time": "420",
"cancelled_used_time_month": "1",
"complete_transactions_month": "18",
"complete_rate_month": 95,
"is_follow": 0,
"have_traded": 0,
"biz_uid": "biz_uid_demo_b84d21",
"registration_days": 180,
"first_trade_days": 90,
"trade_versatile": false
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pCounterpartyUserInfoResponse |
Response Schema
Status Code 200
P2pCounterpartyUserInfoResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» user_timest | string | User registration time (formatted string) |
| »» email_verified | string | Whether email is verified. 1: yes; 0: no. |
| »» verified | string | Whether KYC is completed. 1: yes; 0: no. |
| »» has_phone | string | Whether a phone number is bound. 1: yes; 0: no. |
| »» user_name | string | Username |
| »» user_note | string | User note information |
| »» complete_transactions | string | Total completed orders |
| »» paid_transactions | string | Number of completed buy orders |
| »» accepted_transactions | string | Number of completed sell orders |
| »» transactions_used_time | string | Average time to confirm receipt |
| »» cancelled_used_time_month | string | Cancellation time in last 30 days |
| »» complete_transactions_month | string | Number of completed orders in last 30 days |
| »» complete_rate_month | number | Completion rate in last 30 days |
| »» is_follow | integer | Whether you follow this user. 1: yes; 0: no. |
| »» have_traded | integer | Whether you have traded with this user before. 1: yes; 0: no. |
| »» biz_uid | string | Encrypted UID |
| »» registration_days | integer | Registration days |
| »» first_trade_days | integer | Days since first trade |
| »» trade_versatile | boolean | Single user or composite user |
| » version | string | none |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Get payment method list
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/account/get_myself_payment'
query_param = ''
body='{"fiat":"USD"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/account/get_myself_payment"
query_param=""
body_param='{"fiat":"USD"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/account/get_myself_payment
Get payment method list
Body parameter
{
"fiat": "USD"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | GetMyselfPaymentRequest | false | none |
| » fiat | body | string | false | Fiat currency; omit to return all available payment methods. |
Example responses
200 Response
{
"timestamp": 1767152532.08744,
"method": "--",
"code": 0,
"message": "success",
"data": [
{
"pay_type": "bank",
"pay_name": "Bank Transfer",
"ids": [
10001
],
"list": [
{
"uid": 1000001,
"bankid": "10001",
"nickname": 1000001,
"bankname": "Demo Bank",
"bankbranch": "Main Branch",
"bankcity": "New York",
"bankprov": "NY",
"bankaddr": "****1234",
"bankdesc": "Corporate settlement account",
"hold_uid": 1000001,
"hold_username": "merchant_demo",
"real_name": "Merchant Demo"
}
]
},
{
"pay_type": "swift",
"pay_name": "SWIFT International Remittance",
"ids": [
10002
],
"list": [
{
"id": "10002",
"account_des": "Business USD account",
"pay_type": "swift",
"file": "",
"file_key": "",
"account": "****5678",
"memo": "Use order txid as reference",
"code": "",
"memo_ext": "",
"trade_tips": "Please pay from an account under your real name",
"real_name": "Merchant Demo"
}
]
}
],
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pPaymentMethodsResponse |
Response Schema
Status Code 200
P2pPaymentMethodsResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | array | none |
| »» P2pPaymentMethodGroup | object | none |
| »»» pay_type | string | Payment method type |
| »»» pay_name | string | Payment method name |
| »»» ids | array | User's currently bound payment method (primary key ID) |
| »»» list | array | none |
| »»»» P2pPaymentMethodAccount | object | none |
| »»»»» uid | integer | useruID |
| »»»»» bankid | string | User's currently bound payment method (primary key ID) |
| »»»»» nickname | integer | Cardholder UID |
| »»»»» bankname | string | Bank name |
| »»»»» bankbranch | string | Bank branch name |
| »»»»» bankcity | string | Bank city |
| »»»»» bankprov | string | Bank province |
| »»»»» bankaddr | string | Bank card number or masked card number. |
| »»»»» bankdesc | string | Bank note |
| »»»»» hold_uid | integer | Cardholder UID |
| »»»»» hold_username | string | Cardholder name |
| »»»»» real_name | string | User verified display name. |
| »»»»» id | string | User's currently bound payment method (primary key ID) |
| »»»»» account_des | string | Payment method description |
| »»»»» pay_type | string | Payment method type |
| »»»»» file | string | Payment method file link |
| »»»»» file_key | string | Payment method file key |
| »»»»» account | string | Payment account or masked payment account. |
| »»»»» memo | string | Payment method note |
| »»»»» code | string | Payment method code |
| »»»»» memo_ext | string | Payment method additional note |
| »»»»» trade_tips | string | Payment method transaction information |
| »»»» version | string | none |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Set merchant working status and custom working hours
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/account/set_merchant_work_hours'
query_param = ''
body='{"work_status":2,"cycle_type":"Weekly","day_of_week":"1,2,3,4,5","time_zone":"+8","start_time":"09:00","end_time":"18:00"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/account/set_merchant_work_hours"
query_param=""
body_param='{"work_status":2,"cycle_type":"Weekly","day_of_week":"1,2,3,4,5","time_zone":"+8","start_time":"09:00","end_time":"18:00"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/account/set_merchant_work_hours
Set merchant working status and custom working hours
Body parameter
{
"work_status": 2,
"cycle_type": "Weekly",
"day_of_week": "1,2,3,4,5",
"time_zone": "+8",
"start_time": "09:00",
"end_time": "18:00"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | SetMerchantWorkHoursRequest | true | none |
| » work_status | body | integer | true | Working status. 0: resting, 1: working, 2: using custom working hours |
| » cycle_type | body | string | false | Custom working cycle; required when work_status is 2 |
| » day_of_week | body | string | false | Weekly working days, comma-separated values 1-7 for Monday to Sunday; required when work_status is 2 and cycle_type is Weekly |
| » time_zone | body | string | false | UTC timezone offset, ranging from -12 to +14; required when work_status is 2 |
| » start_time | body | string | false | Custom working start time in HH:mm format; required when work_status is 2 and must not be later than end_time |
| » end_time | body | string | false | Custom working end time in HH:mm format; required when work_status is 2 and must not be earlier than start_time |
# Enumerated Values
| Parameter | Value |
|---|---|
| » work_status | 0 |
| » work_status | 1 |
| » work_status | 2 |
| » cycle_type | Weekly |
| » cycle_type | Daily |
Example responses
200 Response
{
"timestamp": 1767152800.123456,
"method": "--",
"code": 0,
"message": "success",
"data": {
"work_status": 3
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pMerchantWorkHoursResponse |
Response Schema
Status Code 200
P2pMerchantWorkHoursResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | Response timestamp. |
| » method | string | Placeholder for request method. |
| » code | integer | Response code, 0 means success |
| » message | string | Response message |
| » data | object | none |
| »» work_status | integer | Merchant's current working status. 0: normal resting, 1: normal working, 2: custom resting, 3: custom working |
| » version | string | API version. |
# Enumerated Values
| Property | Value |
|---|---|
| work_status | 0 |
| work_status | 1 |
| work_status | 2 |
| work_status | 3 |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Get pending orders
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/transaction/get_pending_transaction_list'
query_param = ''
body='{"crypto_currency":"USDT","fiat_currency":"USD","order_tab":"pending","select_type":"sell","status":"open","txid":40000001,"start_time":1764547200,"end_time":1767139199}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/transaction/get_pending_transaction_list"
query_param=""
body_param='{"crypto_currency":"USDT","fiat_currency":"USD","order_tab":"pending","select_type":"sell","status":"open","txid":40000001,"start_time":1764547200,"end_time":1767139199}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/transaction/get_pending_transaction_list
Get pending orders
Body parameter
{
"crypto_currency": "USDT",
"fiat_currency": "USD",
"order_tab": "pending",
"select_type": "sell",
"status": "open",
"txid": 40000001,
"start_time": 1764547200,
"end_time": 1767139199
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | GetPendingTransactionListRequest | true | none |
| » crypto_currency | body | string | true | Cryptocurrency symbol. |
| » fiat_currency | body | string | true | Fiat currency |
| » order_tab | body | string | false | Order tab: pending in progress (OPEN, PAID, LOCKED, TEMP); dispute in dispute; default pending. |
| » select_type | body | string | false | Order side filter: buy buy orders; sell sell orders; empty: all. |
| » status | body | string | false | Order status filter. open unpaid (OPEN); paid paid (PAID); locked locked (LOCKED);dispute in dispute; empty or omitted uses the default range for order_tab. |
| » txid | body | integer | false | Order ID |
| » start_time | body | integer | false | Start timestamp, default is 00:00 89 days ago |
| » end_time | body | integer | false | End timestamp, default is 23:59:59 today |
# Detailed descriptions
» status: Order status filter. open unpaid (OPEN); paid paid (PAID); locked locked (LOCKED);dispute in dispute; empty or omitted uses the default range for order_tab.
# Enumerated Values
| Parameter | Value |
|---|---|
| » order_tab | pending |
| » order_tab | dispute |
Example responses
200 Response
{
"timestamp": 1767153378.888855,
"method": "--",
"code": 0,
"message": "success",
"data": {
"list": [
{
"type_buy": 1,
"timest": "2025-12-15 08:27:09",
"timest_expire": "2025-12-15 10:27:09",
"timestamp": 1765787229,
"rate": "1.100",
"amount": "8.00",
"total": "8.800",
"txid": 40000001,
"status": "paid",
"its_realname": "Counterparty Demo",
"its_uid": "biz_uid_demo_b84d21",
"its_nick": "counterparty_demo",
"seller_realname": "Merchant Demo",
"buyer_realname": "Counterparty Demo",
"cancelable": 1,
"currency_type": "USDT",
"want_type": "USD",
"hide_payment": 0,
"sel_paytype": "bank",
"cd_time": 600,
"order_type": 1,
"order_tag": [
"fast"
],
"convert_info": {}
}
],
"trans_time": [
{
"od_time": 600
}
],
"count": 1,
"exported_num": 0
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pTransactionListResponse |
Response Schema
Status Code 200
P2pTransactionListResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» list | array | none |
| »»» P2pTransactionListItem | object | none |
| »»»» type_buy | integer | Order side from current user's view. 1: buy; 0: sell. |
| »»»» timest | string | Creation time of order |
| »»»» timest_expire | string | Order expiration time |
| »»»» timestamp | integer | Order creation timestamp |
| »»»» rate | string | Order price in fiat currency. |
| »»»» amount | string | Order size in cryptocurrency. |
| »»»» total | string | Total fiat amount of the order. |
| »»»» txid | integer | Order ID |
| »»»» status | string | Display status: unpay awaiting payment; paid buyer paid; unconfirmed awaiting seller confirmation; locked locked; finished completed; cancel canceled; expired expired; bclosed arbitration filled; sclosed arbitration canceled. |
| »»»» its_realname | string | Counterparty real name or verified display name. |
| »»»» its_uid | string | Counterparty crypto UID. |
| »»»» its_nick | string | Counterparty nickname |
| »»»» seller_realname | string | Seller real name or verified display name. |
| »»»» buyer_realname | string | Buyer real name or verified display name. |
| »»»» cancelable | integer | Whether the order can be canceled. 1: yes; 0: no. |
| »»»» currency_type | string | Cryptocurrency symbol. |
| »»»» want_type | string | Fiat currency |
| »»»» hide_payment | integer | Whether payment methods are hidden. 1: hidden; 0: visible. |
| »»»» sel_paytype | string | Selected payment type for this order, e.g. bank, alipay, wechat, paypal, swift, wu. |
| »»»» pay_others | array | Other payment method details; may appear on historical orders. |
| »»»»» pay_type | string | Payment method type |
| »»»»» pay_name | string | Payment method name |
| »»»» cd_time | integer | Countdown seconds for the current order. |
| »»»» order_type | integer | Order type: 1 standard; 2 partner; 3 flash swap; 4 Web3. |
| »»»» order_tag | array | Order tags |
| »»»» convert_info | object | Flash swap order information |
| »»»»» convert_type | string | Flash swap target currency |
| »»»»» convert_status | string | Flash swap order status |
| »»»»» pre_rate | string | Expected price when placing order |
| »»»»» rate | string | Execution price |
| »»»»» pre_fiat_rate | string | Expected fiat price when placing order |
| »»»»» fiat_rate | string | Fiat price at execution |
| »»»»» amount | string | Size |
| »»»»» convert_amount | string | Swap Amount |
| »»»»» slippage | string | Slippage calculation: slippage = (expected price when placing order - real-time price during auto swap) / expected price when placing order |
| »»»»» status | string | Flash swap order display status |
| »»»» trans_time | array | Countdown time |
| »»»»» P2pTransactionTimeMarker | object | none |
| »»»»»» od_time | integer | none |
| »»»»» count | integer | Number of orders |
| »»»»» exported_num | integer | Export count |
| »»»» version | string | none |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Get all/historical orders
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/transaction/get_completed_transaction_list'
query_param = ''
body='{"crypto_currency":"USDT","fiat_currency":"USD","select_type":"buy","status":"closed","txid":40000001,"start_time":1764547200,"end_time":1767139199,"query_dispute":0,"page":1,"per_page":20}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/transaction/get_completed_transaction_list"
query_param=""
body_param='{"crypto_currency":"USDT","fiat_currency":"USD","select_type":"buy","status":"closed","txid":40000001,"start_time":1764547200,"end_time":1767139199,"query_dispute":0,"page":1,"per_page":20}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/transaction/get_completed_transaction_list
Get all/historical orders
Body parameter
{
"crypto_currency": "USDT",
"fiat_currency": "USD",
"select_type": "buy",
"status": "closed",
"txid": 40000001,
"start_time": 1764547200,
"end_time": 1767139199,
"query_dispute": 0,
"page": 1,
"per_page": 20
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | GetCompletedTransactionListRequest | true | none |
| » crypto_currency | body | string | true | Cryptocurrency symbol. |
| » fiat_currency | body | string | true | Fiat currency |
| » select_type | body | string | false | Order side filter: buy buy orders; sell sell orders; empty: all. |
| » status | body | string | false | Order status filter. closed: filled (ACCEPT, BCLOSED); cancel: canceled (CANCEL, BECANCEL, SCLOSED, SCANCEL);locked: locked (LOCKED); open: unpaid (OPEN); paid: paid (PAID);completed: finished or canceled (CANCEL, BECANCEL, SCLOSED, SCANCEL, ACCEPT, BCLOSED);Empty or omitted uses the endpoint default range. |
| » txid | body | integer | false | Order ID |
| » start_time | body | integer | false | Start timestamp, default is 00:00 89 days ago |
| » end_time | body | integer | false | End timestamp, default is 23:59:59 today |
| » query_dispute | body | integer | false | Whether to flag dispute status in the response. 1: yes; 0: no. |
| » page | body | integer | false | Page number starting at 1; values below 1 are treated as 1. |
| » per_page | body | integer | false | Orders per page; default 10, max 200. |
# Detailed descriptions
» status: Order status filter. closed: filled (ACCEPT, BCLOSED); cancel: canceled (CANCEL, BECANCEL, SCLOSED, SCANCEL);locked: locked (LOCKED); open: unpaid (OPEN); paid: paid (PAID);completed: finished or canceled (CANCEL, BECANCEL, SCLOSED, SCANCEL, ACCEPT, BCLOSED);
Empty or omitted uses the endpoint default range.
Example responses
200 Response
{
"timestamp": 1767153378.888855,
"method": "--",
"code": 0,
"message": "success",
"data": {
"list": [
{
"type_buy": 1,
"timest": "2025-12-15 08:27:09",
"timest_expire": "2025-12-15 10:27:09",
"timestamp": 1765787229,
"rate": "1.100",
"amount": "8.00",
"total": "8.800",
"txid": 40000001,
"status": "finished",
"its_realname": "Counterparty Demo",
"its_uid": "biz_uid_demo_b84d21",
"its_nick": "counterparty_demo",
"seller_realname": "Merchant Demo",
"buyer_realname": "Counterparty Demo",
"cancelable": 0,
"currency_type": "USDT",
"want_type": "USD",
"hide_payment": 0,
"sel_paytype": "bank",
"pay_others": [
{
"pay_type": "swift",
"pay_name": "SWIFT International Remittance"
}
],
"cd_time": 0,
"order_type": 1,
"order_tag": [],
"convert_info": {}
}
],
"trans_time": [
{
"od_time": 0
}
],
"count": 1,
"exported_num": 0
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pTransactionListResponse |
Response Schema
Status Code 200
P2pTransactionListResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» list | array | none |
| »»» P2pTransactionListItem | object | none |
| »»»» type_buy | integer | Order side from current user's view. 1: buy; 0: sell. |
| »»»» timest | string | Creation time of order |
| »»»» timest_expire | string | Order expiration time |
| »»»» timestamp | integer | Order creation timestamp |
| »»»» rate | string | Order price in fiat currency. |
| »»»» amount | string | Order size in cryptocurrency. |
| »»»» total | string | Total fiat amount of the order. |
| »»»» txid | integer | Order ID |
| »»»» status | string | Display status: unpay awaiting payment; paid buyer paid; unconfirmed awaiting seller confirmation; locked locked; finished completed; cancel canceled; expired expired; bclosed arbitration filled; sclosed arbitration canceled. |
| »»»» its_realname | string | Counterparty real name or verified display name. |
| »»»» its_uid | string | Counterparty crypto UID. |
| »»»» its_nick | string | Counterparty nickname |
| »»»» seller_realname | string | Seller real name or verified display name. |
| »»»» buyer_realname | string | Buyer real name or verified display name. |
| »»»» cancelable | integer | Whether the order can be canceled. 1: yes; 0: no. |
| »»»» currency_type | string | Cryptocurrency symbol. |
| »»»» want_type | string | Fiat currency |
| »»»» hide_payment | integer | Whether payment methods are hidden. 1: hidden; 0: visible. |
| »»»» sel_paytype | string | Selected payment type for this order, e.g. bank, alipay, wechat, paypal, swift, wu. |
| »»»» pay_others | array | Other payment method details; may appear on historical orders. |
| »»»»» pay_type | string | Payment method type |
| »»»»» pay_name | string | Payment method name |
| »»»» cd_time | integer | Countdown seconds for the current order. |
| »»»» order_type | integer | Order type: 1 standard; 2 partner; 3 flash swap; 4 Web3. |
| »»»» order_tag | array | Order tags |
| »»»» convert_info | object | Flash swap order information |
| »»»»» convert_type | string | Flash swap target currency |
| »»»»» convert_status | string | Flash swap order status |
| »»»»» pre_rate | string | Expected price when placing order |
| »»»»» rate | string | Execution price |
| »»»»» pre_fiat_rate | string | Expected fiat price when placing order |
| »»»»» fiat_rate | string | Fiat price at execution |
| »»»»» amount | string | Size |
| »»»»» convert_amount | string | Swap Amount |
| »»»»» slippage | string | Slippage calculation: slippage = (expected price when placing order - real-time price during auto swap) / expected price when placing order |
| »»»»» status | string | Flash swap order display status |
| »»»» trans_time | array | Countdown time |
| »»»»» P2pTransactionTimeMarker | object | none |
| »»»»»» od_time | integer | none |
| »»»»» count | integer | Number of orders |
| »»»»» exported_num | integer | Export count |
| »»»» version | string | none |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Query order details
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/transaction/get_transaction_details'
query_param = ''
body='{"txid":40000001,"channel":""}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/transaction/get_transaction_details"
query_param=""
body_param='{"txid":40000001,"channel":""}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/transaction/get_transaction_details
Query order details
Body parameter
{
"txid": 40000001,
"channel": ""
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | GetTransactionDetailsRequest | true | none |
| » txid | body | integer | true | Order ID |
| » channel | body | string | false | Channel tag: omit or empty for normal P2P; use web3 for Web3 orders. |
Example responses
200 Response
{
"timestamp": 1767859489.457123,
"method": "--",
"code": 0,
"message": "success",
"data": {
"is_sell": 1,
"txid": 40000001,
"orderid": 2124000001,
"timest": 1767530241,
"last_pay_time": 1767531441,
"remain_pay_time": 600,
"currency_type": "USDT",
"want_type": "USD",
"symbol": "$",
"rate": "1.230",
"amount": "3",
"total": "3.690",
"status": "paid",
"reason_id": "",
"reason_desc": "",
"cancel_time": "",
"in_appeal": 0,
"dispute_time": 0,
"cancelable": 1,
"hide_payment": 0,
"trade_tips": "Please pay from an account under your real name",
"show_bank": "1",
"bankname": "Demo Bank",
"bankbranch": "Main Branch",
"bankid": "****1234",
"bank_holder_realname": "Merchant Demo",
"show_ali": "0",
"aliname": "",
"is_alicode": 0,
"show_wechat": "0",
"wename": "",
"show_others": "0",
"pay_others": [],
"sel_paytype": "bank",
"its_uid": "biz_uid_demo_b84d21",
"its_nickname": "counterparty_demo",
"its_realname": "Counterparty Demo",
"have_traded": 1,
"appeal_allow_cancel": 0,
"appeal_verdict_has_open": "",
"im_unread": 0,
"payment_voucher_url": [],
"timest_paid": 1767530257,
"own_realname": "Merchant Demo",
"order_type": 1,
"is_show_receive": 0,
"show_seller_contact_info": false,
"supported_pay_types": [
"bank",
"swift"
]
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pTransactionDetailResponse |
Response Schema
Status Code 200
P2pTransactionDetailResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» is_sell | integer | Whether the current user is the seller. 1: yes; 0: no. |
| »» txid | integer | Order ID |
| »» orderid | integer | Order ID |
| »» timest | integer | Order creation timestamp |
| »» last_pay_time | integer | Payment deadline |
| »» remain_pay_time | integer | Seconds left to pay; <= 0 means overdue. |
| »» currency_type | string | Cryptocurrency symbol. |
| »» want_type | string | Fiat currency |
| »» symbol | string | Fiat currency symbol |
| »» rate | string | Order price in want_type units. |
| »» amount | string | Order size in cryptocurrency. |
| »» total | string | Total fiat amount of the order. |
| »» status | string | Display status: unpay unpaid; hide_payment unpaid with payment info hidden; paid buyer paid; unconfirmed awaiting seller confirmation; locked locked; finished done; cancel canceled; expired expired; bclosed arbitration filled; sclosed arbitration canceled. |
| »» reason_id | string | Cancel reason ID; empty string means none. Examples: 1 no longer want to buy; 2 cannot reach seller; 3 will not pay; 4 seller did not provide a real account; 6 price/amount mismatch; 9 other; 10 seller cannot release and refund issued; 11 terms not met; 12 seller payout account risk-controlled. |
| »» reason_desc | string | Cancel reason description. |
| »» cancel_time | string | Cancellation time |
| »» in_appeal | integer | Whether a dispute is active. 1: yes; 0: no. |
| »» dispute_time | integer | Earliest timestamp when a dispute may be opened. |
| »» cancelable | integer | Whether cancellation is allowed. 1: yes; 0: no. |
| »» hide_payment | integer | Whether payment methods are hidden. 1: hidden; 0: visible. |
| »» trade_tips | string | Trading terms |
| »» show_bank | string | Whether to show bank transfer details. 1: show; 0: hide. |
| »» bankname | string | Bank name |
| »» bankbranch | string | Bank branch name |
| »» bankid | string | Bank account or masked account. |
| »» bank_holder_realname | string | Bank cardholder name |
| »» show_ali | string | Whether to show Alipay details. 1: show; 0: hide. |
| »» aliname | string | Alipay account name |
| »» is_alicode | integer | Whether an Alipay QR exists. 1: yes; 0: no. |
| »» show_wechat | string | Whether to show WeChat details. 1: show; 0: hide. |
| »» wename | string | WeChat account name |
| »» show_others | string | Whether to show other payment methods. 1: show; 0: hide. |
| »» pay_others | array | Other payment methods |
| »»» id | string | Payment method record ID. |
| »»» account_des | string | Payment method description |
| »»» pay_type | string | Payment method type |
| »»» account | string | Payment account or masked account. |
| »»» memo | string | Payment note or memo. |
| »»» trade_tips | string | Payment instructions or tips. |
| »»» pay_name | string | Display name of the payment method. |
| »» sel_paytype | string | Selected payment type for this order, e.g. bank, alipay, wechat, paypal, swift, wu. |
| »» its_uid | string | Counterparty crypto UID. |
| »» its_nickname | string | Counterparty nickname |
| »» its_realname | string | Counterparty real name or verified display name. |
| »» have_traded | integer | Whether you traded with the counterparty before. 1: yes; 0: no. |
| »» appeal_allow_cancel | integer | Whether the dispute can be withdrawn. 1: allowed; 0: not allowed. |
| »» appeal_verdict_has_open | string | Dispute outcome or in-dispute notice text. |
| »» im_unread | integer | Unread chat message count. |
| »» payment_voucher_url | array | Payment voucher |
| »» timest_paid | integer | Timestamp when the buyer confirmed payment. |
| »» own_realname | string | Current user's real name or verified display name. |
| »» order_type | integer | Order type: 1 standard; 2 partner; 3 flash swap; 4 Web3. |
| »» is_show_receive | integer | Whether to show confirm-receipt during dispute. 1: show; 0: hide. |
| »» show_seller_contact_info | boolean | Whether to display seller contact information |
| »» supported_pay_types | array | Supported payment method types for the order, e.g. bank, alipay, wechat, paypal, swift, wu. |
| » version | string | none |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Confirm payment
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/transaction/confirm-payment'
query_param = ''
body='{"txid":"40000001","payment_method":"bank"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/transaction/confirm-payment"
query_param=""
body_param='{"txid":"40000001","payment_method":"bank"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/transaction/confirm-payment
Confirm payment
Body parameter
{
"txid": "40000001",
"payment_method": "bank"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | ConfirmPayment | true | none |
| » txid | body | string | true | Order ID |
| » payment_method | body | string | false | Payment type used for this payment; optional but must be among order-supported types. Use supported_pay_types on the order or pay_type list, e.g. bank, alipay, wechat, paypal, swift, wu. |
Example responses
200 Response
{
"timestamp": 1767009886.638032,
"method": "--",
"code": 0,
"message": "success",
"data": {},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pTransactionActionResponse |
Response Schema
Status Code 200
P2pTransactionActionResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | Response timestamp. |
| » method | string | Placeholder for request method. |
| » code | integer | Response code, 0 means success |
| » message | string | Response message |
| » data | object | Empty object on success. |
| » version | string | API version. |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Confirm receipt
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/transaction/confirm-receipt'
query_param = ''
body='{"txid":"40000001"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/transaction/confirm-receipt"
query_param=""
body_param='{"txid":"40000001"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/transaction/confirm-receipt
Confirm receipt
Body parameter
{
"txid": "40000001"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | ConfirmReceipt | true | none |
| » txid | body | string | true | Order ID |
Example responses
200 Response
{
"timestamp": 1767009886.638032,
"method": "--",
"code": 0,
"message": "success",
"data": {},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pTransactionActionResponse |
Response Schema
Status Code 200
P2pTransactionActionResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | Response timestamp. |
| » method | string | Placeholder for request method. |
| » code | integer | Response code, 0 means success |
| » message | string | Response message |
| » data | object | Empty object on success. |
| » version | string | API version. |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Cancel order
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/transaction/cancel'
query_param = ''
body='{"txid":"40000001","reason_id":"1","reason_memo":"Canceled after agreement with the counterparty"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/transaction/cancel"
query_param=""
body_param='{"txid":"40000001","reason_id":"1","reason_memo":"Canceled after agreement with the counterparty"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/transaction/cancel
Cancel order
Body parameter
{
"txid": "40000001",
"reason_id": "1",
"reason_memo": "Canceled after agreement with the counterparty"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CancelOrder | true | none |
| » txid | body | string | true | Order ID |
| » reason_id | body | string | false | Cancel reason ID. 1 no longer want to buy; 2 cannot reach seller; 3 will not pay; 4 seller account not real; 5 payout account issue; 6 price mismatch; 7 mutually agreed cancel; 8 poor communication; 9 other; 10 seller cannot release with refund; 11 terms not met; 12 seller payout risk-controlled. |
| » reason_memo | body | string | false | Extra cancel notes when reason_id is 9 or explanation is required. |
Example responses
200 Response
{
"timestamp": 1767009886.638032,
"method": "--",
"code": 0,
"message": "success",
"data": {},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pTransactionActionResponse |
Response Schema
Status Code 200
P2pTransactionActionResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | Response timestamp. |
| » method | string | Placeholder for request method. |
| » code | integer | Response code, 0 means success |
| » message | string | Response message |
| » data | object | Empty object on success. |
| » version | string | API version. |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Publish ad order
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/books/place_biz_push_order'
query_param = ''
body='{"currencyType":"USDT","exchangeType":"USD","type":"0","unitPrice":"1.1","number":"100","payType":"bank,swift","pay_type_json":"{\"bank\":\"10001\",\"swift\":\"10002\"}","rateFixed":"1","oid":"2124000001","minAmount":"10","maxAmount":"500","limitBasis":1,"fiatMinAmount":"100","fiatMaxAmount":"1000","tierLimit":"0","verifiedLimit":"0","regTimeLimit":"0","advertisersLimit":"0","polymarket_limit":0,"expire_min":"20","trade_tips":"Please pay from an account under your own name","auto_reply":"Please tap Paid after completing the transfer","min_completed_limit":"-1","max_completed_limit":"-1","completed_rate_limit":"-1","user_country_limit":"-1","user_order_limit":"-1","rateReferenceId":"3","rateOffset":"0.5","float_trend":"0","team_payment_uid":"1000001"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/books/place_biz_push_order"
query_param=""
body_param='{"currencyType":"USDT","exchangeType":"USD","type":"0","unitPrice":"1.1","number":"100","payType":"bank,swift","pay_type_json":"{\"bank\":\"10001\",\"swift\":\"10002\"}","rateFixed":"1","oid":"2124000001","minAmount":"10","maxAmount":"500","limitBasis":1,"fiatMinAmount":"100","fiatMaxAmount":"1000","tierLimit":"0","verifiedLimit":"0","regTimeLimit":"0","advertisersLimit":"0","polymarket_limit":0,"expire_min":"20","trade_tips":"Please pay from an account under your own name","auto_reply":"Please tap Paid after completing the transfer","min_completed_limit":"-1","max_completed_limit":"-1","completed_rate_limit":"-1","user_country_limit":"-1","user_order_limit":"-1","rateReferenceId":"3","rateOffset":"0.5","float_trend":"0","team_payment_uid":"1000001"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/books/place_biz_push_order
Publish ad order
When publishing or editing an advertisement, trade_tips and auto_reply go through off-platform traffic diversion risk control; when hit, the advertisement is not saved, and code 70305102 with data.risk_event is returned.
Body parameter
{
"currencyType": "USDT",
"exchangeType": "USD",
"type": "0",
"unitPrice": "1.1",
"number": "100",
"payType": "bank,swift",
"pay_type_json": "{\"bank\":\"10001\",\"swift\":\"10002\"}",
"rateFixed": "1",
"oid": "2124000001",
"minAmount": "10",
"maxAmount": "500",
"limitBasis": 1,
"fiatMinAmount": "100",
"fiatMaxAmount": "1000",
"tierLimit": "0",
"verifiedLimit": "0",
"regTimeLimit": "0",
"advertisersLimit": "0",
"polymarket_limit": 0,
"expire_min": "20",
"trade_tips": "Please pay from an account under your own name",
"auto_reply": "Please tap Paid after completing the transfer",
"min_completed_limit": "-1",
"max_completed_limit": "-1",
"completed_rate_limit": "-1",
"user_country_limit": "-1",
"user_order_limit": "-1",
"rateReferenceId": "3",
"rateOffset": "0.5",
"float_trend": "0",
"team_payment_uid": "1000001"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | PlaceBizPushOrder | true | none |
| » currencyType | body | string | true | Cryptocurrency symbol. |
| » exchangeType | body | string | true | Fiat currency |
| » type | body | string | true | Ad operation type. 0: publish sell ad; 1: publish buy ad; 2: edit sell ad; 3: edit buy ad. |
| » unitPrice | body | string | true | Per-unit price in fixed-price mode. |
| » number | body | string | true | Ad amount priced in currencyType. |
| » payType | body | string | true | Payment types enabled for the ad, comma-separated; values can be obtained from pay_type in the payment method list, e.g. bank, alipay, wechat, paypal, swift, wu. pay_type_json uses the types in this field as keys to specify the corresponding payment accounts. |
| » pay_type_json | body | string | false | JSON string of specific payment accounts corresponding to payType. Each key is a payment type listed in payType, and each value is the current user's payment method ID for that type. For example, when payType is bank,swift, this field can be {"bank":"10001","swift":"10002"}. |
| » rateFixed | body | string | false | Price type: 0 floating; 1 fixed. |
| » oid | body | string | false | Pass ad ID when editing; omit or empty when publishing a new ad. |
| » minAmount | body | string | false | Minimum quantity per order, denominated by currencyType; required when limitBasis is not passed or is 0 |
| » maxAmount | body | string | false | Maximum quantity per order, denominated by currencyType; required when limitBasis is not passed or is 0 |
| » limitBasis | body | integer | false | Trading limit unit. 0: by crypto quantity, 1: by fiat amount; defaults to 0 when not passed for a new ad. The limit unit of an existing ad cannot be changed when editing; a fiat-limit ad must keep passing 1 when edited |
| » fiatMinAmount | body | string | false | Minimum amount per order, denominated by exchangeType; required when limitBasis is 1 |
| » fiatMaxAmount | body | string | false | Maximum amount per order, denominated by exchangeType; required when limitBasis is 1, and must not exceed the total fiat value of the ad quantity converted at the price |
| » tierLimit | body | string | false | Minimum counterparty VIP level; 0 means no requirement. |
| » verifiedLimit | body | string | false | Minimum counterparty verification level; 0 means no limit. |
| » regTimeLimit | body | string | false | Minimum counterparty account age in days; 0 means no limit. |
| » advertisersLimit | body | string | false | Whether trading with the advertiser is restricted. 0: no; 1: yes. |
| » polymarket_limit | body | integer | false | Whether to restrict trading with Polymarket users. 0: no restriction, 1: restricted |
| » expire_min | body | string | false | Payment timeout in minutes. |
| » trade_tips | body | string | false | Advertisement trade terms displayed to ordering users; goes through off-platform traffic diversion risk control on submission, and when hit, the advertisement is not saved and code 70305102 is returned |
| » auto_reply | body | string | false | Auto reply content after order creation; goes through off-platform traffic diversion risk control on submission, and when hit, the advertisement is not saved and code 70305102 is returned |
| » min_completed_limit | body | string | false | Minimum completed orders for counterparty; -1 unlimited. |
| » max_completed_limit | body | string | false | Maximum completed orders for counterparty; -1 unlimited. |
| » completed_rate_limit | body | string | false | Counterparty minimum 30-day completion rate; -1 means no limit. |
| » user_country_limit | body | string | false | KYC nationality restriction; -1 means no restriction. |
| » user_order_limit | body | string | false | Maximum concurrent orders allowed for the counterparty. -1: unlimited. |
| » rateReferenceId | body | string | false | Floating price reference. 1: platform reference; 2: Gate reference; 3: spot reference. |
| » rateOffset | body | string | false | Absolute floating offset ratio, e.g. 0.5 means 0.5%. |
| » float_trend | body | string | false | Floating direction: 0 markup; 1 markdown. |
| » team_payment_uid | body | string | false | Team payee UID; optional for non-team merchants. |
# Enumerated Values
| Parameter | Value |
|---|---|
| » type | 0 |
| » type | 1 |
| » type | 2 |
| » type | 3 |
| » limitBasis | 0 |
| » limitBasis | 1 |
| » polymarket_limit | 0 |
| » polymarket_limit | 1 |
Example responses
200 Response
{
"timestamp": 1767009886.638032,
"method": "--",
"code": 0,
"message": "success",
"data": {},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pMerchantBooksPlaceBizPushOrderResponse |
Response Schema
Status Code 200
P2pMerchantBooksPlaceBizPushOrderResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | Response timestamp. |
| » method | string | Placeholder for request method. |
| » code | integer | Response code. 0 means success; 70305102 means the advertisement trade terms or auto reply hit off-platform traffic diversion risk control |
| » message | string | Response message |
| » data | object | Empty object when the advertisement is published or edited successfully; returns risk details when the advertisement content hits risk control |
| »» risk_code | integer | Risk control sub-code; 0 for advertisement content traffic diversion risk control |
| »» risk_event | object | Risk control prompt event for advertisement content |
| »»» type | string | Prompt display type |
| »»» title | string | Risk control prompt title |
| »»» msg | string | Risk control prompt message generated based on the field that hit risk control |
| »»» action | array | Available actions; advertisement content risk control only returns the close action |
| »»»» action_type | string | Action type |
| »»»» title | string | Action button text |
| »»»» mainly | integer | Whether it is the primary action. 0: no |
| »»»» action_data | object | Additional data of the action; empty object for the close action |
| »»» content_risk_type | string | Advertisement content field that hit risk control |
| »»» trade_tips | string | Prompt message returned when the trade terms hit risk control |
| »»» auto_reply | string | Prompt message returned when the auto reply hits risk control |
| »» version | string | API version. |
# Enumerated Values
| Property | Value |
|---|---|
| type | modal |
| action_type | close |
| mainly | 0 |
| content_risk_type | trade_tips |
| content_risk_type | auto_reply |
| content_risk_type | trade_tips_auto_reply |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Update ad status
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/books/ads_update_status'
query_param = ''
body='{"adv_no":2124000001,"adv_status":3}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/books/ads_update_status"
query_param=""
body_param='{"adv_no":2124000001,"adv_status":3}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/books/ads_update_status
Update ad status
Body parameter
{
"adv_no": 2124000001,
"adv_status": 3
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | AdsUpdateStatus | true | none |
| » adv_no | body | integer | true | Advertisement ID. |
| » adv_status | body | integer | true | Ad status. 1: listed; 3: delisted; 4: closed. |
# Enumerated Values
| Parameter | Value |
|---|---|
| » adv_status | 1 |
| » adv_status | 3 |
| » adv_status | 4 |
Example responses
200 Response
{
"timestamp": 1767009886.638032,
"method": "--",
"code": 0,
"message": "success",
"data": {
"status": 3
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pAdsUpdateStatusResponse |
Response Schema
Status Code 200
P2pAdsUpdateStatusResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» status | integer | Ad status after update: 1 listed; 3 delisted; 4 closed. |
| » version | string | none |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Query ad details
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/books/ads_detail'
query_param = ''
body='{"adv_no":"2124000001"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/books/ads_detail"
query_param=""
body_param='{"adv_no":"2124000001"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/books/ads_detail
Query ad details
Body parameter
{
"adv_no": "2124000001"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | AdsDetailRequest | true | none |
| » adv_no | body | string | true | Advertisement ID. |
Example responses
200 Response
{
"timestamp": 1767149820.871772,
"method": "--",
"code": 0,
"message": "Success",
"data": {
"rate": "0.908",
"type": "sell",
"amount": "100.00",
"min_amount": "10",
"max_amount": "500",
"fiat_min_amount": "9.08",
"fiat_max_amount": "454.00",
"limit_basis": 0,
"limit_basis_text": "crypto",
"total": "90.800",
"pay_ali": 0,
"pay_bank": 1,
"pay_paypal": 0,
"pay_wechat": 0,
"pay_type_num": "2,5",
"pay_type_json": "{\"bank\":\"10001\",\"swift\":\"10002\"}",
"locked_amount": "0",
"orderid": 2124000001,
"timestamp": 1766988136,
"currency_type": "USDT",
"want_type": "USD",
"hide_rate": "0.000",
"trade_tips": "Please pay from an account under your real name",
"auto_reply": "Thanks for your order. I will process it soon.",
"rate_ref_id": 3,
"rate_offset": 0.5,
"status": "OPEN",
"rate_fixed": 0,
"float_trend": 0,
"expire_min": 20,
"tier_limit": 0,
"reg_time_limit": 0,
"advertisers_limit": 0,
"polymarket_limit": 0,
"min_completed_limit": -1,
"max_completed_limit": -1,
"user_orders_limit": -1,
"completed_rate_limit": -1,
"limit_country_cn": "",
"limit_country_en": "",
"is_hedge": 0,
"hide_payment": 0
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pAdDetailResponse |
Response Schema
Status Code 200
P2pAdDetailResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» rate | string | Advertisement price. |
| »» type | string | Ad side: buy buy-crypto ad; sell sell-crypto ad. |
| »» amount | string | Remaining crypto amount on the ad. |
| »» min_amount | string | Minimum quantity per order, denominated by currency_type |
| »» max_amount | string | Maximum quantity per order, denominated by currency_type |
| »» fiat_min_amount | string | Minimum trade amount in want_type. |
| »» fiat_max_amount | string | Maximum trade amount priced in want_type. |
| »» limit_basis | integer | Trading limit unit. 0: crypto quantity, 1: fiat amount |
| »» limit_basis_text | string | Trading limit unit label. crypto: crypto quantity, fiat: fiat amount |
| »» total | string | Fiat amount |
| »» pay_ali | integer | Whether Alipay is supported. 1: yes; 0: no. |
| »» pay_bank | integer | Whether bank transfer is supported. 1: yes; 0: no. |
| »» pay_paypal | integer | Whether PayPal is supported. 1: yes; 0: no. |
| »» pay_wechat | integer | Whether WeChat Pay is supported. 1: yes; 0: no. |
| »» pay_type_num | string | Payment method ID list |
| »» pay_type_json | string | JSON map of payment type -> payment method ID. |
| »» locked_amount | string | Locked amount |
| »» orderid | integer | Order ID |
| »» timestamp | integer | Created time |
| »» currency_type | string | Cryptocurrency symbol. |
| »» want_type | string | Fiat type |
| »» hide_rate | string | Hidden price |
| »» trade_tips | string | Trading terms |
| »» auto_reply | string | Auto reply |
| »» rate_ref_id | integer | Floating reference: 1 platform; 2 Gate; 3 spot; <= 0 means fixed price. |
| »» rate_offset | number | Floating ratio (absolute value) |
| »» status | string | Ad status: OPEN listed; OFFLIN delisted; CLOSED closed; CANCEL canceled. |
| »» rate_fixed | integer | Price type: 0 floating; 1 fixed. |
| »» float_trend | integer | Floating direction: 0 markup; 1 markdown. |
| »» expire_min | integer | Timeout (minutes) |
| »» tier_limit | integer | Tier limit |
| »» reg_time_limit | integer | Registration time limit |
| »» advertisers_limit | integer | Whether trading with the advertiser is restricted. 0: no; 1: yes. |
| »» polymarket_limit | integer | Whether to restrict trading with Polymarket users. 0: no restriction, 1: restricted |
| »» min_completed_limit | integer | Minimum limit of completed orders |
| »» max_completed_limit | integer | Maximum limit of completed orders |
| »» user_orders_limit | integer | Order count limit |
| »» completed_rate_limit | number | 30-day completion rate limit |
| »» limit_country_cn | string | Restricted nationality (Chinese) |
| »» limit_country_en | string | Restricted nationality (English) |
| »» is_hedge | integer | Whether auto-delegation is enabled. 1: yes; 0: no. |
| »» hide_payment | integer | Whether payment methods are hidden. 1: hidden; 0: visible. |
| » version | string | none |
# Enumerated Values
| Property | Value |
|---|---|
| limit_basis | 0 |
| limit_basis | 1 |
| limit_basis_text | crypto |
| limit_basis_text | fiat |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Get my ad list
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/books/my_ads_list'
query_param = ''
body='{"asset":"USDT","fiat_unit":"USD","trade_type":"sell"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/books/my_ads_list"
query_param=""
body_param='{"asset":"USDT","fiat_unit":"USD","trade_type":"sell"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/books/my_ads_list
Get my ad list
Body parameter
{
"asset": "USDT",
"fiat_unit": "USD",
"trade_type": "sell"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | MyAdsListRequest | false | none |
| » asset | body | string | false | Crypto asset; omit to skip asset filter. |
| » fiat_unit | body | string | false | Fiat currency; omit to skip fiat filter. |
| » trade_type | body | string | false | Ad side: buy for buy-crypto ads, sell for sell-crypto ads; omit for all sides. |
Example responses
200 Response
{
"timestamp": 1767088873.074896,
"method": "--",
"code": 0,
"message": "Success",
"data": {
"lists": [
{
"type": "sell",
"rate": "1.270",
"original_rate": "1.270",
"amount": "100.00",
"total": "127.000",
"limit_total": "10~500",
"limit_fiat": "12.7~635",
"min_amount": "10",
"max_amount": "500",
"pay_type_num": "2,4",
"pay_type_json": "{\"bank\":\"10001\",\"wu\":\"10003\"}",
"expire_min": "45",
"tier_limit": "1",
"advertisers_limit": 1,
"reg_time_limit": 90,
"verified_limit": 0,
"min_completed_limit": 8,
"max_completed_limit": 9,
"user_country_limit": 4,
"completed_rate_limit": 6,
"user_orders_limit": 7,
"hide_payment": "1",
"currencyType": "USDT",
"want_type": "USD",
"trade_tips": "Please pay from an account under your real name",
"new_hand": 0,
"id": "2124000001",
"status": "OFFLIN",
"locked_amount": "0",
"hide_rate": "0.000",
"is_out_time": 0,
"rate_ref_id": -1,
"rate_offset": "0",
"rate_fixed": 1,
"float_trend": 0,
"in_dispute": 0,
"auto_reply": "Thanks for your order. I will process it soon.",
"timestamp": 1767008930,
"is_hedge": 0
}
]
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pMyAdsListResponse |
Response Schema
Status Code 200
P2pMyAdsListResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» lists | array | none |
| »»» P2pMyAd | object | none |
| »»»» type | string | Ad side: buy buy-crypto ad; sell sell-crypto ad. |
| »»»» rate | string | Price |
| »»»» original_rate | string | Original price |
| »»»» amount | string | Remaining crypto amount on the ad. |
| »»»» total | string | Remaining fiat amount of ad |
| »»»» limit_total | string | Single order limit range (cryptocurrency) |
| »»»» limit_fiat | string | Single order limit range (fiat) |
| »»»» min_amount | string | Minimum quantity per order |
| »»»» max_amount | string | Maximum quantity per order |
| »»»» pay_type_num | string | Payment method ID list |
| »»»» pay_type_json | string | JSON map of payment type -> payment method ID. |
| »»»» expire_min | string | Ad expiration time (minutes) |
| »»»» tier_limit | string | VIP limit |
| »»»» advertisers_limit | integer | Whether trading with the advertiser is restricted. 0: no; 1: yes. |
| »»»» reg_time_limit | integer | Registration time limit |
| »»»» verified_limit | integer | KYC level limit |
| »»»» min_completed_limit | integer | Minimum limit of completed orders by counterparty |
| »»»» max_completed_limit | integer | Maximum limit of completed orders by counterparty |
| »»»» user_country_limit | integer | KYC nationality restriction |
| »»»» completed_rate_limit | number | 30-day completion rate limit |
| »»»» user_orders_limit | integer | Maximum order limit for counterparty |
| »»»» hide_payment | string | Whether payment methods are hidden. 1: hidden; 0: visible. |
| »»»» currencyType | string | Cryptocurrency symbol. |
| »»»» want_type | string | Fiat currency |
| »»»» trade_tips | string | Trading terms |
| »»»» new_hand | integer | Special ad type. 0 normal; 1 newcomer guide; 2 newcomer discount; 3 featured promo; 4 KOL ad; 5 coupon ad. |
| »»»» id | string | Advertisement ID. |
| »»»» status | string | Ad status: OPEN listed; OFFLIN delisted; CLOSED closed; CANCEL canceled. |
| »»»» locked_amount | string | Ad frozen amount |
| »»»» hide_rate | string | Hidden price |
| »»»» is_out_time | integer | Whether the ad timed out. 1: timed out; 0: not yet. |
| »»»» rate_ref_id | integer | Floating reference: 1 platform; 2 Gate; 3 spot; <= 0 means fixed price. |
| »»»» rate_offset | string | Floating ratio |
| »»»» rate_fixed | integer | Price type: 0 floating; 1 fixed. |
| »»»» float_trend | integer | Floating direction: 0 markup; 1 markdown. |
| »»»» in_dispute | integer | Whether the ad had a disputed trade. 1: yes; 0: no. |
| »»»» auto_reply | string | Auto reply data |
| »»»» timestamp | integer | Ad creation time |
| »»»» is_hedge | integer | Whether auto-delegation is enabled. 1: yes; 0: no. |
| »»» version | string | Version number |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Get Advertisement List
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/books/ads_list'
query_param = ''
body='{"asset":"USDT","fiat_unit":"USD","trade_type":"sell"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/books/ads_list"
query_param=""
body_param='{"asset":"USDT","fiat_unit":"USD","trade_type":"sell"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/books/ads_list
Get Advertisement List
Body parameter
{
"asset": "USDT",
"fiat_unit": "USD",
"trade_type": "sell"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | AdsListRequest | true | none |
| » asset | body | string | true | Cryptocurrency symbol. |
| » fiat_unit | body | string | true | Fiat currency |
| » trade_type | body | string | true | Ad side: buy buy-crypto ad; sell sell-crypto ad. |
Example responses
200 Response
{
"timestamp": 1769573081.981503,
"method": "--",
"code": 0,
"message": "success",
"data": [
{
"index": 1,
"asset": "USDT",
"fiat_unit": "USD",
"adv_no": 2124000001,
"price": "0.800",
"surplus_amount": "4975.5",
"max_single_trans_amount": "4975.5",
"min_single_trans_amount": "1",
"fiat_min_amount": "0.80",
"fiat_max_amount": "3980.40",
"limit_basis": 0,
"limit_basis_text": "crypto",
"trade_methods": [
{
"icon_url_color": "https://www.gate.com/images/payment/bank.png",
"identifier": "bank",
"pay_id": "10001",
"pay_type": "bank",
"trade_method_name": "Bank Transfer"
}
],
"nick_name": "merchant_demo_01"
},
{
"index": 2,
"asset": "USDT",
"fiat_unit": "USD",
"adv_no": 2124000002,
"price": "0.880",
"surplus_amount": "12379.15",
"max_single_trans_amount": "12379.15",
"min_single_trans_amount": "10",
"fiat_min_amount": "8.80",
"fiat_max_amount": "10893.65",
"limit_basis": 1,
"limit_basis_text": "fiat",
"trade_methods": [
{
"icon_url_color": "https://www.gate.com/images/payment/swift.png",
"identifier": "swift",
"pay_id": "10002",
"pay_type": "swift",
"trade_method_name": "SWIFT"
}
],
"nick_name": "merchant_demo_02"
},
{
"index": 3,
"asset": "USDT",
"fiat_unit": "USD",
"adv_no": 2124000003,
"price": "1.000",
"surplus_amount": "2",
"max_single_trans_amount": "2",
"min_single_trans_amount": "1",
"fiat_min_amount": "1.00",
"fiat_max_amount": "2.00",
"limit_basis": 0,
"limit_basis_text": "crypto",
"trade_methods": [
{
"icon_url_color": "https://www.gate.com/images/payment/paypal.png",
"identifier": "paypal",
"pay_id": "10003",
"pay_type": "paypal",
"trade_method_name": "PayPal"
}
],
"nick_name": "merchant_demo_03"
}
],
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pAdsListResponse |
Response Schema
Status Code 200
P2pAdsListResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | array | none |
| »» P2pAdsListItem | object | none |
| »»» index | integer | Serial number |
| »»» asset | string | Cryptocurrency |
| »»» fiat_unit | string | Fiat currency |
| »»» adv_no | integer | Ad ID |
| »»» price | string | Price |
| »»» surplus_amount | string | Remaining tradable crypto quantity |
| »»» max_single_trans_amount | string | Maximum crypto size per trade. |
| »»» min_single_trans_amount | string | Minimum crypto size per trade. |
| »»» fiat_min_amount | string | Minimum fiat amount per order |
| »»» fiat_max_amount | string | Maximum fiat amount per order |
| »»» limit_basis | integer | Trading limit unit. 0: crypto quantity, 1: fiat amount |
| »»» limit_basis_text | string | Trading limit unit label. crypto: crypto quantity, fiat: fiat amount |
| »»» trade_methods | array | Supported payment methods list |
| »»»» P2pAdsListTradeMethod | object | none |
| »»»»» icon_url_color | string | Payment method color icon URL |
| »»»»» identifier | string | Payment method identifier |
| »»»»» pay_id | string | Payment method ID |
| »»»»» pay_type | string | Payment method type |
| »»»»» trade_method_name | string | Payment method name |
| »»»» nick_name | string | Advertiser Nickname |
| »»» version | string | none |
# Enumerated Values
| Property | Value |
|---|---|
| limit_basis | 0 |
| limit_basis | 1 |
| limit_basis_text | crypto |
| limit_basis_text | fiat |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Get chat history
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/chat/get_chats_list'
query_param = ''
body='{"txid":40000001,"lastreceived":1767009884,"firstreceived":1767009000}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/chat/get_chats_list"
query_param=""
body_param='{"txid":40000001,"lastreceived":1767009884,"firstreceived":1767009000}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/chat/get_chats_list
Get chat history
Body parameter
{
"txid": 40000001,
"lastreceived": 1767009884,
"firstreceived": 1767009000
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | GetChatsListRequest | true | none |
| » txid | body | integer | false | Order ID; omit or 0 to return the latest order with chat for the user. |
| » lastreceived | body | integer | false | Timestamp of the last received message for backward incremental fetch; omit on first load. |
| » firstreceived | body | integer | false | Timestamp of first received message for paging backward; omit on first load. |
Example responses
200 Response
{
"timestamp": 1767086748.178922,
"method": "--",
"code": 0,
"message": "success",
"data": {
"messages": [
{
"is_sell": 1,
"msg_type": 0,
"msg": "Please tap Paid after completing the transfer",
"username": "Self",
"timest": 1767009000
},
{
"is_sell": 1,
"msg_type": 0,
"msg": "Please contact me outside Gate",
"username": "Self",
"timest": 1767009001,
"risk_type": 1,
"toast_msg": "This message may contain security risks."
},
{
"is_sell": 1,
"msg_type": 5,
"msg": "",
"username": "Other",
"msg_obj": {
"status": "OPEN",
"text": "Order created. Awaiting buyer's payment.",
"payment_voucher": []
},
"uid": "",
"timest": 1767009001
},
{
"is_sell": 1,
"msg_type": 5,
"msg": "",
"username": "Other",
"msg_obj": {
"status": "CANCEL",
"text": "The buyer has canceled the order.",
"reason_id": 1,
"toast_id": 1,
"reason_memo": "I don't want to buy the coins anymore.",
"cancel_time": 1767009300,
"seller_confirm": 0,
"payment_voucher": []
},
"uid": "",
"timest": 1767009300
},
{
"uid": "System",
"username": "System",
"type": 2,
"msg": "Please keep all communication within the Gate platform.",
"timest": 1767009400
},
{
"is_sell": 1,
"msg_type": 4,
"msg": "",
"username": "Other",
"uid": "biz_uid_demo_b84d21",
"timest": 1767009500,
"msg_obj": {
"id": "10002",
"account_des": "Business USD account",
"pay_type": "swift",
"file": "",
"file_key": "",
"account": "****5678",
"memo": "Use order txid as reference",
"code": "",
"memo_ext": "",
"trade_tips": "Please pay from an account under your real name",
"real_name": "Merchant Demo",
"is_delete": 1,
"pay_name": "SWIFT International Remittance"
}
},
{
"is_sell": 1,
"msg_type": 0,
"msg": "Payment completed, please check",
"username": "Other",
"timest": 1767009600
},
{
"is_sell": 1,
"msg_type": 1,
"msg": "https://example.com/p2p/chat/receipt.png",
"username": "Other",
"timest": 1767009700,
"pic": "https://example.com/p2p/chat/receipt.png",
"file_key": "c2cchat_image/c2ctrade-demo-receipt|s3-gateio-payments",
"file_type": "image",
"type": 1
}
],
"memo": "",
"has_history": false,
"txid": 40000001,
"SRVTM": 1767009700,
"order_status": "CANCEL"
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pChatListResponse |
Response Schema
Status Code 200
P2pChatListResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» messages | array | Message List |
| »»» P2pChatMessage | object | none |
| »»»» is_sell | integer | Whether the current user is the seller. 1: yes; 0: no. |
| »»»» msg_type | integer | Message type: 0 text; 1 file; 2 template; 3 order-share; 4 payment-share; 5 status update. |
| »»»» msg | string | Message content; for file messages, usually URL or file key. |
| »»»» username | string | Message sender username |
| »»»» timest | integer | Message timestamp |
| »»»» msg_obj | object | none |
| »»»»» status | string | Order status when sending a message. Typical values: OPEN, PAID, LOCKED, ACCEPT, BCLOSED, CANCEL, BECANCEL, SCLOSED, SCANCEL. |
| »»»»» text | string | Message content |
| »»»»» payment_voucher | array | Payment voucher |
| »»»»» reason_id | integer | Cancel reason ID. 1 no longer want to buy; 2 cannot reach seller; 3 will not pay; 4 seller account not real; 5 payout account issue; 6 price mismatch; 7 mutually agreed cancel; 8 poor communication; 9 other; 10 seller cannot release with refund; 11 terms not met; 12 seller payout risk-controlled. |
| »»»»» toast_id | integer | Cancellation reason popup |
| »»»»» reason_memo | string | Cancel reason description. |
| »»»»» cancel_time | integer | Cancellation time |
| »»»»» seller_confirm | integer | Seller confirmation of cancel reason: 0 pending; 1 confirmed; 2 rejected. |
| »»»»» id | string | Payment method information ID |
| »»»»» account_des | string | Payment method description |
| »»»»» pay_type | string | Payment method type |
| »»»»» file | string | Payment method file link |
| »»»»» file_key | string | Payment method file key |
| »»»»» account | string | Payment account or masked payment account. |
| »»»»» memo | string | Payment method note |
| »»»»» code | string | Payment method code |
| »»»»» memo_ext | string | Payment method additional note |
| »»»»» trade_tips | string | Payment method tip |
| »»»»» real_name | string | Payment method username |
| »»»»» is_delete | integer | Whether the payment method was deleted. 1: deleted; 0: not deleted. |
| »»»»» pay_name | string | Payment method full name |
| »»»» uid | string | Sender's crypto UID; system messages may use System or an empty string. |
| »»»» type | integer | Display type: 1 file message; 2 system message. |
| »»»» pic | string | File link |
| »»»» file_key | string | File key |
| »»»» file_type | string | File type: image for images, video for videos. |
| »»»» risk_type | integer | Risk control display type. 1: off-platform traffic diversion risk; returned when a text message hits risk control |
| »»»» toast_msg | string | Risk control prompt message; returned only when risk_type=1 |
| »»» memo | string | Payment tip (displayed on homepage only) |
| »»» has_history | boolean | Whether historical records exist |
| »»» txid | integer | Order ID |
| »»» SRVTM | integer | Timestamp of the latest message. |
| »»» order_status | string | Raw order status in DB; typical values: OPEN, PAID, LOCKED, ACCEPT, BCLOSED, CANCEL, BECANCEL, SCLOSED, SCANCEL. |
| »» version | string | none |
# Enumerated Values
| Property | Value |
|---|---|
| risk_type | 1 |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Send text message
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/chat/send_chat_message'
query_param = ''
body='{"txid":40000001,"type":0,"message":"Payment completed, please check"}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/chat/send_chat_message"
query_param=""
body_param='{"txid":40000001,"type":0,"message":"Payment completed, please check"}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/chat/send_chat_message
Send text message
Text messages go through off-platform traffic diversion risk control. When hit, the API still returns code 0, and data contains risk_type=1 and toast_msg.
Body parameter
{
"txid": 40000001,
"type": 0,
"message": "Payment completed, please check"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | SendChatMessageRequest | true | none |
| » txid | body | integer | true | Order ID |
| » type | body | integer | false | Message type: 0 text; 1 file (image or video); defaults to 0. |
| » message | body | string | true | Message content. When type=0, pass text up to 500 characters, which goes through off-platform traffic diversion risk control; when hit, the response contains risk_type=1 and toast_msg. When type=1, pass the file_key returned by upload_chat_file |
# Enumerated Values
| Parameter | Value |
|---|---|
| » type | 0 |
| » type | 1 |
Example responses
200 Response
{
"timestamp": 1767009886.638032,
"method": "--",
"code": 0,
"message": "success",
"data": {
"SRVTM": 1767009886638,
"txid": 40000001,
"conversation_id": "1000001_1000002",
"msg_type": 0,
"risk_type": 1,
"toast_msg": "This message may contain security risks."
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pSendChatMessageResponse |
Response Schema
Status Code 200
P2pSendChatMessageResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» SRVTM | integer | Timestamp when message was successfully sent (current timestamp) |
| »» txid | integer | Order ID |
| »» conversation_id | string | Chat ID, formatted as both parties' UIDs concatenated in ascending order |
| »» msg_type | integer | Message content type when risk control is hit. 0: text |
| »» risk_type | integer | Risk control display type. 1: off-platform traffic diversion risk; returned only when risk control is hit |
| »» toast_msg | string | Risk control prompt message; returned only when risk_type=1 |
| » version | string | none |
# Enumerated Values
| Property | Value |
|---|---|
| msg_type | 0 |
| risk_type | 1 |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Upload chat file
Code samples
# coding: utf-8
import requests
import time
import hashlib
import hmac
host = "https://api.gateio.ws"
prefix = "/api/v4"
headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
url = '/p2p/merchant/chat/upload_chat_file'
query_param = ''
body='{"image_content_type":"image/png","base64_img":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB..."}'
# for `gen_sign` implementation, refer to section `Authentication` above
sign_headers = gen_sign('POST', prefix + url, query_param, body)
headers.update(sign_headers)
r = requests.request('POST', host + prefix + url, headers=headers, data=body)
print(r.json())
key="YOUR_API_KEY"
secret="YOUR_API_SECRET"
host="https://api.gateio.ws"
prefix="/api/v4"
method="POST"
url="/p2p/merchant/chat/upload_chat_file"
query_param=""
body_param='{"image_content_type":"image/png","base64_img":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB..."}'
timestamp=$(date +%s)
body_hash=$(printf "$body_param" | openssl sha512 | awk '{print $NF}')
sign_string="$method\n$prefix$url\n$query_param\n$body_hash\n$timestamp"
sign=$(printf "$sign_string" | openssl sha512 -hmac "$secret" | awk '{print $NF}')
full_url="$host$prefix$url"
curl -X $method $full_url -d "$body_param" -H "Content-Type: application/json" \
-H "Timestamp: $timestamp" -H "KEY: $key" -H "SIGN: $sign"
POST /p2p/merchant/chat/upload_chat_file
Upload chat file
Body parameter
{
"image_content_type": "image/png",
"base64_img": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB..."
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | UploadChatFile | true | none |
| » image_content_type | body | string | true | File MIME type: supports image/jpeg, image/jpg, image/png, video/mp4. |
| » base64_img | body | string | true | Base64 file content; max 20 MB. |
# Enumerated Values
| Parameter | Value |
|---|---|
| » image_content_type | image/jpeg |
| » image_content_type | image/jpg |
| » image_content_type | image/png |
| » image_content_type | video/mp4 |
Example responses
200 Response
{
"timestamp": 1767009875.525072,
"method": "--",
"code": 0,
"message": "success",
"data": {
"file_key": "c2cchat_image/c2ctrade-demo-receipt|s3-gateio-payments"
},
"version": "1.0.0"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK (opens new window) | none | P2pUploadChatFileResponse |
Response Schema
Status Code 200
P2pUploadChatFileResponse
| Name | Type | Description |
|---|---|---|
| » timestamp | number | none |
| » method | string | none |
| » code | integer | none |
| » message | string | none |
| » data | object | none |
| »» file_key | string | File key |
| » version | string | none |
WARNING
To perform this operation, you must be authenticated by API key and secret
# Schemas
# AdsUpdateStatus
{
"adv_no": 2124000001,
"adv_status": 3
}
Ad status update request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| adv_no | integer | true | none | Advertisement ID. |
| adv_status | integer | true | none | Ad status. 1: listed; 3: delisted; 4: closed. |
# Enumerated Values
| Property | Value |
|---|---|
| adv_status | 1 |
| adv_status | 3 |
| adv_status | 4 |
# P2pAdDetailResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"rate": "string",
"type": "string",
"amount": "string",
"min_amount": "string",
"max_amount": "string",
"fiat_min_amount": "string",
"fiat_max_amount": "string",
"limit_basis": 0,
"limit_basis_text": "crypto",
"total": "string",
"pay_ali": 0,
"pay_bank": 0,
"pay_paypal": 0,
"pay_wechat": 0,
"pay_type_num": "string",
"pay_type_json": "string",
"locked_amount": "string",
"orderid": 0,
"timestamp": 0,
"currency_type": "string",
"want_type": "string",
"hide_rate": "string",
"trade_tips": "string",
"auto_reply": "string",
"rate_ref_id": 0,
"rate_offset": 0,
"status": "string",
"rate_fixed": 0,
"float_trend": 0,
"expire_min": 0,
"tier_limit": 0,
"reg_time_limit": 0,
"advertisers_limit": 0,
"polymarket_limit": 0,
"min_completed_limit": 0,
"max_completed_limit": 0,
"user_orders_limit": 0,
"completed_rate_limit": 0,
"limit_country_cn": "string",
"limit_country_en": "string",
"is_hedge": 0,
"hide_payment": 0
},
"version": "string"
}
P2pAdDetailResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | object | false | none | none |
| » rate | string | false | none | Advertisement price. |
| » type | string | false | none | Ad side: buy buy-crypto ad; sell sell-crypto ad. |
| » amount | string | false | none | Remaining crypto amount on the ad. |
| » min_amount | string | false | none | Minimum quantity per order, denominated by currency_type |
| » max_amount | string | false | none | Maximum quantity per order, denominated by currency_type |
| » fiat_min_amount | string | false | none | Minimum trade amount in want_type. |
| » fiat_max_amount | string | false | none | Maximum trade amount priced in want_type. |
| » limit_basis | integer | false | none | Trading limit unit. 0: crypto quantity, 1: fiat amount |
| » limit_basis_text | string | false | none | Trading limit unit label. crypto: crypto quantity, fiat: fiat amount |
| » total | string | false | none | Fiat amount |
| » pay_ali | integer | false | none | Whether Alipay is supported. 1: yes; 0: no. |
| » pay_bank | integer | false | none | Whether bank transfer is supported. 1: yes; 0: no. |
| » pay_paypal | integer | false | none | Whether PayPal is supported. 1: yes; 0: no. |
| » pay_wechat | integer | false | none | Whether WeChat Pay is supported. 1: yes; 0: no. |
| » pay_type_num | string | false | none | Payment method ID list |
| » pay_type_json | string | false | none | JSON map of payment type -> payment method ID. |
| » locked_amount | string | false | none | Locked amount |
| » orderid | integer | false | none | Order ID |
| » timestamp | integer | false | none | Created time |
| » currency_type | string | false | none | Cryptocurrency symbol. |
| » want_type | string | false | none | Fiat type |
| » hide_rate | string | false | none | Hidden price |
| » trade_tips | string | false | none | Trading terms |
| » auto_reply | string | false | none | Auto reply |
| » rate_ref_id | integer | false | none | Floating reference: 1 platform; 2 Gate; 3 spot; <= 0 means fixed price. |
| » rate_offset | number | false | none | Floating ratio (absolute value) |
| » status | string | false | none | Ad status: OPEN listed; OFFLIN delisted; CLOSED closed; CANCEL canceled. |
| » rate_fixed | integer | false | none | Price type: 0 floating; 1 fixed. |
| » float_trend | integer | false | none | Floating direction: 0 markup; 1 markdown. |
| » expire_min | integer | false | none | Timeout (minutes) |
| » tier_limit | integer | false | none | Tier limit |
| » reg_time_limit | integer | false | none | Registration time limit |
| » advertisers_limit | integer | false | none | Whether trading with the advertiser is restricted. 0: no; 1: yes. |
| » polymarket_limit | integer | false | none | Whether to restrict trading with Polymarket users. 0: no restriction, 1: restricted |
| » min_completed_limit | integer | false | none | Minimum limit of completed orders |
| » max_completed_limit | integer | false | none | Maximum limit of completed orders |
| » user_orders_limit | integer | false | none | Order count limit |
| » completed_rate_limit | number | false | none | 30-day completion rate limit |
| » limit_country_cn | string | false | none | Restricted nationality (Chinese) |
| » limit_country_en | string | false | none | Restricted nationality (English) |
| » is_hedge | integer | false | none | Whether auto-delegation is enabled. 1: yes; 0: no. |
| » hide_payment | integer | false | none | Whether payment methods are hidden. 1: hidden; 0: visible. |
| version | string | false | none | none |
# Enumerated Values
| Property | Value |
|---|---|
| limit_basis | 0 |
| limit_basis | 1 |
| limit_basis_text | crypto |
| limit_basis_text | fiat |
# P2pAdsUpdateStatusResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"status": 0
},
"version": "string"
}
P2pAdsUpdateStatusResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | object | false | none | none |
| » status | integer | false | none | Ad status after update: 1 listed; 3 delisted; 4 closed. |
| version | string | false | none | none |
# AdsListRequest
{
"asset": "USDT",
"fiat_unit": "USD",
"trade_type": "sell"
}
Get market ads list request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| asset | string | true | none | Cryptocurrency symbol. |
| fiat_unit | string | true | none | Fiat currency |
| trade_type | string | true | none | Ad side: buy buy-crypto ad; sell sell-crypto ad. |
# SetMerchantWorkHoursRequest
{
"work_status": 2,
"cycle_type": "Weekly",
"day_of_week": "1,2,3,4,5",
"time_zone": "+8",
"start_time": "09:00",
"end_time": "18:00"
}
Request to set merchant working status or custom working hours
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| work_status | integer | true | none | Working status. 0: resting, 1: working, 2: using custom working hours |
| cycle_type | string | false | none | Custom working cycle; required when work_status is 2 |
| day_of_week | string | false | none | Weekly working days, comma-separated values 1-7 for Monday to Sunday; required when work_status is 2 and cycle_type is Weekly |
| time_zone | string | false | none | UTC timezone offset, ranging from -12 to +14; required when work_status is 2 |
| start_time | string | false | none | Custom working start time in HH:mm format; required when work_status is 2 and must not be later than end_time |
| end_time | string | false | none | Custom working end time in HH:mm format; required when work_status is 2 and must not be earlier than start_time |
# Enumerated Values
| Property | Value |
|---|---|
| work_status | 0 |
| work_status | 1 |
| work_status | 2 |
| cycle_type | Weekly |
| cycle_type | Daily |
# P2pCounterpartyUserInfoResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"user_timest": "string",
"email_verified": "string",
"verified": "string",
"has_phone": "string",
"user_name": "string",
"user_note": "string",
"complete_transactions": "string",
"paid_transactions": "string",
"accepted_transactions": "string",
"transactions_used_time": "string",
"cancelled_used_time_month": "string",
"complete_transactions_month": "string",
"complete_rate_month": 0,
"is_follow": 0,
"have_traded": 0,
"biz_uid": "string",
"registration_days": 0,
"first_trade_days": 0,
"trade_versatile": true
},
"version": "string"
}
P2pCounterpartyUserInfoResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | object | false | none | none |
| » user_timest | string | false | none | User registration time (formatted string) |
| » email_verified | string | false | none | Whether email is verified. 1: yes; 0: no. |
| » verified | string | false | none | Whether KYC is completed. 1: yes; 0: no. |
| » has_phone | string | false | none | Whether a phone number is bound. 1: yes; 0: no. |
| » user_name | string | false | none | Username |
| » user_note | string | false | none | User note information |
| » complete_transactions | string | false | none | Total completed orders |
| » paid_transactions | string | false | none | Number of completed buy orders |
| » accepted_transactions | string | false | none | Number of completed sell orders |
| » transactions_used_time | string | false | none | Average time to confirm receipt |
| » cancelled_used_time_month | string | false | none | Cancellation time in last 30 days |
| » complete_transactions_month | string | false | none | Number of completed orders in last 30 days |
| » complete_rate_month | number | false | none | Completion rate in last 30 days |
| » is_follow | integer | false | none | Whether you follow this user. 1: yes; 0: no. |
| » have_traded | integer | false | none | Whether you have traded with this user before. 1: yes; 0: no. |
| » biz_uid | string | false | none | Encrypted UID |
| » registration_days | integer | false | none | Registration days |
| » first_trade_days | integer | false | none | Days since first trade |
| » trade_versatile | boolean | false | none | Single user or composite user |
| version | string | false | none | none |
# P2pTransactionDetailResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"is_sell": 0,
"txid": 0,
"orderid": 0,
"timest": 0,
"last_pay_time": 0,
"remain_pay_time": 0,
"currency_type": "string",
"want_type": "string",
"symbol": "string",
"rate": "string",
"amount": "string",
"total": "string",
"status": "string",
"reason_id": "string",
"reason_desc": "string",
"cancel_time": "string",
"in_appeal": 0,
"dispute_time": 0,
"cancelable": 0,
"hide_payment": 0,
"trade_tips": "string",
"show_bank": "string",
"bankname": "string",
"bankbranch": "string",
"bankid": "string",
"bank_holder_realname": "string",
"show_ali": "string",
"aliname": "string",
"is_alicode": 0,
"show_wechat": "string",
"wename": "string",
"show_others": "string",
"pay_others": [
{}
],
"sel_paytype": "string",
"its_uid": "string",
"its_nickname": "string",
"its_realname": "string",
"have_traded": 0,
"appeal_allow_cancel": 0,
"appeal_verdict_has_open": "string",
"im_unread": 0,
"payment_voucher_url": [
"string"
],
"timest_paid": 0,
"own_realname": "string",
"order_type": 0,
"is_show_receive": 0,
"show_seller_contact_info": true,
"supported_pay_types": [
"string"
]
},
"version": "string"
}
P2pTransactionDetailResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | object | false | none | none |
| » is_sell | integer | false | none | Whether the current user is the seller. 1: yes; 0: no. |
| » txid | integer | false | none | Order ID |
| » orderid | integer | false | none | Order ID |
| » timest | integer | false | none | Order creation timestamp |
| » last_pay_time | integer | false | none | Payment deadline |
| » remain_pay_time | integer | false | none | Seconds left to pay; <= 0 means overdue. |
| » currency_type | string | false | none | Cryptocurrency symbol. |
| » want_type | string | false | none | Fiat currency |
| » symbol | string | false | none | Fiat currency symbol |
| » rate | string | false | none | Order price in want_type units. |
| » amount | string | false | none | Order size in cryptocurrency. |
| » total | string | false | none | Total fiat amount of the order. |
| » status | string | false | none | Display status: unpay unpaid; hide_payment unpaid with payment info hidden; paid buyer paid; unconfirmed awaiting seller confirmation; locked locked; finished done; cancel canceled; expired expired; bclosed arbitration filled; sclosed arbitration canceled. |
| » reason_id | string | false | none | Cancel reason ID; empty string means none. Examples: 1 no longer want to buy; 2 cannot reach seller; 3 will not pay; 4 seller did not provide a real account; 6 price/amount mismatch; 9 other; 10 seller cannot release and refund issued; 11 terms not met; 12 seller payout account risk-controlled. |
| » reason_desc | string | false | none | Cancel reason description. |
| » cancel_time | string | false | none | Cancellation time |
| » in_appeal | integer | false | none | Whether a dispute is active. 1: yes; 0: no. |
| » dispute_time | integer | false | none | Earliest timestamp when a dispute may be opened. |
| » cancelable | integer | false | none | Whether cancellation is allowed. 1: yes; 0: no. |
| » hide_payment | integer | false | none | Whether payment methods are hidden. 1: hidden; 0: visible. |
| » trade_tips | string | false | none | Trading terms |
| » show_bank | string | false | none | Whether to show bank transfer details. 1: show; 0: hide. |
| » bankname | string | false | none | Bank name |
| » bankbranch | string | false | none | Bank branch name |
| » bankid | string | false | none | Bank account or masked account. |
| » bank_holder_realname | string | false | none | Bank cardholder name |
| » show_ali | string | false | none | Whether to show Alipay details. 1: show; 0: hide. |
| » aliname | string | false | none | Alipay account name |
| » is_alicode | integer | false | none | Whether an Alipay QR exists. 1: yes; 0: no. |
| » show_wechat | string | false | none | Whether to show WeChat details. 1: show; 0: hide. |
| » wename | string | false | none | WeChat account name |
| » show_others | string | false | none | Whether to show other payment methods. 1: show; 0: hide. |
| » pay_others | array | false | none | Other payment methods |
| »» id | string | false | none | Payment method record ID. |
| »» account_des | string | false | none | Payment method description |
| »» pay_type | string | false | none | Payment method type |
| »» account | string | false | none | Payment account or masked account. |
| »» memo | string | false | none | Payment note or memo. |
| »» trade_tips | string | false | none | Payment instructions or tips. |
| »» pay_name | string | false | none | Display name of the payment method. |
| » sel_paytype | string | false | none | Selected payment type for this order, e.g. bank, alipay, wechat, paypal, swift, wu. |
| » its_uid | string | false | none | Counterparty crypto UID. |
| » its_nickname | string | false | none | Counterparty nickname |
| » its_realname | string | false | none | Counterparty real name or verified display name. |
| » have_traded | integer | false | none | Whether you traded with the counterparty before. 1: yes; 0: no. |
| » appeal_allow_cancel | integer | false | none | Whether the dispute can be withdrawn. 1: allowed; 0: not allowed. |
| » appeal_verdict_has_open | string | false | none | Dispute outcome or in-dispute notice text. |
| » im_unread | integer | false | none | Unread chat message count. |
| » payment_voucher_url | array | false | none | Payment voucher |
| » timest_paid | integer | false | none | Timestamp when the buyer confirmed payment. |
| » own_realname | string | false | none | Current user's real name or verified display name. |
| » order_type | integer | false | none | Order type: 1 standard; 2 partner; 3 flash swap; 4 Web3. |
| » is_show_receive | integer | false | none | Whether to show confirm-receipt during dispute. 1: show; 0: hide. |
| » show_seller_contact_info | boolean | false | none | Whether to display seller contact information |
| » supported_pay_types | array | false | none | Supported payment method types for the order, e.g. bank, alipay, wechat, paypal, swift, wu. |
| version | string | false | none | none |
# P2pMerchantUserInfoResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"is_self": true,
"user_timest": "string",
"counterparties_num": 0,
"email_verified": "string",
"verified": "string",
"has_phone": "string",
"user_name": "string",
"user_note": "string",
"complete_transactions": "string",
"paid_transactions": "string",
"accepted_transactions": "string",
"transactions_used_time": "string",
"cancelled_used_time_month": "string",
"complete_transactions_month": "string",
"complete_rate_month": 0,
"orders_buy_rate_month": 0,
"is_black": 0,
"is_follow": 0,
"have_traded": 0,
"biz_uid": "string",
"blue_vip": 0,
"work_status": 0,
"registration_days": 0,
"first_trade_days": 0,
"need_replenish": 0,
"merchant_info": {
"type": "string",
"market": "string"
},
"online_status": 0,
"work_hours": {},
"transactions_month": 0,
"transactions_all": 0,
"trade_versatile": true
},
"version": "string"
}
P2pMerchantUserInfoResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | object | false | none | none |
| » is_self | boolean | false | none | Whether self |
| » user_timest | string | false | none | User registration time (formatted string) |
| » counterparties_num | integer | false | none | Number of counterparties |
| » email_verified | string | false | none | Whether email is verified. 1: yes; 0: no. |
| » verified | string | false | none | Whether KYC is completed. 1: yes; 0: no. |
| » has_phone | string | false | none | Whether a phone number is bound. 1: yes; 0: no. |
| » user_name | string | false | none | Username |
| » user_note | string | false | none | User note information |
| » complete_transactions | string | false | none | Total completed orders |
| » paid_transactions | string | false | none | Number of completed buy orders |
| » accepted_transactions | string | false | none | Number of completed sell orders |
| » transactions_used_time | string | false | none | Average time to confirm receipt |
| » cancelled_used_time_month | string | false | none | Cancellation time in last 30 days |
| » complete_transactions_month | string | false | none | Number of completed orders in last 30 days |
| » complete_rate_month | number | false | none | Completion rate in last 30 days |
| » orders_buy_rate_month | number | false | none | Buy order ratio in last 30 days |
| » is_black | integer | false | none | Whether the user is blocked. 1: yes; 0: no. |
| » is_follow | integer | false | none | Whether you follow this user. 1: yes; 0: no. |
| » have_traded | integer | false | none | Whether you have traded with this user before. 1: yes; 0: no. |
| » biz_uid | string | false | none | Encrypted UID |
| » blue_vip | integer | false | none | Blue V Crown Shield |
| » work_status | integer | false | none | Merchant work status |
| » registration_days | integer | false | none | Registration days |
| » first_trade_days | integer | false | none | Days since first trade |
| » need_replenish | integer | false | none | Whether additional margin is required. 1: yes; 0: no. |
| » merchant_info | object | false | none | Markets where user can place orders |
| »» type | string | false | none | none |
| »» market | string | false | none | none |
| » online_status | integer | false | none | Merchant online status: 1 online; 0 offline. |
| » work_hours | object|null | false | none | Merchant online status details |
| » transactions_month | number | false | none | 30-day transaction volume |
| » transactions_all | number | false | none | Total transaction volume |
| » trade_versatile | boolean | false | none | Single user or composite user |
| version | string | false | none | none |
# P2pTransactionActionResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {},
"version": "string"
}
P2pTransactionActionResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | Response timestamp. |
| method | string | false | none | Placeholder for request method. |
| code | integer | false | none | Response code, 0 means success |
| message | string | false | none | Response message |
| data | object | false | none | Empty object on success. |
| version | string | false | none | API version. |
# MyAdsListRequest
{
"asset": "USDT",
"fiat_unit": "USD",
"trade_type": "sell"
}
Get my ads list request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| asset | string | false | none | Crypto asset; omit to skip asset filter. |
| fiat_unit | string | false | none | Fiat currency; omit to skip fiat filter. |
| trade_type | string | false | none | Ad side: buy for buy-crypto ads, sell for sell-crypto ads; omit for all sides. |
# UploadChatFile
{
"image_content_type": "image/png",
"base64_img": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB..."
}
Upload chat file request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| image_content_type | string | true | none | File MIME type: supports image/jpeg, image/jpg, image/png, video/mp4. |
| base64_img | string | true | none | Base64 file content; max 20 MB. |
# Enumerated Values
| Property | Value |
|---|---|
| image_content_type | image/jpeg |
| image_content_type | image/jpg |
| image_content_type | image/png |
| image_content_type | video/mp4 |
# CancelOrder
{
"txid": "40000001",
"reason_id": "1",
"reason_memo": "Canceled after agreement with the counterparty"
}
Cancel order request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| txid | string | true | none | Order ID |
| reason_id | string | false | none | Cancel reason ID. 1 no longer want to buy; 2 cannot reach seller; 3 will not pay; 4 seller account not real; 5 payout account issue; 6 price mismatch; 7 mutually agreed cancel; 8 poor communication; 9 other; 10 seller cannot release with refund; 11 terms not met; 12 seller payout risk-controlled. |
| reason_memo | string | false | none | Extra cancel notes when reason_id is 9 or explanation is required. |
# P2pChatListResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"messages": [
{}
],
"memo": "string",
"has_history": true,
"txid": 0,
"SRVTM": 0,
"order_status": "string"
},
"version": "string"
}
P2pChatListResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | object | false | none | none |
| » messages | array | false | none | Message List |
| »» P2pChatMessage | object | false | none | none |
| »»» is_sell | integer | false | none | Whether the current user is the seller. 1: yes; 0: no. |
| »»» msg_type | integer | false | none | Message type: 0 text; 1 file; 2 template; 3 order-share; 4 payment-share; 5 status update. |
| »»» msg | string | false | none | Message content; for file messages, usually URL or file key. |
| »»» username | string | false | none | Message sender username |
| »»» timest | integer | false | none | Message timestamp |
| »»» msg_obj | object | false | none | none |
| »»»» status | string | false | none | Order status when sending a message. Typical values: OPEN, PAID, LOCKED, ACCEPT, BCLOSED, CANCEL, BECANCEL, SCLOSED, SCANCEL. |
| »»»» text | string | false | none | Message content |
| »»»» payment_voucher | array | false | none | Payment voucher |
| »»»» reason_id | integer | false | none | Cancel reason ID. 1 no longer want to buy; 2 cannot reach seller; 3 will not pay; 4 seller account not real; 5 payout account issue; 6 price mismatch; 7 mutually agreed cancel; 8 poor communication; 9 other; 10 seller cannot release with refund; 11 terms not met; 12 seller payout risk-controlled. |
| »»»» toast_id | integer | false | none | Cancellation reason popup |
| »»»» reason_memo | string | false | none | Cancel reason description. |
| »»»» cancel_time | integer | false | none | Cancellation time |
| »»»» seller_confirm | integer | false | none | Seller confirmation of cancel reason: 0 pending; 1 confirmed; 2 rejected. |
| »»»» id | string | false | none | Payment method information ID |
| »»»» account_des | string | false | none | Payment method description |
| »»»» pay_type | string | false | none | Payment method type |
| »»»» file | string | false | none | Payment method file link |
| »»»» file_key | string | false | none | Payment method file key |
| »»»» account | string | false | none | Payment account or masked payment account. |
| »»»» memo | string | false | none | Payment method note |
| »»»» code | string | false | none | Payment method code |
| »»»» memo_ext | string | false | none | Payment method additional note |
| »»»» trade_tips | string | false | none | Payment method tip |
| »»»» real_name | string | false | none | Payment method username |
| »»»» is_delete | integer | false | none | Whether the payment method was deleted. 1: deleted; 0: not deleted. |
| »»»» pay_name | string | false | none | Payment method full name |
| »»» uid | string | false | none | Sender's crypto UID; system messages may use System or an empty string. |
| »»» type | integer | false | none | Display type: 1 file message; 2 system message. |
| »»» pic | string | false | none | File link |
| »»» file_key | string | false | none | File key |
| »»» file_type | string | false | none | File type: image for images, video for videos. |
| »»» risk_type | integer | false | none | Risk control display type. 1: off-platform traffic diversion risk; returned when a text message hits risk control |
| »»» toast_msg | string | false | none | Risk control prompt message; returned only when risk_type=1 |
| »» memo | string | false | none | Payment tip (displayed on homepage only) |
| »» has_history | boolean | false | none | Whether historical records exist |
| »» txid | integer | false | none | Order ID |
| »» SRVTM | integer | false | none | Timestamp of the latest message. |
| »» order_status | string | false | none | Raw order status in DB; typical values: OPEN, PAID, LOCKED, ACCEPT, BCLOSED, CANCEL, BECANCEL, SCLOSED, SCANCEL. |
| » version | string | false | none | none |
# Enumerated Values
| Property | Value |
|---|---|
| risk_type | 1 |
# P2pSendChatMessageResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"SRVTM": 0,
"txid": 0,
"conversation_id": "string",
"msg_type": 0,
"risk_type": 1,
"toast_msg": "string"
},
"version": "string"
}
P2pSendChatMessageResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | object | false | none | none |
| » SRVTM | integer | false | none | Timestamp when message was successfully sent (current timestamp) |
| » txid | integer | false | none | Order ID |
| » conversation_id | string | false | none | Chat ID, formatted as both parties' UIDs concatenated in ascending order |
| » msg_type | integer | false | none | Message content type when risk control is hit. 0: text |
| » risk_type | integer | false | none | Risk control display type. 1: off-platform traffic diversion risk; returned only when risk control is hit |
| » toast_msg | string | false | none | Risk control prompt message; returned only when risk_type=1 |
| version | string | false | none | none |
# Enumerated Values
| Property | Value |
|---|---|
| msg_type | 0 |
| risk_type | 1 |
# P2pAdsListResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": [
{
"index": 0,
"asset": "string",
"fiat_unit": "string",
"adv_no": 0,
"price": "string",
"surplus_amount": "string",
"max_single_trans_amount": "string",
"min_single_trans_amount": "string",
"fiat_min_amount": "string",
"fiat_max_amount": "string",
"limit_basis": 0,
"limit_basis_text": "crypto",
"trade_methods": [],
"nick_name": "string"
}
],
"version": "string"
}
P2pAdsListResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | array | false | none | none |
| » P2pAdsListItem | object | false | none | none |
| »» index | integer | false | none | Serial number |
| »» asset | string | false | none | Cryptocurrency |
| »» fiat_unit | string | false | none | Fiat currency |
| »» adv_no | integer | false | none | Ad ID |
| »» price | string | false | none | Price |
| »» surplus_amount | string | false | none | Remaining tradable crypto quantity |
| »» max_single_trans_amount | string | false | none | Maximum crypto size per trade. |
| »» min_single_trans_amount | string | false | none | Minimum crypto size per trade. |
| »» fiat_min_amount | string | false | none | Minimum fiat amount per order |
| »» fiat_max_amount | string | false | none | Maximum fiat amount per order |
| »» limit_basis | integer | false | none | Trading limit unit. 0: crypto quantity, 1: fiat amount |
| »» limit_basis_text | string | false | none | Trading limit unit label. crypto: crypto quantity, fiat: fiat amount |
| »» trade_methods | array | false | none | Supported payment methods list |
| »»» P2pAdsListTradeMethod | object | false | none | none |
| »»»» icon_url_color | string | false | none | Payment method color icon URL |
| »»»» identifier | string | false | none | Payment method identifier |
| »»»» pay_id | string | false | none | Payment method ID |
| »»»» pay_type | string | false | none | Payment method type |
| »»»» trade_method_name | string | false | none | Payment method name |
| »»» nick_name | string | false | none | Advertiser Nickname |
| »» version | string | false | none | none |
# Enumerated Values
| Property | Value |
|---|---|
| limit_basis | 0 |
| limit_basis | 1 |
| limit_basis_text | crypto |
| limit_basis_text | fiat |
# GetPendingTransactionListRequest
{
"crypto_currency": "USDT",
"fiat_currency": "USD",
"order_tab": "pending",
"select_type": "sell",
"status": "open",
"txid": 40000001,
"start_time": 1764547200,
"end_time": 1767139199
}
Get pending transaction list request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| crypto_currency | string | true | none | Cryptocurrency symbol. |
| fiat_currency | string | true | none | Fiat currency |
| order_tab | string | false | none | Order tab: pending in progress (OPEN, PAID, LOCKED, TEMP); dispute in dispute; default pending. |
| select_type | string | false | none | Order side filter: buy buy orders; sell sell orders; empty: all. |
| status | string | false | none | Order status filter. open unpaid (OPEN); paid paid (PAID); locked locked (LOCKED);dispute in dispute; empty or omitted uses the default range for order_tab. |
| txid | integer | false | none | Order ID |
| start_time | integer | false | none | Start timestamp, default is 00:00 89 days ago |
| end_time | integer | false | none | End timestamp, default is 23:59:59 today |
# Enumerated Values
| Property | Value |
|---|---|
| order_tab | pending |
| order_tab | dispute |
# GetChatsListRequest
{
"txid": 40000001,
"lastreceived": 1767009884,
"firstreceived": 1767009000
}
Get chat history request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| txid | integer | false | none | Order ID; omit or 0 to return the latest order with chat for the user. |
| lastreceived | integer | false | none | Timestamp of the last received message for backward incremental fetch; omit on first load. |
| firstreceived | integer | false | none | Timestamp of first received message for paging backward; omit on first load. |
# P2pTransactionListResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"list": [
{}
],
"trans_time": [
{}
],
"count": 0,
"exported_num": 0
},
"version": "string"
}
P2pTransactionListResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | object | false | none | none |
| » list | array | false | none | none |
| »» P2pTransactionListItem | object | false | none | none |
| »»» type_buy | integer | false | none | Order side from current user's view. 1: buy; 0: sell. |
| »»» timest | string | false | none | Creation time of order |
| »»» timest_expire | string | false | none | Order expiration time |
| »»» timestamp | integer | false | none | Order creation timestamp |
| »»» rate | string | false | none | Order price in fiat currency. |
| »»» amount | string | false | none | Order size in cryptocurrency. |
| »»» total | string | false | none | Total fiat amount of the order. |
| »»» txid | integer | false | none | Order ID |
| »»» status | string | false | none | Display status: unpay awaiting payment; paid buyer paid; unconfirmed awaiting seller confirmation; locked locked; finished completed; cancel canceled; expired expired; bclosed arbitration filled; sclosed arbitration canceled. |
| »»» its_realname | string | false | none | Counterparty real name or verified display name. |
| »»» its_uid | string | false | none | Counterparty crypto UID. |
| »»» its_nick | string | false | none | Counterparty nickname |
| »»» seller_realname | string | false | none | Seller real name or verified display name. |
| »»» buyer_realname | string | false | none | Buyer real name or verified display name. |
| »»» cancelable | integer | false | none | Whether the order can be canceled. 1: yes; 0: no. |
| »»» currency_type | string | false | none | Cryptocurrency symbol. |
| »»» want_type | string | false | none | Fiat currency |
| »»» hide_payment | integer | false | none | Whether payment methods are hidden. 1: hidden; 0: visible. |
| »»» sel_paytype | string | false | none | Selected payment type for this order, e.g. bank, alipay, wechat, paypal, swift, wu. |
| »»» pay_others | array | false | none | Other payment method details; may appear on historical orders. |
| »»»» pay_type | string | false | none | Payment method type |
| »»»» pay_name | string | false | none | Payment method name |
| »»» cd_time | integer | false | none | Countdown seconds for the current order. |
| »»» order_type | integer | false | none | Order type: 1 standard; 2 partner; 3 flash swap; 4 Web3. |
| »»» order_tag | array | false | none | Order tags |
| »»» convert_info | object | false | none | Flash swap order information |
| »»»» convert_type | string | false | none | Flash swap target currency |
| »»»» convert_status | string | false | none | Flash swap order status |
| »»»» pre_rate | string | false | none | Expected price when placing order |
| »»»» rate | string | false | none | Execution price |
| »»»» pre_fiat_rate | string | false | none | Expected fiat price when placing order |
| »»»» fiat_rate | string | false | none | Fiat price at execution |
| »»»» amount | string | false | none | Size |
| »»»» convert_amount | string | false | none | Swap Amount |
| »»»» slippage | string | false | none | Slippage calculation: slippage = (expected price when placing order - real-time price during auto swap) / expected price when placing order |
| »»»» status | string | false | none | Flash swap order display status |
| »»» trans_time | array | false | none | Countdown time |
| »»»» P2pTransactionTimeMarker | object | false | none | none |
| »»»»» od_time | integer | false | none | none |
| »»»» count | integer | false | none | Number of orders |
| »»»» exported_num | integer | false | none | Export count |
| »»» version | string | false | none | none |
# PlaceBizPushOrder
{
"currencyType": "USDT",
"exchangeType": "USD",
"type": "0",
"unitPrice": "1.1",
"number": "100",
"payType": "bank,swift",
"pay_type_json": "{\"bank\":\"10001\",\"swift\":\"10002\"}",
"rateFixed": "1",
"oid": "2124000001",
"minAmount": "10",
"maxAmount": "500",
"limitBasis": 1,
"fiatMinAmount": "100",
"fiatMaxAmount": "1000",
"tierLimit": "0",
"verifiedLimit": "0",
"regTimeLimit": "0",
"advertisersLimit": "0",
"polymarket_limit": 0,
"expire_min": "20",
"trade_tips": "Please pay from an account under your own name",
"auto_reply": "Please tap Paid after completing the transfer",
"min_completed_limit": "-1",
"max_completed_limit": "-1",
"completed_rate_limit": "-1",
"user_country_limit": "-1",
"user_order_limit": "-1",
"rateReferenceId": "3",
"rateOffset": "0.5",
"float_trend": "0",
"team_payment_uid": "1000001"
}
Place ad order request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| currencyType | string | true | none | Cryptocurrency symbol. |
| exchangeType | string | true | none | Fiat currency |
| type | string | true | none | Ad operation type. 0: publish sell ad; 1: publish buy ad; 2: edit sell ad; 3: edit buy ad. |
| unitPrice | string | true | none | Per-unit price in fixed-price mode. |
| number | string | true | none | Ad amount priced in currencyType. |
| payType | string | true | none | Payment types enabled for the ad, comma-separated; values can be obtained from pay_type in the payment method list, e.g. bank, alipay, wechat, paypal, swift, wu. pay_type_json uses the types in this field as keys to specify the corresponding payment accounts. |
| pay_type_json | string | false | none | JSON string of specific payment accounts corresponding to payType. Each key is a payment type listed in payType, and each value is the current user's payment method ID for that type. For example, when payType is bank,swift, this field can be {"bank":"10001","swift":"10002"}. |
| rateFixed | string | false | none | Price type: 0 floating; 1 fixed. |
| oid | string | false | none | Pass ad ID when editing; omit or empty when publishing a new ad. |
| minAmount | string | false | none | Minimum quantity per order, denominated by currencyType; required when limitBasis is not passed or is 0 |
| maxAmount | string | false | none | Maximum quantity per order, denominated by currencyType; required when limitBasis is not passed or is 0 |
| limitBasis | integer | false | none | Trading limit unit. 0: by crypto quantity, 1: by fiat amount; defaults to 0 when not passed for a new ad. The limit unit of an existing ad cannot be changed when editing; a fiat-limit ad must keep passing 1 when edited |
| fiatMinAmount | string | false | none | Minimum amount per order, denominated by exchangeType; required when limitBasis is 1 |
| fiatMaxAmount | string | false | none | Maximum amount per order, denominated by exchangeType; required when limitBasis is 1, and must not exceed the total fiat value of the ad quantity converted at the price |
| tierLimit | string | false | none | Minimum counterparty VIP level; 0 means no requirement. |
| verifiedLimit | string | false | none | Minimum counterparty verification level; 0 means no limit. |
| regTimeLimit | string | false | none | Minimum counterparty account age in days; 0 means no limit. |
| advertisersLimit | string | false | none | Whether trading with the advertiser is restricted. 0: no; 1: yes. |
| polymarket_limit | integer | false | none | Whether to restrict trading with Polymarket users. 0: no restriction, 1: restricted |
| expire_min | string | false | none | Payment timeout in minutes. |
| trade_tips | string | false | none | Advertisement trade terms displayed to ordering users; goes through off-platform traffic diversion risk control on submission, and when hit, the advertisement is not saved and code 70305102 is returned |
| auto_reply | string | false | none | Auto reply content after order creation; goes through off-platform traffic diversion risk control on submission, and when hit, the advertisement is not saved and code 70305102 is returned |
| min_completed_limit | string | false | none | Minimum completed orders for counterparty; -1 unlimited. |
| max_completed_limit | string | false | none | Maximum completed orders for counterparty; -1 unlimited. |
| completed_rate_limit | string | false | none | Counterparty minimum 30-day completion rate; -1 means no limit. |
| user_country_limit | string | false | none | KYC nationality restriction; -1 means no restriction. |
| user_order_limit | string | false | none | Maximum concurrent orders allowed for the counterparty. -1: unlimited. |
| rateReferenceId | string | false | none | Floating price reference. 1: platform reference; 2: Gate reference; 3: spot reference. |
| rateOffset | string | false | none | Absolute floating offset ratio, e.g. 0.5 means 0.5%. |
| float_trend | string | false | none | Floating direction: 0 markup; 1 markdown. |
| team_payment_uid | string | false | none | Team payee UID; optional for non-team merchants. |
# Enumerated Values
| Property | Value |
|---|---|
| type | 0 |
| type | 1 |
| type | 2 |
| type | 3 |
| limitBasis | 0 |
| limitBasis | 1 |
| polymarket_limit | 0 |
| polymarket_limit | 1 |
# P2pMerchantBooksPlaceBizPushOrderResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"risk_code": 0,
"risk_event": {
"type": "modal",
"title": "string",
"msg": "string",
"action": [],
"content_risk_type": "trade_tips",
"trade_tips": "string",
"auto_reply": "string"
}
},
"version": "string"
}
P2pMerchantBooksPlaceBizPushOrderResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | Response timestamp. |
| method | string | false | none | Placeholder for request method. |
| code | integer | false | none | Response code. 0 means success; 70305102 means the advertisement trade terms or auto reply hit off-platform traffic diversion risk control |
| message | string | false | none | Response message |
| data | object | false | none | Empty object when the advertisement is published or edited successfully; returns risk details when the advertisement content hits risk control |
| » risk_code | integer | false | none | Risk control sub-code; 0 for advertisement content traffic diversion risk control |
| » risk_event | object | false | none | Risk control prompt event for advertisement content |
| »» type | string | false | none | Prompt display type |
| »» title | string | false | none | Risk control prompt title |
| »» msg | string | false | none | Risk control prompt message generated based on the field that hit risk control |
| »» action | array | false | none | Available actions; advertisement content risk control only returns the close action |
| »»» action_type | string | false | none | Action type |
| »»» title | string | false | none | Action button text |
| »»» mainly | integer | false | none | Whether it is the primary action. 0: no |
| »»» action_data | object | false | none | Additional data of the action; empty object for the close action |
| »» content_risk_type | string | false | none | Advertisement content field that hit risk control |
| »» trade_tips | string | false | none | Prompt message returned when the trade terms hit risk control |
| »» auto_reply | string | false | none | Prompt message returned when the auto reply hits risk control |
| » version | string | false | none | API version. |
# Enumerated Values
| Property | Value |
|---|---|
| type | modal |
| action_type | close |
| mainly | 0 |
| content_risk_type | trade_tips |
| content_risk_type | auto_reply |
| content_risk_type | trade_tips_auto_reply |
# P2pPaymentMethodsResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": [
{
"pay_type": "string",
"pay_name": "string",
"ids": [],
"list": []
}
],
"version": "string"
}
P2pPaymentMethodsResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | array | false | none | none |
| » P2pPaymentMethodGroup | object | false | none | none |
| »» pay_type | string | false | none | Payment method type |
| »» pay_name | string | false | none | Payment method name |
| »» ids | array | false | none | User's currently bound payment method (primary key ID) |
| »» list | array | false | none | none |
| »»» P2pPaymentMethodAccount | object | false | none | none |
| »»»» uid | integer | false | none | useruID |
| »»»» bankid | string | false | none | User's currently bound payment method (primary key ID) |
| »»»» nickname | integer | false | none | Cardholder UID |
| »»»» bankname | string | false | none | Bank name |
| »»»» bankbranch | string | false | none | Bank branch name |
| »»»» bankcity | string | false | none | Bank city |
| »»»» bankprov | string | false | none | Bank province |
| »»»» bankaddr | string | false | none | Bank card number or masked card number. |
| »»»» bankdesc | string | false | none | Bank note |
| »»»» hold_uid | integer | false | none | Cardholder UID |
| »»»» hold_username | string | false | none | Cardholder name |
| »»»» real_name | string | false | none | User verified display name. |
| »»»» id | string | false | none | User's currently bound payment method (primary key ID) |
| »»»» account_des | string | false | none | Payment method description |
| »»»» pay_type | string | false | none | Payment method type |
| »»»» file | string | false | none | Payment method file link |
| »»»» file_key | string | false | none | Payment method file key |
| »»»» account | string | false | none | Payment account or masked payment account. |
| »»»» memo | string | false | none | Payment method note |
| »»»» code | string | false | none | Payment method code |
| »»»» memo_ext | string | false | none | Payment method additional note |
| »»»» trade_tips | string | false | none | Payment method transaction information |
| »»» version | string | false | none | none |
# P2pMyAdsListResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"lists": [
{}
]
},
"version": "string"
}
P2pMyAdsListResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | object | false | none | none |
| » lists | array | false | none | none |
| »» P2pMyAd | object | false | none | none |
| »»» type | string | false | none | Ad side: buy buy-crypto ad; sell sell-crypto ad. |
| »»» rate | string | false | none | Price |
| »»» original_rate | string | false | none | Original price |
| »»» amount | string | false | none | Remaining crypto amount on the ad. |
| »»» total | string | false | none | Remaining fiat amount of ad |
| »»» limit_total | string | false | none | Single order limit range (cryptocurrency) |
| »»» limit_fiat | string | false | none | Single order limit range (fiat) |
| »»» min_amount | string | false | none | Minimum quantity per order |
| »»» max_amount | string | false | none | Maximum quantity per order |
| »»» pay_type_num | string | false | none | Payment method ID list |
| »»» pay_type_json | string | false | none | JSON map of payment type -> payment method ID. |
| »»» expire_min | string | false | none | Ad expiration time (minutes) |
| »»» tier_limit | string | false | none | VIP limit |
| »»» advertisers_limit | integer | false | none | Whether trading with the advertiser is restricted. 0: no; 1: yes. |
| »»» reg_time_limit | integer | false | none | Registration time limit |
| »»» verified_limit | integer | false | none | KYC level limit |
| »»» min_completed_limit | integer | false | none | Minimum limit of completed orders by counterparty |
| »»» max_completed_limit | integer | false | none | Maximum limit of completed orders by counterparty |
| »»» user_country_limit | integer | false | none | KYC nationality restriction |
| »»» completed_rate_limit | number | false | none | 30-day completion rate limit |
| »»» user_orders_limit | integer | false | none | Maximum order limit for counterparty |
| »»» hide_payment | string | false | none | Whether payment methods are hidden. 1: hidden; 0: visible. |
| »»» currencyType | string | false | none | Cryptocurrency symbol. |
| »»» want_type | string | false | none | Fiat currency |
| »»» trade_tips | string | false | none | Trading terms |
| »»» new_hand | integer | false | none | Special ad type. 0 normal; 1 newcomer guide; 2 newcomer discount; 3 featured promo; 4 KOL ad; 5 coupon ad. |
| »»» id | string | false | none | Advertisement ID. |
| »»» status | string | false | none | Ad status: OPEN listed; OFFLIN delisted; CLOSED closed; CANCEL canceled. |
| »»» locked_amount | string | false | none | Ad frozen amount |
| »»» hide_rate | string | false | none | Hidden price |
| »»» is_out_time | integer | false | none | Whether the ad timed out. 1: timed out; 0: not yet. |
| »»» rate_ref_id | integer | false | none | Floating reference: 1 platform; 2 Gate; 3 spot; <= 0 means fixed price. |
| »»» rate_offset | string | false | none | Floating ratio |
| »»» rate_fixed | integer | false | none | Price type: 0 floating; 1 fixed. |
| »»» float_trend | integer | false | none | Floating direction: 0 markup; 1 markdown. |
| »»» in_dispute | integer | false | none | Whether the ad had a disputed trade. 1: yes; 0: no. |
| »»» auto_reply | string | false | none | Auto reply data |
| »»» timestamp | integer | false | none | Ad creation time |
| »»» is_hedge | integer | false | none | Whether auto-delegation is enabled. 1: yes; 0: no. |
| »» version | string | false | none | Version number |
# GetCompletedTransactionListRequest
{
"crypto_currency": "USDT",
"fiat_currency": "USD",
"select_type": "buy",
"status": "closed",
"txid": 40000001,
"start_time": 1764547200,
"end_time": 1767139199,
"query_dispute": 0,
"page": 1,
"per_page": 20
}
Get completed/historical transaction list request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| crypto_currency | string | true | none | Cryptocurrency symbol. |
| fiat_currency | string | true | none | Fiat currency |
| select_type | string | false | none | Order side filter: buy buy orders; sell sell orders; empty: all. |
| status | string | false | none | Order status filter. closed: filled (ACCEPT, BCLOSED); cancel: canceled (CANCEL, BECANCEL, SCLOSED, SCANCEL);locked: locked (LOCKED); open: unpaid (OPEN); paid: paid (PAID);completed: finished or canceled (CANCEL, BECANCEL, SCLOSED, SCANCEL, ACCEPT, BCLOSED);Empty or omitted uses the endpoint default range. |
| txid | integer | false | none | Order ID |
| start_time | integer | false | none | Start timestamp, default is 00:00 89 days ago |
| end_time | integer | false | none | End timestamp, default is 23:59:59 today |
| query_dispute | integer | false | none | Whether to flag dispute status in the response. 1: yes; 0: no. |
| page | integer | false | none | Page number starting at 1; values below 1 are treated as 1. |
| per_page | integer | false | none | Orders per page; default 10, max 200. |
# SendChatMessageRequest
{
"txid": 40000001,
"type": 0,
"message": "Payment completed, please check"
}
Send chat message request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| txid | integer | true | none | Order ID |
| type | integer | false | none | Message type: 0 text; 1 file (image or video); defaults to 0. |
| message | string | true | none | Message content. When type=0, pass text up to 500 characters, which goes through off-platform traffic diversion risk control; when hit, the response contains risk_type=1 and toast_msg. When type=1, pass the file_key returned by upload_chat_file |
# Enumerated Values
| Property | Value |
|---|---|
| type | 0 |
| type | 1 |
# P2pMerchantWorkHoursResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"work_status": 0
},
"version": "string"
}
P2pMerchantWorkHoursResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | Response timestamp. |
| method | string | false | none | Placeholder for request method. |
| code | integer | false | none | Response code, 0 means success |
| message | string | false | none | Response message |
| data | object | false | none | none |
| » work_status | integer | false | none | Merchant's current working status. 0: normal resting, 1: normal working, 2: custom resting, 3: custom working |
| version | string | false | none | API version. |
# Enumerated Values
| Property | Value |
|---|---|
| work_status | 0 |
| work_status | 1 |
| work_status | 2 |
| work_status | 3 |
# P2pUploadChatFileResponse
{
"timestamp": 0,
"method": "string",
"code": 0,
"message": "string",
"data": {
"file_key": "string"
},
"version": "string"
}
P2pUploadChatFileResponse
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| timestamp | number | false | none | none |
| method | string | false | none | none |
| code | integer | false | none | none |
| message | string | false | none | none |
| data | object | false | none | none |
| » file_key | string | false | none | File key |
| version | string | false | none | none |
# ConfirmPayment
{
"txid": "40000001",
"payment_method": "bank"
}
Confirm payment request
# Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| txid | string | true | none | Order ID |
| payment_method | string | false | none | Payment type used for this payment; optional but must be among order-supported types. Use supported_pay_types on the order or pay_type list, e.g. bank, alipay, wechat, paypal, swift, wu. |