--- title: Buy online, pick up in-store (BOPIS) slug: nbg84474 canonical_url: https://docs.coveo.com/en/nbg84474/ collection: coveo-for-commerce source_format: adoc --- # Buy online, pick up in-store (BOPIS) "BOPIS" stands for "Buy Online, Pick Up In-Store." It's a commerce strategy that allows customers to place orders for items online and then pick up those items at a physical store location. This approach combines the convenience of online shopping with the immediacy of in-store fulfillment. Using the method of your choice, your site will need to determine which store is the closest to the customer. You must then retrieve the identifier associated with this store that matches the value from your availability identifier field. You can leverage this store identifier, for example `store-123`, in your search interface to filter on products that are only available in this store. Ensure you have properly configured your availability channels when [setting up your catalog configuration](https://docs.coveo.com/en/3139#catalog-configuration). The identifier must match the value set in the **Availability ID** field of the [catalog configuration](https://docs.coveo.com/en/l5if0520/). **Example** When configuring your availabilities in your [catalog configuration](https://docs.coveo.com/en/l5if0520/), you selected the `ec_availability_id` field as the **Availability ID** field, which uniquely identifies each [availability channel](https://docs.coveo.com/en/mc7e9096/) in your index. You then pushed availability items in which the `ec_availability_id` field contains a unique identifier (that is, `store-123`): ```json { "ec_availability_id": "store-123", "lat": 45.4975, "long": -73.5687, "ec_available_items": ["001-red-8_wide","001-red-9_wide","001-red-10_wide","001-red-11_wide", "001-blue-8_wide"], "objecttype": "Availability" } ``` With both your items and catalog configuration using the same `ec_availability_id`, you can add the `@ec_availability_id==store-123` query to filter for all products that are available in this store. ## Availability constraints An availability constraint refers to a specific limitation or condition that influences the availability and accessibility of products within a commerce system. It implies that certain criteria, such as price lists, groups, entitlements, or stores, are set as constraints, and these constraints may determine whether certain products are accessible or visible in specific channels. In a business-to-business (B2B) scenario, availability constraints might be defined by factors like price lists, groups, or entitlements. For instance, certain customers or groups of customers may have access to specific price lists or product groups based on their business relationship with the company. In a business-to-consumer (B2C) scenario, the availability constraint could be a store. This suggests that certain products may only be available for purchase or pickup in specific physical stores, tying into the concept of BOPIS. The following code showcases how to add a filter in the query to only retrieve products that are available in your channel, in the context of the [Coveo Atomic library](https://docs.coveo.com/en/lcdf0264/) search interface. > **Important** > > For this filter to work properly, your search interface must use a [catalog entity](https://docs.coveo.com/en/3139#add-a-catalog-entity) configured with multiple availabilities. ```javascript
``` <1> Import the target [`loadAdvancedSearchQueryActions`](https://docs.coveo.com/en/headless/latest/reference/interfaces/Search.AdvancedSearchQueryActionCreators.html) Headless action loader via the CDN. <2> Create a function that takes as input an engine instance and uses the imported action loader to dispatch an action to update the query expression sent to Coveo. <3> Retrieve an action using the `updateAdvancedSearchQueries` action loader. Utilize the [`aq`](https://docs.coveo.com/en/2830#advanced-query-expression-aq) property to specify a query filter by choosing the unique availability ID of the channel for which you wish to fetch products. <4> Replace `