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

POST /api/v1/p2p/orders/{id}/rate

Rate a completed P2P order. Each participant can submit one rating after the order has been completed. Ratings are used to build trader reputation scores visible on P2P ads.

Authentication

Required. The request must include a valid Bearer token in the Authorization header. Only a participant of the completed order can submit a rating.

Request

ParameterTypeInDescription
idintegerpathThe P2P order ID.
ratingintegerbodyRating value from 1 (worst) to 5 (best).

Example

curl -X POST https://example.com/api/v1/p2p/orders/101/rate \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"rating": 5
}'

Response

200 OK

Returns a success indicator.

{
"success": true
}

Error Responses

StatusCodeDescription
400INVALID_RATINGRating must be an integer between 1 and 5.
400ORDER_NOT_COMPLETEDRatings can only be submitted for completed orders.
400ALREADY_RATEDUser has already rated this order.
401UNAUTHORIZEDMissing or invalid authentication token.
403FORBIDDENUser is not a participant in this order.
404ORDER_NOT_FOUNDThe specified order does not exist.