Rate A Supplier
Rate a supplier after complete an order
- cURL
- JavaScript
curl --location --request PUT 'https://partner-apistg.ahamove.com/v3/orders/<order_id>/rate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>'
--data '{
"rated_by":"receiver",
"rating": 4,
"comment": "good"
}'
const myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
myHeaders.append('Authorization', 'Bearer <token>');
const raw = JSON.stringify({
rated_by: 'receiver',
rating: 4,
comment: 'good',
});
const requestOptions = {
method: 'PUT',
headers: myHeaders,
body: raw,
redirect: 'follow',
};
fetch(
'https://partner-apistg.ahamove.com/v3/orders/<order_id>/rate',
requestOptions
)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
HTTP Request
PUT https://partner-apistg.ahamove.com/v3/orders/<order_id>/rate
Headers
Parameter | Value | Required | Description |
---|---|---|---|
Authorization | Bearer <token> | Yes | Token of the order creator |
Body
{
"rated_by": "receiver",
"rating": 4,
"comment": "good"
}
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | String | Yes | User's token |
order_id | String | Yes | Order ID |
rated_by | String | Yes | Rated by sender (user ) or recipient (receiver ) |
rating | Int | Yes | Rating level, from 1-5 |
comment | String | No | Feedback from sender or recipient |
Response
JSON response example:
{}
Status-Code: 200 OK
Errors
Code | Text | Description |
---|---|---|
400 | MISSING_REQUIRED_INFO | Missing required fields |
400 | INVALID_PARAM | Invalid information |
401 | NOT_AUTHORIZED | Invalid token |
404 | SUPPLIER_NOT_FOUND | Driver information not found |
409 | ORDER_HAS_BEEN_RATED_BY_USER | Order has already been rated by the sender |
409 | ORDER_HAS_BEEN_RATED_BY_RECEIVER | Order has already been rated by the recipient |
500 | INTERNAL_SERVER_ERROR | We had a problem with our server. Try again later |
503 | SERVICE_UNAVAILABLE | We're temporarily offline for maintenance. Please try again later |