---
title: "AI shopping agents and custom storefronts"
description: "AI shopping agents and Shop app links can't choose a delivery date yet, but your date rules still apply at checkout. Tell agents a date is needed, and let Hydrogen or headless storefronts write the date so checkout accepts it."
contentType: "docs"
locale: "en"
localized: true
source: "https://orderrules.com/docs/delivery/ai-shopping-agents-and-headless"
slug: "delivery/ai-shopping-agents-and-headless"
---
## AI shopping agents (ChatGPT, Gemini, Copilot) and Shop app links

**These can't choose a delivery date yet. Shopify gives apps no way to ask an agent for one.** Your date rules still apply to their orders at checkout:

- With **Block**, checkout asks the customer to finish on your store and pick the date.
- With **Accept**, the order goes through and the customer picks the date on the order confirmation (thank-you) page, or later on the order status page once signed in to their account.

See [Orders without a delivery date](/docs/delivery/orders-without-a-delivery-date).

### Tell agents a date is needed

OrderRules → **Delivery Dates** → **Orders & fulfillment** → **Tell AI agents a date is needed**. Copy the ready-made FAQ and add it to Shopify's free **Knowledge Base** app, which AI agents read when shoppers ask about your store. Adding the same sentence to your shipping policy helps too.

![The Tell AI agents a date is needed box in OrderRules, with a ready-made FAQ to copy into Shopify's Knowledge Base app](/images/docs/delivery-ai-agents-faq.png)

## Custom storefronts (Hydrogen, headless, custom agents)

OrderRules' delivery date picker is a theme app block, so it only appears on Online Store themes. A storefront built on the Storefront API skips it, whether that's Hydrogen or a custom React or Next.js app. **Checkout still enforces your rules.**

To let buyers pick the date in your own storefront, write it to the cart with the same fields the picker uses. The queries below are for Storefront API 2026-10.

### 1. Read the open dates

```graphql
query OrderRulesDelivery {
  shop {
    metafield(namespace: "order_rules", key: "delivery") { value }
  }
}
```

`value` is JSON. The parts you need:

| Field | Meaning |
|---|---|
| `rules[]` | Delivery rules: `id`, `scope` (`storewide` / `product` / `collection` / `tag`), `requireDate`, `requireSlot`, `slotTemplateId`, `allowedDates` (YYYY-MM-DD, already past cutoff and lead time) |
| `defaultRuleId` | The storewide rule, if any |
| `productRuleMap` | Numeric product id → rule id |
| `collectionProductIds` / `tagProductIds` | Which products a collection or tag rule covers |
| `blackouts` | Closed dates (YYYY-MM-DD) |
| `slotTemplates[id].windows[]` | Time slots: `id`, `label`, `start`, `end` |
| `capacity[date][slotId or "_all"]` | Remaining bookings; `0` means full |

Show a date only when all of these hold:

- it's in the rule's `allowedDates`;
- it isn't in `blackouts`;
- `capacity[date]._all` isn't `0`.

When `requireDate` is true, a date is mandatory. The metafield is refreshed whenever you change your delivery settings and after orders come in. Treat it as read-only: the format is internal and may change.

### 2. Write the chosen date

**One date for the whole order.** Cart attributes:

```graphql
mutation SetDeliveryDate($cartId: ID!) {
  cartAttributesUpdate(cartId: $cartId, attributes: [
    { key: "_os_dp", value: "d|2026-11-04|am" }
    { key: "delivery_date", value: "2026-11-04" }
    { key: "delivery_slot", value: "am" }
  ]) {
    cart { id }
    userErrors { field message }
  }
}
```

- `_os_dp` is what the checkout check reads. Its format is `d|YYYY-MM-DD|slotId`; leave the slot empty when there are no time slots, for example `d|2026-11-04|`.
- `delivery_date` and `delivery_slot` are what your order list, tags, CSV export and capacity counts read.

**Or a date per product.** A line attribute:

```graphql
mutation AddDatedLine($cartId: ID!) {
  cartLinesAdd(cartId: $cartId, lines: [{
    merchandiseId: "gid://shopify/ProductVariant/123"
    quantity: 1
    attributes: [{ key: "_os_dpl", value: "d|2026-11-04|am" }]
  }]) {
    cart { id }
    userErrors { field message }
  }
}
```

A line's own `_os_dpl` wins over the order-level `_os_dp`. Lines without one use the order-level date.

### 3. Check it

Go to checkout with a date-required product.

- **Without a date:** checkout shows "Please choose a delivery date…".
- **With a valid date:** checkout continues, and the order shows the date under its additional details.

## Links instead of a storefront

For chat, email or social sales, use [Checkout link with a delivery date](/docs/delivery/checkout-links-with-delivery-date). It creates a cart link with the date already set.

## Related

- [Orders without a delivery date](/docs/delivery/orders-without-a-delivery-date) · [Checkout protection](/docs/delivery/checkout-protection) · [Delivery date after the order](/docs/delivery/delivery-date-after-order)
