Store & Delivery Picker

Build a multi-store picker with delivery schedule and time-slot selection.

What you'll build

A store-selection flow for multi-location storefronts: list all stores in a group, let the user pick one, load its details, then display delivery schedules and available time slots.

Prerequisites

  • A Group UUID for a multi-store group
  • A Store UUID (obtained dynamically or known ahead of time)
  • cURL or any HTTP client

All examples use the staging server. No authentication is required for these endpoints.


Step 1: List Group Stores

Fetch every store belonging to the group. Use the X-Group header instead of X-Store.

cURL

curl -X GET https://ecom-api.staging.blaze.me/api/v1/groups/stores \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Group: YOUR_GROUP_UUID"

JavaScript (fetch)

const GROUP_UUID = "YOUR_GROUP_UUID";
const BASE_URL = "https://ecom-api.staging.blaze.me";

const response = await fetch(`${BASE_URL}/api/v1/groups/stores`, {
  headers: {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "X-Group": GROUP_UUID,
  },
});

const { data: stores } = await response.json();

stores.forEach((store) => {
  console.log(`${store.attributes.name}${store.attributes.city}, ${store.attributes.state}`);
});

Response

{
  "data": [
    {
      "id": "e87437f2-3e35-4738-af5e-6307e368255c",
      "type": "stores",
      "attributes": {
        "name": "Blaze Dispensary - Downtown",
        "slug": "blaze-downtown",
        "city": "Los Angeles",
        "state": "CA",
        "is_active": true,
        "delivery_enabled": true,
        "pickup_enabled": true
      }
    },
    {
      "id": "f98765ab-cdef-4321-abcd-9876543210fe",
      "type": "stores",
      "attributes": {
        "name": "Blaze Dispensary - Venice",
        "slug": "blaze-venice",
        "city": "Venice",
        "state": "CA",
        "is_active": true,
        "delivery_enabled": true,
        "pickup_enabled": true
      }
    }
  ]
}

Key header: X-Group scopes the request to the group. From this point forward every other call uses X-Store with the store the user selected.


Step 2: Fetch Store Details

Once the user picks a store, load its full details. Switch to X-Store for all subsequent calls.

cURL

STORE_UUID="e87437f2-3e35-4738-af5e-6307e368255c"

curl -X GET https://ecom-api.staging.blaze.me/api/v1/store \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: $STORE_UUID"

JavaScript (fetch)

const STORE_UUID = "e87437f2-3e35-4738-af5e-6307e368255c";

const storeResponse = await fetch(`${BASE_URL}/api/v1/store`, {
  headers: {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "X-Store": STORE_UUID,
  },
});

const { data: store } = await storeResponse.json();

console.log(store.attributes.name);            // "Blaze Dispensary - Downtown"
console.log(store.attributes.delivery_enabled); // true
console.log(store.attributes.pickup_enabled);   // true
console.log(store.attributes.timezone);         // "America/Los_Angeles"

Response

{
  "data": {
    "id": "e87437f2-3e35-4738-af5e-6307e368255c",
    "type": "stores",
    "attributes": {
      "name": "Blaze Dispensary - Downtown",
      "slug": "blaze-downtown",
      "address": "1234 Cannabis Ave",
      "city": "Los Angeles",
      "state": "CA",
      "zip_code": "90001",
      "country": "US",
      "latitude": 34.0522,
      "longitude": -118.2437,
      "phone": "+13105551234",
      "email": "info@blazedispensary.com",
      "is_active": true,
      "point_of_sales": "blaze",
      "delivery_enabled": true,
      "pickup_enabled": true,
      "timezone": "America/Los_Angeles"
    }
  }
}

Tip: Check delivery_enabled and pickup_enabled to decide which schedule types to fetch next.


Step 3: Check Delivery Schedules

Retrieve the weekly schedule so the user knows which days and hours delivery operates.

cURL

curl -X GET https://ecom-api.staging.blaze.me/api/v1/store/schedules/delivery \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c"

JavaScript (fetch)

const scheduleResponse = await fetch(
  `${BASE_URL}/api/v1/store/schedules/delivery`,
  {
    headers: {
      "Content-Type": "application/vnd.api+json",
      "Accept": "application/vnd.api+json",
      "X-Store": STORE_UUID,
    },
  }
);

const { data: schedule } = await scheduleResponse.json();

schedule.forEach((day) => {
  const { weekday, is_closed, intervals } = day.attributes;
  if (is_closed) {
    console.log(`${weekday}: Closed`);
  } else {
    const hours = intervals.map((i) => `${i.start}${i.end}`).join(", ");
    console.log(`${weekday}: ${hours}`);
  }
});

Response

{
  "data": [
    {
      "id": "sched-mon",
      "type": "schedules",
      "attributes": {
        "weekday": "monday",
        "is_closed": false,
        "intervals": [
          { "start": "09:00", "end": "21:00" }
        ]
      }
    },
    {
      "id": "sched-tue",
      "type": "schedules",
      "attributes": {
        "weekday": "tuesday",
        "is_closed": false,
        "intervals": [
          { "start": "09:00", "end": "21:00" }
        ]
      }
    },
    {
      "id": "sched-sun",
      "type": "schedules",
      "attributes": {
        "weekday": "sunday",
        "is_closed": true,
        "intervals": []
      }
    }
  ]
}

Schedule types: Replace delivery in the path with pickup or operating to get other schedule types.


Step 4: Check Available Time Slots

After confirming the store delivers on the desired day, fetch the actual bookable time slots.

cURL

curl -X GET https://ecom-api.staging.blaze.me/api/v1/store/availabilities/delivery \
  -H "Content-Type: application/vnd.api+json" \
  -H "Accept: application/vnd.api+json" \
  -H "X-Store: e87437f2-3e35-4738-af5e-6307e368255c"

JavaScript (fetch)

const availResponse = await fetch(
  `${BASE_URL}/api/v1/store/availabilities/delivery`,
  {
    headers: {
      "Content-Type": "application/vnd.api+json",
      "Accept": "application/vnd.api+json",
      "X-Store": STORE_UUID,
    },
  }
);

const { data: days } = await availResponse.json();

days.forEach((day) => {
  const { date, slots } = day.attributes;
  const openSlots = slots.filter((s) => s.available);
  console.log(`${date}: ${openSlots.length} slots available`);
  openSlots.forEach((s) => console.log(`  ${s.start}${s.end}`));
});

Response

{
  "data": [
    {
      "id": "avail-2026-05-31",
      "type": "availabilities",
      "attributes": {
        "date": "2026-05-31",
        "slots": [
          { "start": "09:00", "end": "10:00", "available": true },
          { "start": "10:00", "end": "11:00", "available": true },
          { "start": "11:00", "end": "12:00", "available": false },
          { "start": "12:00", "end": "13:00", "available": true }
        ]
      }
    },
    {
      "id": "avail-2026-06-01",
      "type": "availabilities",
      "attributes": {
        "date": "2026-06-01",
        "slots": [
          { "start": "09:00", "end": "10:00", "available": true }
        ]
      }
    }
  ]
}

Tip: Slots with "available": false are fully booked — grey them out in the UI.


Putting It All Together

const GROUP_UUID = "YOUR_GROUP_UUID";
const BASE_URL = "https://ecom-api.staging.blaze.me";

const headers = {
  "Content-Type": "application/vnd.api+json",
  "Accept": "application/vnd.api+json",
};

// 1. List group stores
const storesRes = await fetch(`${BASE_URL}/api/v1/groups/stores`, {
  headers: { ...headers, "X-Group": GROUP_UUID },
});
const { data: stores } = await storesRes.json();
console.log(`Found ${stores.length} stores in the group`);

// 2. User selects the first store
const selectedStoreId = stores[0].id;
const storeHeaders = { ...headers, "X-Store": selectedStoreId };

// 3. Fetch full store details
const storeRes = await fetch(`${BASE_URL}/api/v1/store`, {
  headers: storeHeaders,
});
const { data: store } = await storeRes.json();
console.log(`Selected: ${store.attributes.name}`);

// 4. Get delivery schedule
const schedRes = await fetch(`${BASE_URL}/api/v1/store/schedules/delivery`, {
  headers: storeHeaders,
});
const { data: schedule } = await schedRes.json();
const openDays = schedule.filter((d) => !d.attributes.is_closed);
console.log(`Delivers on ${openDays.length} days per week`);

// 5. Get available time slots
const availRes = await fetch(`${BASE_URL}/api/v1/store/availabilities/delivery`, {
  headers: storeHeaders,
});
const { data: availabilities } = await availRes.json();
availabilities.forEach((day) => {
  const open = day.attributes.slots.filter((s) => s.available);
  console.log(`${day.attributes.date}: ${open.length} open slots`);
});

What's Next?