POST /api/v1/p2p/orders/{id}/messages
Send a message in the P2P order chat. Each P2P order has an integrated chat that allows the buyer and seller to communicate during the transaction.
Authentication​
Required. The request must include a valid Bearer token in the Authorization header. Only participants of the order can send messages.
Request​
| Parameter | Type | In | Description |
|---|---|---|---|
id | integer | path | The P2P order ID. |
message | string | body | The message text to send. |
Example​
curl -X POST https://example.com/api/v1/p2p/orders/101/messages \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"message": "Payment sent, please check your account."
}'
Response​
200 OK​
Returns the ID of the created message.
{
"id": 789
}
Error Responses​
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_MESSAGE | Message text is empty or exceeds maximum length. |
| 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. |