Binance API / SAPI / C2C
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.

ParameterInTypeRequiredDescription
clientTypeHeaderSTRINGRequiredClient Device Type initiating the request (e.g., WEB, APP, WEB_MOBILE).
pageQueryINT32RequiredPage number to query (starts at 1).
rowsQueryINT32RequiredNumber of message records to query per page (suggested: 20, maximum: 100).
orderNoQuerySTRINGOptionalUnique C2C order number identifier to filter messages for.
idQueryINT64OptionalQuery message ID cursor condition. Returns messages with ID less than the provided value.
chatMessageTypeQuerySTRINGOptionalFilter by message type (e.g., TEXT, IMAGE, SYSTEM).
sortQuerySTRINGOptionalSorting direction: asc or desc.
orderQuerySTRINGOptionalField to order by (e.g., createTime, id).
x-gray-envHeaderSTRINGOptionalEnvironment flag identifier used for internal gray/stage testing.
x-trace-idHeaderSTRINGOptionalCustom client trace ID for request lifecycle tracking and debugging.
x-user-idHeaderSTRINGOptionalTarget 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

FieldTypeDescription
codeSTRINGStandard Binance status code ("000000" indicates success).
data.totalINTTotal count of chat messages available in this thread.
data.pageINTCurrent query page index.
data.rowsINTNumber of records returned per page.
data.dataARRAYArray of chat message record objects.
data.data[].idINT64Unique chat message record identifier.
data.data[].senderUserIdINT64User ID of the message author.
data.data[].chatMessageTypeSTRINGMessage format type (e.g., TEXT, IMAGE, SYSTEM).
data.data[].contentSTRINGRaw text body or uploaded media URL.
data.data[].createTimeLONGTimestamp when the message was sent (in milliseconds).
successBOOLEANIndicates 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