GET /api/v1/p2p/orders/{id}/messages
Retrieve all chat messages for a P2P order. Returns the full message history between buyer and seller in chronological order.
Authentication​
Required. The request must include a valid Bearer token in the Authorization header. Only participants of the order can view messages.
Request​
| Parameter | Type | In | Description |
|---|---|---|---|
id | integer | path | The P2P order ID. |
limit | integer | query | Maximum number of messages to return (default: 50) |
offset | integer | query | Number of messages to skip (default: 0) |
Example​
curl "https://example.com/api/v1/p2p/orders/101/messages?limit=50&offset=0" \
-H "Authorization: Bearer <token>"
Response​
200 OK​
Returns an object with messages array and the current order status.
{
"messages": [
{
"id": 1,
"order_id": 101,
"user_id": 15,
"sender_type": "user",
"message": "Hi, I will send payment now.",
"created_at": "2026-04-04T12:08:00Z",
"user": {
"id": 15,
"name": "Ivan"
}
},
{
"id": 2,
"order_id": 101,
"user_id": 7,
"sender_type": "user",
"message": "OK, I am waiting.",
"created_at": "2026-04-04T12:09:00Z",
"user": {
"id": 7,
"name": "Petr"
}
}
],
"status": "pending"
}
Error Responses​
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid authentication token. |
| 403 | FORBIDDEN | User is not a participant in this order. |
| 404 | ORDER_NOT_FOUND | The specified order does not exist. |