Skip to content

remove(): Promise<void>

The remove method allows to remove a coupon code from the basket.

Returned value

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

Example

In this example we make a basketPromotionsApi call to remove a coupon code from the basket.

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

        basketPromotionsApi.remove();
    });
});

Basket Promotions API methods reference