Split one shopping list across two or three shops
split_orderAnswer 'can I save by ordering from more than one shop?' for a whole list. Returns which items to buy where, each leg's own subtotal, delivery fee and service fee, the combined delivered total, and what it saves against buying everything in one order. Every fee is a published one: a leg whose delivery fee we could not verify is never put in a split, because a split is a recommendation to pay a SECOND fee and it may not rest on a number we would refuse to quote for one order. reason='cheaper' means one order could buy this list and two buy it for materially less. reason='more_of_the_list' means no single storefront stocks everything, so the second order fills the gap: it costs MORE, saving is negative, and that is the honest answer rather than a hidden one. Say which of the two it is. Each leg carries its own handoffUrl, one page per order. Give the shopper both. Every leg meets its own storefront's minimum order, so both legs are placeable as they stand. Returns splitOrder: null when one order is the right answer, which is the usual case — report that plainly and point at the single-order recommendation instead of retrying. optimize_delivery already returns the same splitOrder field, so call this one only when the shopper asks about splitting specifically, or to raise max_stores to 3.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| city | No | City name in Hebrew or English. Enough for chains that publish a settlement list, not enough for a storefront whose area is a polygon or a depot radius. | |
| near | No | 'lat,lng' string, e.g. '32.078,34.774'. Do not combine with address. | |
| items | Yes | The shopping list, same shape as optimize_delivery. | |
| intent | No | The shopper's own framing of this shop, in their own words, e.g. 'ברביקיו ל-12 אנשים'. Not a summary of the item list. Shown on each leg's handoff page next to what was priced. Optional; omit rather than inventing one. | |
| address | No | Delivery address in Israel, free text, e.g. 'מנדלסון 1, תל אביב'. Preferred: some storefronts publish a service area that only a street address can be tested against. | |
| slot_type | No | standard (default) or pickup. | |
| max_stores | No | How many storefronts to spread the list over. Default 2. A third adds a third delivery fee, so it only wins when it reaches items the other two do not stock. | |
| memberships | No | Memberships the shopper holds, e.g. ['credit_card', 'wolt_plus']. |