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​
| Parameter | Type | In | Description |
|---|---|---|---|
id | integer | path | The P2P order ID. |
rating | integer | body | Rating 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​
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_RATING | Rating must be an integer between 1 and 5. |
| 400 | ORDER_NOT_COMPLETED | Ratings can only be submitted for completed orders. |
| 400 | ALREADY_RATED | User has already rated this order. |
| 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. |