Skip to content

getPaymentCostForActiveShippingByPaymentId(): FullPrice | undefined

The getPaymentCostForActiveShippingByPaymentId method allows to get the payment cost for an active shipping method by payment id.

Returned value

A returned value has a type of FullPrice | undefined where FullPrice represents the FullPrice model.

Example

In this example we make a basketShippingsApi call to get the payment cost for an active shipping method by payment id.

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

        const paymentCostForActiveShipping = basketShippingsApi.getPaymentCostForActiveShippingByPaymentId();
    });
});

Basket Address API methods reference

Models reference