What your assistant can do

Last updated ยท Page 3 of 6

The server exposes these shopping tools. Their arguments and answers use camelCase names, the same as the public reads.

ToolWhat it is for
search_offersFind offers by words
get_offerRead one offer in full
hold_slotHold the slot and tickets of a timed ticket the person chose, for 15 minutes, so they only pay
get_journeySee what LivingSocial knows about the current shopping session, its cart included
get_cartRead current items, quantities, total and the private cart link
update_cartSet the final quantity of a line returned by the cart
remove_from_cartRemove a line returned by the cart
add_to_cartPut an option in the person's cart, the one they open on LivingSocial
prepare_checkoutPrepare a purchase the person pays for on Groupon
get_purchase_statusRead how each prepared purchase stands
cancel_purchaseCancel a paid purchase by Groupon's rules, on the person's yes
link_accountOptionally link the person's LivingSocial account: they sign in on LivingSocial's own page (OAuth), never in the conversation
  • search_offers finds offers by words, in the markets LivingSocial sells (the United States and Canada). It takes query (1 to 200 characters; offers come in the order Groupon's search ranks them for the words, around the place they name, as in "massage in Chicago", and quotes, or and a leading minus are ordinary words) and can narrow by city (the whole city name, optionally with its state, as in "Portland, OR"), category (a category by its slug or its name, as GET /ls_agent_api/categories lists them: "things-to-do" and "Things to Do" are one; any other value is refused, and the refusal lists them), minPriceMinor and maxPriceMinor with currency, near (a point with a radiusKm of up to 200, or a radiusMiles of up to 124), or dateFrom and dateTo (the days the person wants to go, below). Words that name a category, as in "things to do in Chicago", "food and drink" or "beauty and spas", are read as that category and never matched against merchants' names. limit is 1 to 20, and 10 when left out. A search that names no place, in the words, with near or with city, is ranked around Chicago, the place groupon.com ranks such a search around, and every answer carries scope, what was searched: kind (words, near, city, default when no place was named, national, or outside_market), the place, the country and a note to tell the person (it also says when words were read as a category). When it is default and the person has a place in mind, ask for it. A US state in the words, as in "beach resort Florida", is searched around the state. A place outside the markets LivingSocial sells, as in "spa in London", is searched nowhere: no offers, kind outside_market with the place and its country; tell the person where LivingSocial sells and ask for a place there. A US town of the same name is searched with its state, as in "London, KY". Each offer is a short card, enough to pick one: its id and permalink, title, category, city, the price it starts at, the merchant's rating as groupon.com shows it and how many ratings it has (merchantRating), whether it can be bought now (buyable) and whether it is booked by day and time (bookable), how the person gets a time with it (bookingKind, below), when it stops being sold (endsAt), one line of what limits it (restrictions: the fine print's first restriction and how many options it has), its first picture, whether it is on sale (status), the links for the person (its page, offerUrl; the buy link of its cheapest option, buyUrl, null when it cannot be bought now; for a ticket booked on groupon.com, Groupon's booking page, bookingUrl), and its distance in kilometres and in miles when the search named a point. Read an offer with get_offer before you describe it or the person decides: only the full offer carries the options with their own prices and buy links, the places, the fine print and the free times. It changes nothing for the person.
  • The days the person wants to go: send dateFrom (and dateTo, at most six days later) to search_offers when the person says when ("this weekend" is Saturday and Sunday). A purchase that is not a timed ticket is not tied to a day: it can be used on those days as long as it has not expired by then, so an offer that stops being sold before dateFrom, or that must be used before it whichever option the person picks, is left out, and an offer with no end stays. A ticket booked by day and time (Edge, Go City, Big Bus Tours) is listed only when it has a free time on one of those days; get_offer with the same days lists its free times.
  • How the person gets a time: every offer and search result carries bookingKind, one word to read before you promise a day or a time. bookable_with_live_times: its free times are read live, one can be held with hold_slot, and the person pays for exactly that time on Groupon's page. no_time_held: buying it holds no time; the person buys it, then books the time with the merchant afterwards, as the fine print says, so never promise them a day or a time. stay: a hotel stay, its dates chosen when it is booked. shipped: a product shipped to the person, bought with its delivery at its bookingUrl on groupon.com, never in the cart. Never read a time into bookable alone.
  • A search that names a time, with dateFrom or in its words ("Saturday afternoon", "tonight", "at 3pm"), answers rankedBy: "time_requested": the offers with live free times on those days come first, then timed offers and stays whose times could not be confirmed, then offers that hold no time, then timed offers with nothing free on those days, each group in Groupon's ranking order. No offer is left out. When the person wants a particular time, recommend an offer with a free time then, and say plainly when one holds no time.
  • get_offer reads one offer in full, by its id, its permalink or its groupon.com slug, the last part of its address on groupon.com (offer; the answer's permalink is LivingSocial's own, so keep that one): every option with its price, the places, the categories, the fine print where LivingSocial has it, and when LivingSocial last read the offer from Groupon (observedAt). Give it the city or the point (near) the person is looking at and the places there come first. Beside Groupon's title, often a discount headline, experienceTitle says what the offer is, and fees quotes what the fine print says about fees, taxes and tips. An expired or sold-out offer still answers, says so, and is marked as not purchasable. Its reviews carry what customers wrote: the 5 newest reviews as their shoppers wrote them (latest: stars, text, the day written, the reviewer's name as Groupon shows it, whether the purchase is verified, and the site it was written on), how many reviews give each star (byStar), and a short summary a model wrote from the newest 50 reviews (summary, with what it read and which model wrote it), each with its source and when it was read or written. The assistant quotes reviews as customers' words and the summary as a generated summary. A block is null when nothing stands behind it: no reviews, or fewer than 5 for a summary. The REST read of one offer takes latestReviews (up to 20) for more of the newest.
  • hold_slot holds the slot of a timed ticket the person chose, for an option get_offer marks holdable (Edge, Go City, Big Bus Tours). It takes offerId and optionId, the slot's date and time as availability lists them (time is null for a day ticket), the tickets (each ticket type of the option once, with how many, at most 20 tickets in all) and an operationKey, as prepare_checkout does: the same key with the same slot and tickets answers the same hold, never a second one. Call it only after the person chose the slot and the tickets and agreed to the price, and hold one slot at a time: Groupon keeps the tickets for 15 minutes (expiresAt), nothing releases a hold earlier, and one session holds at most 5 at once. The answer's bookingUrl is Groupon's page where the person only pays for exactly that slot: hand it to them unchanged. The prices are before Groupon's taxes and fees, which that page adds. validateOnly: true checks the slot and prices the tickets without holding anything. A refusal the person can book around (details.holdError HOLDS_NOT_AVAILABLE, SLOT_NOT_AVAILABLE or HOLD_REFUSED) carries details.bookingUrl, Groupon's booking page for the option, where they pick the day and time and pay; the others (rate_limited, checkout_in_progress, upstream_unavailable) say how long to wait before calling again with the same key. It is the hold the agent API's Hold a slot takes (agent API documentation). Nothing is paid; once the person paid for the slot, get_purchase_status lists it under bookings, with its bookingId (the hold's holdId).
  • get_journey tells the assistant what LivingSocial knows about the current shopping session: its id, whether the person's identity is anonymous or confirmed, the cart as it stands (its lines and total), cartUrl (the cart page on LivingSocial; its link carries its own key, which opens only the cart and its checkout), how many checkouts are still open, and a note on what the record can and cannot show. It never starts a session.
  • add_to_cart puts one option of one offer in the person's cart after checking it is still sellable at the price shown. The cart is the person's own: the same cart they see when they open cartUrl on LivingSocial. The quantity is set, so a repeat changes nothing. Nothing is paid.
  • get_cart reads the current cart. Use it to answer "what is in my cart?" and before editing. An empty new session is not proof that the person's separate browser or account cart is empty.
  • update_cart takes a lineId from the cart and the desired final quantity (1 to 100, or fewer where the option's own limit is lower). Repeating a set does not add units. remove_from_cart takes the same lineId and removes it. Both return the full remaining cart and cartUrl; never use an offer or option id as a line id.
  • prepare_checkout prepares the purchase the person chose. It sets the chosen option in the cart and starts a checkout with Groupon for the cart, and it answers a private link (handoffUrl) for the person to open. It never charges anyone and never pays.
  • get_purchase_status reads how each of the session's checkouts stands, whether the status is final, and what the person should do next, and the times the person booked and paid for on groupon.com (bookings). It can be limited to one checkout with checkoutId. A paid checkout carries grouponOrderReference, Groupon's order number (1000-...), the one in Groupon's mail and the person's My Groupon: give it to the person when they contact Groupon's customer support. It is null until LivingSocial knows Groupon's order. Each checkout also carries policyAtPurchase: the offer's refund, cancellation and change rules exactly as they were served when the checkout was prepared, with the offer's id and asOf; it is the policy the person bought under, whatever the offer says today, and null for a checkout prepared before 15 November 2026.
  • cancel_purchase cancels a paid purchase, a checkout's checkoutId or a booking's bookingId, by Groupon's own rules. Called without confirmed it changes nothing and answers whether Groupon would cancel it now and for how much (amount), or why not (each unit's reason: Groupon's refund period after buying passed, the code was viewed, the time is past the booking partner's cancellation cutoff, or it was used). Only after the person says yes does the assistant call it again with confirmed: true and the same amountMinor and currency; Groupon then cancels it and refunds the original payment method. The answer names the order by grouponOrderReference, Groupon's order number. Groupon never moves a booked time to another day or time: a new time is a cancel, where Groupon allows it, and a new hold_slot.
  • link_account is optional. Searching and buying never need it, and the person needs no LivingSocial account beforehand. Without a linked account it answers the account_link_required refusal, which makes a client that supports OAuth (ChatGPT does) open LivingSocial's sign-in; with one it answers account.linked: true and identity.bound: true.