Перейти к основному содержимому

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

ParameterTypeInDescription
idintegerpathThe P2P order ID.
messagestringbodyThe 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

StatusCodeDescription
400INVALID_MESSAGEMessage text is empty or exceeds maximum length.
401UNAUTHORIZEDMissing or invalid authentication token.
403FORBIDDENUser is not a participant in this order.
404ORDER_NOT_FOUNDThe specified order does not exist.