npx skills add ...
npx skills add binance/binance-skills-hub --skill p2p
Binance P2P trading assistant for natural-language queries about P2P/C2C market ads, the user's own P2P order history, order detail & appeal tracking, and advertisement publish & management.
npx skills add binance/binance-skills-hub --skill p2p
Help users interact with Binance P2P (C2C) via natural-language queries.
fiat (e.g., CNY)asset (e.g., USDT)tradeType mapping (avoid ambiguity)tradeType=BUYtradeType=SELLAlways reflect this mapping in responses when the user's wording is ambiguous.
| Logical Name | URL |
|---|---|
SAPI_BASE | https://api.binance.com |
MGS_BASE | https://www.binance.com |
C2C_WEB | https://c2c.binance.com |
When the skill generates curl / Python / JS code, use these fixed base URLs:
Note: SAPI signing uses HMAC SHA256, no param sorting required.
BINANCE_API_KEY (sent as header)BINANCE_SECRET_KEY (used for signing)abc12...z789***...c123.env if the user explicitly agrees..env is in .gitignore before saving.Example:
See: references/authentication.md for:
Base URL: https://www.binance.com
| Endpoint | Method | Params | Usage |
|---|---|---|---|
/bapi/c2c/v1/public/c2c/agent/quote-price | GET | fiat, asset, tradeType | Quick price quote |
/bapi/c2c/v1/public/c2c/agent/ad-list | GET | fiat, asset, tradeType, limit, order, tradeMethodIdentifiers | Search ads |
/bapi/c2c/v1/public/c2c/agent/trade-methods | GET | fiat | Payment methods |
Parameter notes:
tradeType: BUY or SELL (treat as case-insensitive)limit: 1–20 (default 10)tradeMethodIdentifiers: pass as a plain string (not JSON array) — e.g. tradeMethodIdentifiers=BANK or tradeMethodIdentifiers=WECHAT. Values must use the identifier field returned by the trade-methods endpoint (see workflow below). ⚠️ Do NOT use JSON array syntax like ["BANK"] — it will return empty results.When the user wants to compare prices across payment methods (e.g., "Alipay vs WeChat"), follow this two-step flow:
Step 1 — Call trade-methods to get the correct identifiers for the target fiat:
Step 2 — Pass the identifier as a plain string into ad-list via tradeMethodIdentifiers, one payment method per request, then compare:
Compare the best price from each result set.
Important: Do not hardcode identifier values like
"Alipay"or"BANK". Always calltrade-methodsfirst to get the exactidentifierstrings for the given fiat currency.
Base URL: https://api.binance.com
| Endpoint | Method | Auth | Usage |
|---|---|---|---|
/sapi/v1/c2c/orderMatch/listUserOrderHistory | GET | Yes | Order history |
/sapi/v1/c2c/orderMatch/getUserOrderSummary | GET | Yes | User statistics |
Authentication requirements:
X-MBX-APIKEYtimestamp + signatureUser-Agent: binance-wallet/1.0.0 (Skill)Example:
Return Top N items with a stable schema:
Avoid generating parameterized external URLs unless the API returns them.
Placing orders (when user requests):
This skill does NOT support automated order placement.
When user wants to place an order, provide a direct link to the specific ad using the adNo:
{adNo}: the ad number/identifier from the ad list resultExample: https://c2c.binance.com/en/adv?code=123
This opens the specific ad detail page where user can place order directly with the selected advertisement.
YYYY-MM-DD HH:mm (UTC+0) — always display in UTC timezoneTime field conversion (for createTime in listUserOrderHistory):
createTime field returns a Unix timestamp in milliseconds (13 digits)..env / API Management.This skill does NOT:
For in-app actions, guide users to the official P2P orders page (only as a general entry point).
On the first invocation of this skill per conversation, call:
GET /bapi/c2c/v1/public/c2c/agent/check-version?version=2.0.0 (Base: https://www.binance.com)Behavior:
needUpdate=true: show: New version of P2P Skill is available (current: {clientVersion}, latest: {latestVersion}), update recommended.Phase 3 extends the skill from read-only market/order queries to write operations (ad management) and advanced order workflows (order detail, appeal/complaint tracking).
| Constraint | Details |
|---|---|
| Authentication | All Phase 3 features require API Key + Secret Key |
| Write-op confirmation | Any write operation (publish ad, update ad, change status) must show an operation summary and get explicit user confirmation before executing |
| API Key permissions | Phase 1 only needed "Enable Reading"; Phase 3 additionally needs write permissions for ad management |
| Privacy masking | Never display counterparty sensitive info (bank card, Alipay account, phone, email, real name) or internal IDs (payId). Even if the API returns these fields, filter them out in user-facing output. For payment methods, show only tradeMethodName (e.g. "支付宝") |
Trigger examples:
Behavior:
getUserOrderDetaillistOrders with filters, then let user pickStatus branch handling:
| Status | Action |
|---|---|
| Completed (4) | Show full timeline (create → pay → confirm → complete), finish |
| Cancelled (6) / Expired (7) | Show cancel reason (timeout / manual / system), finish |
| In Progress (1=Unpaid, 2=Paid, 3=Releasing) | Show current step + countdown timers |
| In Appeal (5) | Auto-enter 1.2 — show appeal status |
Output format (Order Detail):
Countdown display (for in-progress orders):
Trigger:
Behavior:
query-complaints with the order numberOutput format:
Follow-up guidance (append after the status block, based on complaintStatus):
| complaintStatus | Guidance to show |
|---|---|
| 0 (Respondent Processing) | "Waiting for the counterparty to respond. You will be notified when there is an update." |
| 1 (Complainant Processing) | "⚡ Action needed — you need to provide evidence or respond. Say "submit evidence for order {orderNo}" to upload proof now." |
| 2 (CS Processing) | "💡 Both parties may still submit evidence at this stage. You can submit evidence directly through this skill — say "submit evidence for order {orderNo}" or "提交证据" to upload payment proof, screenshots, or other supporting documents." |
| 3 (Completed) | "This appeal has been resolved." |
| 4 (Cancelled) | "This appeal has been cancelled." |
MUST follow: When
complaintStatusis 0, 1, or 2 (appeal still active), NEVER tell the user to "go to the app" or "head to the dispute center". Always guide them to use this skill to submit evidence. The skill supports the full evidence upload flow (Scene 1.5).
Complaint status mapping:
| Status Code | Display Name | Description |
|---|---|---|
| 0 | Respondent Processing (被申诉人处理中) | Complaint initiated, waiting for counterparty to respond |
| 1 | Complainant Processing (申诉人处理中) | Waiting for complainant to provide evidence or take action |
| 2 | CS Processing (客服处理中) | Customer service reviewing; both parties may submit evidence |
| 3 | Completed (已完成) | Appeal resolved |
| 4 | Complaint Cancelled (申诉取消) | Appeal withdrawn |
Important: Do NOT confuse these with
orderStatuscodes — they are separate enums. WhencomplaintStatus=2(CS Processing), the user should be guided to submit evidence if needed; do NOT tell them to "wait for counterparty".
Trigger:
Behavior:
query-complaints with optional filters (roleIdentity, status, date range)Output format:
Trigger:
Behavior:
listOrders (richer filter: advNo, status, payType)listUserOrderHistory (supports tradeType, date range)Output format (Order List):
Order status code mapping:
| Code | Name | Chinese |
|---|---|---|
| 0 | Pending | 处理中 |
| 1 | Unpaid | 未付款 |
| 2 | Paid (Unconfirmed) | 已付款 |
| 3 | Releasing | 放币处理中 |
| 4 | Completed | 已完成 |
| 5 | In Appeal | 申诉中 |
| 6 | Cancelled | 已取消 |
| 7 | Expired (System Cancel) | 超时取消 |
Trigger:
complaintStatus=2 (CS Processing)Behavior (3-step flow):
Step 1 — Get presigned upload URL:
Step 2 — Upload file to S3:
The presigned URL is valid for 5 minutes. Upload must complete within this window.
Step 3 — Submit evidence to SAPI:
Supported file types:
txt, doc, xls, docx, xlsx, jpg, jpeg, png, pdf, mp3, mp4, avi, rm, rmvb, mov, wmv
Output format (Upload Progress):
Output format (Failure):
Common errors:
Unsupported file type → Check file extension; see supported types abovePresigned URL expired → Re-request upload URL (Step 1)Order not in appeal → Evidence can only be submitted for orders with active complaintsFile too large → Reduce file size or split into multiple filesWrite-op confirmation rule: Evidence submission follows the same confirmation protocol as Scene 2 write operations:
Confirmation format:
Trigger:
Behavior:
get-complaint-flows with orderNo (and optionally complaintNo)Output format:
Info type mapping (for display):
| infoType | Description |
|---|---|
| 1 | Complaint Initiated |
| 2 | Evidence Submitted |
| 3 | CS Review Note |
| 4 | Resolution / Decision |
Note:
fileUrlsin the response are CDN-assembled URLs that can be directly accessed.remarkHtmltakes precedence overremarkwhen available for rendering.
Trigger:
⚠️ This is a DESTRUCTIVE action — mandatory confirmation required!
Cancelling an appeal is irreversible. The user forfeits their dispute and the order proceeds to its normal resolution. The agent MUST follow this strict confirmation protocol:
Behavior:
cancel-complaint with the orderNoWarning format (MUST show before executing):
On success:
On failure:
MUST-follow rules:
Trigger:
Behavior:
get-complaint-reasons with orderNoOutput format:
Note: This is a read-only informational query. The skill does NOT support actually submitting a new complaint (that requires the user to use the App).
ALL write operations in Scene 2 MUST follow this protocol:
Trigger:
Behavior:
getReferencePrice to get market reference pricessearch to analyze current market ad distributionOutput format (Reference Price):
Output format (Market Analysis):
Trigger:
Pre-publish preparation workflow:
Step 1 — Get available categories:
Step 2 — Get user's payment methods (for SELL ads, need payId):
Display rule: Only show
tradeMethodName(e.g. "支付宝", "WeChat", "Bank Transfer") to the user.payIdis an internal identifier used only in the API request body — never expose payId values in user-facing output.
Step 3 — Get all system trade methods (for BUY ads, need identifier):
Ad parameter reference:
| Parameter | Required | Description |
|---|---|---|
| classify | Y | Ad category: mass / profession / block / cash (default: mass) |
| tradeType | Y | 0 = BUY, 1 = SELL |
| asset | Y | Crypto: BTC, ETH, USDT, BNB |
| fiatUnit | Y | Fiat: CNY, USD, etc. |
| priceType | Y | 1 = Fixed price, 2 = Floating price |
| price | Conditional | Fixed price value (required if priceType=1) |
| priceFloatingRatio | Conditional | Floating ratio % (required if priceType=2) |
| initAmount | Y | Total crypto quantity |
| maxSingleTransAmount | Y | Max per-order fiat amount |
| minSingleTransAmount | Y | Min per-order fiat amount |
| buyerKycLimit | Y | Require buyer KYC: 0=No, 1=Yes |
| tradeMethods | Y | Payment methods: [{payId, identifier}] |
| payTimeLimit | N | Payment time limit in minutes (default 15) |
| onlineNow | N | Go online immediately (default true) |
| remarks | N | Ad trading terms / conditions (max 1000 chars, no crypto-related words) |
| autoReplyMsg | N | Auto-reply message on order creation (max 1000 chars) |
| buyerRegDaysLimit | N | Min buyer registration days |
| buyerBtcPositionLimit | N | Min buyer BTC holding |
| takerAdditionalKycRequired | N | Require extra verification: 0=No, 1=Yes |
| launchCountry | N | Target countries (default: all regions) |
Confirmation summary format:
Trigger:
Behavior:
POST /sapi/v1/c2c/agent/ads/postOutput format (Success):
Output format (Failure):
Common errors:
Permission denied → User is not a verified merchantFIAT_ASSET_ILLEGAL → BIDR can only pair with IDRTrigger:
Call POST /sapi/v1/c2c/agent/ads/listWithPagination
Output format:
Call POST /sapi/v1/c2c/agent/ads/getDetailByNo
Trigger: "查看详情 {advNo}" / "Show ad detail"
Output format:
Display rule for
remarksandautoReplyMsg: These fields are returned bygetDetailByNo,listWithPagination, andsearch. When present and non-empty, always show them. When null/empty, show "—" or a placeholder like "No terms set". Never omit the section silently — the user should know whether terms exist.
Ad status code mapping:
| Code | Display | Chinese |
|---|---|---|
| 1 | Online | 在线 |
| 2 | Offline | 离线 |
| 4 | Closed | 已关闭 |
Behavior:
POST /sapi/v1/c2c/agent/ads/updateConfirmation format:
Behavior:
POST /sapi/v1/c2c/agent/ads/updateStatusConfirmation format:
Result format:
Trigger:
Behavior: Call GET /sapi/v1/c2c/agent/merchant/getAdDetails?merchantNo={merchantNo}
Output format:
Trigger:
Behavior:
POST /sapi/v1/c2c/agent/digitalCurrency/listPOST /sapi/v1/c2c/agent/fiatCurrency/listBase URL: https://api.binance.com
| Endpoint | Method | Auth | Usage |
|---|---|---|---|
/sapi/v1/c2c/agent/orderMatch/getUserOrderDetail | POST | Yes | Get order detail by order number |
/sapi/v1/c2c/agent/orderMatch/listOrders | POST | Yes | List orders with filters |
/sapi/v1/c2c/agent/orderMatch/listUserOrderHistory | GET | Yes | List order history (paginated) |
/sapi/v1/c2c/agent/complaint/query-complaints | POST | Yes | Query complaint/appeal records |
/sapi/v1/c2c/agent/complaint/submit-evidence | POST | Yes | Submit appeal evidence (write) |
/sapi/v1/c2c/agent/complaint/get-complaint-flows | POST | Yes | Get complaint process timeline |
/sapi/v1/c2c/agent/complaint/cancel-complaint | POST | Yes | Cancel/withdraw appeal (write, irreversible) |
/sapi/v1/c2c/agent/complaint/get-complaint-reasons | POST | Yes | Get available complaint reasons |
/sapi/v1/c2c/agent/file-upload/get-s3-presigned-url | GET | Yes | Get S3 presigned URL for evidence upload |
Base URL: https://api.binance.com
| Endpoint | Method | Auth | Usage |
|---|---|---|---|
/sapi/v1/c2c/agent/ads/getDetailByNo | POST | Yes | Get ad detail by ad number |
/sapi/v1/c2c/agent/ads/listWithPagination | POST | Yes | List user's own ads (paginated) |
/sapi/v1/c2c/agent/ads/search | POST | Yes | Search market ads with filters |
/sapi/v1/c2c/agent/ads/getReferencePrice | POST | Yes | Get reference price for asset/fiat |
/sapi/v1/c2c/agent/ads/getAvailableAdsCategory | GET | Yes | Get publishable ad categories |
/sapi/v1/c2c/agent/ads/getPayMethodByUserId | GET | Yes | Get user's payment methods |
/sapi/v1/c2c/agent/ads/listAllTradeMethods | POST | Yes | List all system trade methods |
/sapi/v1/c2c/agent/ads/post | POST | Yes | Publish a new ad (write) |
/sapi/v1/c2c/agent/ads/update | POST | Yes | Update an existing ad (write) |
/sapi/v1/c2c/agent/ads/updateStatus | POST | Yes | Batch update ad status (write) |
Base URL: https://api.binance.com
| Endpoint | Method | Auth | Usage |
|---|---|---|---|
/sapi/v1/c2c/agent/merchant/getAdDetails | GET | Yes | Get merchant profile + ad listings |
Base URL: https://api.binance.com
| Endpoint | Method | Auth | Usage |
|---|---|---|---|
/sapi/v1/c2c/agent/digitalCurrency/list | POST | Yes | List supported digital currencies |
/sapi/v1/c2c/agent/fiatCurrency/list | POST | Yes | List supported fiat currencies |
Full API reference with request/response schemas: see
references/agent-sapi-api.md
| Error | Cause | User Action |
|---|---|---|
| Permission denied | User is not a verified merchant | Guide to merchant verification page |
| FIAT_ASSET_ILLEGAL | BIDR paired with non-IDR fiat | Use IDR as fiat for BIDR |
| ILLEGAL_PARAMETERS | Missing or invalid fields | Re-check required parameters |
| Ad not found | Invalid advNo | Verify ad number via list |
| Status update partial failure | Some ads can't change status | Check individual error codes in failList |
This skill does NOT (in Phase 3):
For appeal initiation and real-time appeal monitoring, guide users to the official P2P dispute center.**
# Bash equivalent:
SAPI_BASE="https://api.binance.com"
MGS_BASE="https://www.binance.com"
C2C_WEB="https://c2c.binance.com"# ✅ Correct for SAPI: keep insertion order
params = {"page": 1, "rows": 20, "timestamp": 1710460800000}
query_string = urlencode(params) # NO sorting
# ❌ Wrong (standard Binance API only): sorted
query_string = urlencode(sorted(params.items()))GET /bapi/c2c/v1/public/c2c/agent/trade-methods?fiat=CNY
→ [{"identifier":"ALIPAY",...}, {"identifier":"WECHAT",...}, {"identifier":"BANK",...}]GET /bapi/c2c/v1/public/c2c/agent/ad-list?fiat=CNY&asset=USDT&tradeType=BUY&limit=5&tradeMethodIdentifiers=ALIPAY&tradeMethodIdentifiers=WECHATUSDT/CNY (P2P)
- Buy USDT (you buy crypto): ¥7.20
- Sell USDT (you sell crypto): ¥7.18