Skip to content

getSectionValidation(): TSectionValidation

The getSectionValidation method allows to validate a section containing addresses and check for potential errors.

Returned value

A returned value has a type of TSectionValidation representing an object that tells whether a section was successfully validated or not.

Example

In this example we make a basketAddressesApi call to validate the basket section with addresses.

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

        const validation = basketAddressesApi.getSectionValidation();
    });
});

Basket Address API methods reference

Objects reference