Create Quick Order
This endpoint enables the user to select particular items, complete the purchase of that item, and then proceed directly to the checkout page to complete the purchase without having to complete any intermediary stages.
Payload
Response
Usage
To perform the action completing the purchase of items and proceeding directly to the checkout, the developer may call the createQuickOrder()
as shown below.
salla.cart.createQuickOrder({
email: "[email protected]",
phone: "056342682",
country_code: "966",
name: "Ali",
product_ids: [22,65,3],
agreement: true,
})
.then((response) => {
/* add your code here */
});
Events
This endpoint may trigger two events, the onQuickOrderSucceeded and onQuickOrderFailed events.
onQuickOrderSucceeded
This event is triggered when the action completing the purchase of items and proceeding directly to the checkout is done without having any errors coming back from the backend.
ssalla.cart.event.onQuickOrderSucceeded((response) => {
console.log(response)
});
onQuickOrderFailed
This event is triggered when the action completing the purchase of items and proceeding directly to the checkout is not completed and an error has occurred.
salla.cart.event.onQuickOrderFailed((errorMessage) => {
console.log(errorMessage)
});