Skip to main content

PickupPointListApi

Requires access to protected customer data for some properties.

This API object is provided to extensions registered for the purchase.checkout.pickup-point-list.render-before or purchase.checkout.pickup-point-list.render-after extension targets.

It extends the StandardApi and provides a isLocationFormVisible boolean to indicate whether the customer location input form is currently rendered and shown to the buyer.

See the StandardApi examples for more information on how to use the API.

Anchor to isLocationFormVisible
isLocationFormVisible
StatefulRemoteSubscribable<boolean>
required

Whether the customer location input form is shown to the buyer.

Was this section helpful?
import {
reactExtension,
useApi,
useSubscription,
Text,
} from '@shopify/ui-extensions-react/checkout';

export default reactExtension(
'purchase.checkout.pickup-point-list.render-before',
() => <Extension />,
);

function Extension() {
const {isLocationFormVisible} =
useApi<'purchase.checkout.pickup-point-list.render-before'>();

const locationFormShown = useSubscription(
isLocationFormVisible,
);

if (locationFormShown) {
return (
<Text>
The customer is being asked to provide
their location.
</Text>
);
} else {
return (
<Text>Pickup points are being shown.</Text>
);
}
}