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.
| Tool | What it is for |
|---|---|
search_offers | Find offers by words |
get_offer | Read one offer in full |
hold_slot | Hold the slot and tickets of a timed ticket the person chose, for 15 minutes, so they only pay |
get_journey | See what LivingSocial knows about the current shopping session, its cart included |
get_cart | Read current items, quantities, total and the private cart link |
update_cart | Set the final quantity of a line returned by the cart |
remove_from_cart | Remove a line returned by the cart |
add_to_cart | Put an option in the person's cart, the one they open on LivingSocial |
prepare_checkout | Prepare a purchase the person pays for on Groupon |
get_purchase_status | Read how each prepared purchase stands |
cancel_purchase | Cancel a paid purchase by Groupon's rules, on the person's yes |
link_account | Optionally link the person's LivingSocial account: they sign in on LivingSocial's own page (OAuth), never in the conversation |
search_offersfinds offers by words, in the markets LivingSocial sells (the United States and Canada). It takesquery(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,orand a leading minus are ordinary words) and can narrow bycity(the whole city name, optionally with its state, as in "Portland, OR"),category(a category by its slug or its name, asGET /ls_agent_api/categorieslists them: "things-to-do" and "Things to Do" are one; any other value is refused, and the refusal lists them),minPriceMinorandmaxPriceMinorwithcurrency,near(a point with aradiusKmof up to 200, or aradiusMilesof up to 124), ordateFromanddateTo(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.limitis 1 to 20, and 10 when left out. A search that names no place, in the words, withnearor withcity, is ranked around Chicago, the place groupon.com ranks such a search around, and every answer carriesscope, what was searched:kind(words,near,city,defaultwhen no place was named,national, oroutside_market), theplace, thecountryand anoteto tell the person (it also says when words were read as a category). When it isdefaultand 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,kindoutside_marketwith the place and itscountry; 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 withget_offerbefore 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(anddateTo, at most six days later) tosearch_offerswhen 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 beforedateFrom, 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_offerwith 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 withhold_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 itsbookingUrlon groupon.com, never in the cart. Never read a time intobookablealone. - A search that names a time, with
dateFromor in its words ("Saturday afternoon", "tonight", "at 3pm"), answersrankedBy: "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_offerreads 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'spermalinkis 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 thecityor the point (near) the person is looking at and the places there come first. Beside Groupon's title, often a discount headline,experienceTitlesays what the offer is, andfeesquotes 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. Itsreviewscarry 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 takeslatestReviews(up to 20) for more of the newest.hold_slotholds the slot of a timed ticket the person chose, for an optionget_offermarksholdable(Edge, Go City, Big Bus Tours). It takesofferIdandoptionId, the slot'sdateandtimeasavailabilitylists them (timeis null for a day ticket), thetickets(each ticket type of the option once, with how many, at most 20 tickets in all) and anoperationKey, asprepare_checkoutdoes: 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'sbookingUrlis 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: truechecks the slot and prices the tickets without holding anything. A refusal the person can book around (details.holdErrorHOLDS_NOT_AVAILABLE,SLOT_NOT_AVAILABLEorHOLD_REFUSED) carriesdetails.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. Some suppliers ask booking questions, such as the language of a tour: a hold without the answers isinvalid_inputwithdetails.reasonbooking_requirement_not_metanddetails.missingAnswers, the questions' keys comma-separated (tourLanguage); the assistant asks the person and callshold_slotagain with the same key andanswers, an object of those keys to the person's answers ({"tourLanguage": "English"}). 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_statuslists it underbookings, with itsbookingId(the hold'sholdId).get_journeytells 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_cartputs 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 opencartUrlon LivingSocial. The quantity is set, so a repeat changes nothing. Nothing is paid.get_cartreads 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_carttakes alineIdfrom the cart and the desired finalquantity(1 to 100, or fewer where the option's own limit is lower). Repeating a set does not add units.remove_from_carttakes the samelineIdand removes it. Both return the full remaining cart andcartUrl; never use an offer or option id as a line id.prepare_checkoutprepares 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_statusreads 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 withcheckoutId. A paid checkout carriesgrouponOrderReference, 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 isnulluntil LivingSocial knows Groupon's order. Each checkout also carriespolicyAtPurchase: the offer's refund, cancellation and change rules exactly as they were served when the checkout was prepared, with the offer's id andasOf; it is the policy the person bought under, whatever the offer says today, andnullfor a checkout prepared before 15 November 2026.cancel_purchasecancels a paid purchase, a checkout'scheckoutIdor a booking'sbookingId, by Groupon's own rules. Called withoutconfirmedit changes nothing and answers whether Groupon would cancel it now and for how much (amount), or why not (each unit'sreason: 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 withconfirmed: trueand the sameamountMinorandcurrency; Groupon then cancels it and refunds the original payment method. The answer names the order bygrouponOrderReference, 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 newhold_slot.link_accountis optional. Searching and buying never need it, and the person needs no LivingSocial account beforehand. Without a linked account it answers theaccount_link_requiredrefusal, which makes a client that supports OAuth (ChatGPT does) open LivingSocial's sign-in; with one it answersaccount.linked: trueandidentity.bound: true.