Skip to content

queueOrder(action: BasketAction): Promise<void>

The queueOrder method allows to queue an order for processing.

Input parameters

action

action is a mandatory parameter of the BasketAction type that represents the action that we want to perform with a given order.

Returned value

A returned value has a type of Promise<void> as it returns nothing.

Example

In this example we make a basketUpdaterApi call to queue an order for processing. We also retrieve a queue order action with the help of a basketOverallApi

useStorefront(async ({ eventBus, getApi }) => {
    eventBus.on('basket.initialized', async () => {
        const basketOverallApi = await getApi('basketOverallApi');
        const basketUpdaterApi = await getApi('basketUpdaterApi');

        const queueOrderAction = basketOverallApi.getActions().queueOrder;

        basketUpdaterApi.queueOrder(queueOrderAction);
    });
});

Basket Updater API methods reference

Models reference