Shipping
This endpoint is used for the purpose of rating the shipping company responsible for delivering orders. The customer will be able to send a review of that shipping company.
:::tip
The shipping rating endpoint has been implemented in the Rating Web Component, , and It's all setup to save developer's time and effort.
:::
Payload authenticated
Response
Usage
The method shipping
may be called for rating a shipping company responsible for delivering an order as follows.
salla.rating.shipping({
comment: "Fast delivery",
order_id: 587,
rating: 5,
shipping_company_id: 45
})
.then((response) => {
/* add your code here */
});
Events
This endpoint may trigger two events, the onShippingRated and onShippingFailed events.
onShippingRated
This event is triggered when rating a shipping company responsible for delivering an order is done without having any errors coming back from the backend.
salla.event.rating.onShippingRated((response) => {
console.log(response)
});
onShippingFailed
This event is triggered when rating a shipping company responsible for delivering an order is not completed and an error has occurred.
salla.event.rating.onShippingFailed((errorMessage) => {
console.log(errorMessage)
});