BINANCE SAPI · C2C

Retrieve Chat Messages with Pagination API

Query paginated historical chat logs, text conversations, and attached image URLs exchanged between counterparties for a specific peer-to-peer (C2C) order.

ENDPOINT
GET /sapi/v1/c2c/chat/retrieveChatMessagesWithPagination
Authentication USER_DATA / SIGNED
API Group C2C / Chat
Method GET
Response JSON (Paginated)

Overview

This endpoint enables client applications, merchant CRM software, and dispute auditing tools to retrieve chronological message histories for Binance C2C (P2P) orders. It supports query parameters including message type filters (text, image), pagination boundaries (page, rows), cursor-based offset tracking using message ID (id), and sorting options.

Automated customer support consoles and dispute resolution systems query this endpoint to populate historical conversation threads and audit proof-of-payment receipts uploaded during trading.

01

Request Parameters

Parameters accepted in Query String and HTTP Headers.

Parameter In Type Required Description
clientType Header STRING Required Client Device Type initiating the request (e.g., WEB, APP, WEB_MOBILE).
page Query INT32 Required Page number to query (starts at 1).
rows Query INT32 Required Number of message records to query per page (suggested: 20, maximum: 100).
orderNo Query STRING Optional Unique C2C order number identifier to filter messages for.
id Query INT64 Optional Query message ID cursor condition. Returns messages with ID less than the provided value.
chatMessageType Query STRING Optional Filter by message type (e.g., TEXT, IMAGE, SYSTEM).
sort Query STRING Optional Sorting direction: asc or desc.
order Query STRING Optional Field to order by (e.g., createTime, id).
x-gray-env Header STRING Optional Environment flag identifier used for internal gray/stage testing.
x-trace-id Header STRING Optional Custom client trace ID for request lifecycle tracking and debugging.
x-user-id Header STRING Optional Target user identifier for context validation.
i
Cursor vs Page Pagination

For infinite scroll chat interfaces, combining page and rows with the id cursor parameter provides smooth scrolling backwards through earlier messages.

02

Request Example

Example GET request using cURL to retrieve recent chat messages for an order.

cURL BASH
curl -X GET \
'https://api.binance.com/sapi/v1/c2c/chat/retrieveChatMessagesWithPagination?orderNo=202608171234567890&page=1&rows=20&sort=desc' \
-H 'clientType: WEB'
03

Response

Example paginated response returned on successful query execution.

RESPONSE 200 OK
{
    "code": "000000",
    "message": "success",
    "data": {
        "total": 12,
        "page": 1,
        "rows": 20,
        "data": [
            {
                "id": 1059483721,
                "orderNo": "202608171234567890",
                "senderUserId": 123456789,
                "senderNickName": "MerchantAlpha",
                "chatMessageType": "TEXT",
                "content": "Payment sent. Please check your bank account and release.",
                "createTime": 1786953600000,
                "status": 1
            },
            {
                "id": 1059483720,
                "orderNo": "202608171234567890",
                "senderUserId": 123456789,
                "senderNickName": "MerchantAlpha",
                "chatMessageType": "IMAGE",
                "content": "https://binance-c2c.s3.amazonaws.com/chat/2026/08/17/img_receipt.jpg",
                "createTime": 1786953580000,
                "status": 1
            }
        ]
    },
    "success": true
}

Response Fields

Field Type Description
code STRING Standard Binance status code ("000000" indicates success).
data.total INT Total count of chat messages available in this thread.
data.page INT Current query page index.
data.rows INT Number of records returned per page.
data.data ARRAY Array of chat message record objects.
data.data[].id INT64 Unique chat message record identifier.
data.data[].senderUserId INT64 User ID of the message author.
data.data[].chatMessageType STRING Message format type (e.g., TEXT, IMAGE, SYSTEM).
data.data[].content STRING Raw text body or uploaded media URL.
data.data[].createTime LONG Timestamp when the message was sent (in milliseconds).
success BOOLEAN Indicates overall request execution result.
04

How It Works

Workflow for retrieving and displaying chat conversation history.

01 Set Parameters Pass orderNo, page=1, and rows=20 as query parameters.
02 Send GET Request Call /sapi/v1/c2c/chat/retrieveChatMessagesWithPagination.
03 Render Messages Display text dialogue and render image proofs in UI.
04 Paginate / Stream Fetch earlier pages on scroll-up or listen to WSS for new incoming items.

Common Use Cases

Historical Chat Thread Rendering

Load complete message dialogues when an operator or user opens an active or archived C2C trade card.

Trade Dispute Evidence

Extract verified chat transcripts and payment receipt URLs to attach as formal evidence during order mediation.

CRM & Audit Archiving

Automatically archive all buyer-seller correspondence into internal merchant databases for compliance auditing.



💬
Telegram WhatsApp