Public previewSee what changed →
All guides

Buying through your assistant

Page 6 of 9

  1. The assistant searches and reads offers with search_offers and get_offer.
  2. The person picks an option and a quantity and agrees to the price get_offer showed.
  3. The assistant calls prepare_checkout with offerId and optionId (both ids come from get_offer), quantity (1 to 50), an operationKey and confirmSelection: true. It sets confirmSelection to true only after the person has confirmed the choice. Anything else is refused.
    • operationKey is 8 to 128 characters (letters, digits, _, ., : and -) that the assistant makes up once for this purchase decision. If it has to retry the same decision it sends the same key, and the server answers the same checkout instead of making a second one. A different selection needs a new key.
  4. The answer's handoffUrl opens a LivingSocial page where the person reviews the order and continues to Groupon's own checkout, where they pay. The link is private to that person, works once and expires after 15 minutes (handoffExpiresAt says when). It is null once the person has opened Groupon's page for that checkout. To get a fresh link before then, the assistant calls prepare_checkout again with the same operationKey.
  5. The assistant calls get_purchase_status to learn how the purchase ended. Only the status confirmed means it is paid.

otherOpenCheckouts in the prepare_checkout answer lists other purchases of the same session that the person may still be paying for. A session can hold up to three open checkouts.

A checkout's status is one of:

StatusMeaning
createdPrepared. The person has not opened the link yet.
handed_offThe person opened Groupon's page.
pendingGroupon has not reported an outcome yet.
confirmedPaid. This is the only paid status.
rejected, cancelled, expiredNot paid.
uncertainLivingSocial could not confirm the outcome. The person should check their Groupon account before buying again.

LivingSocial learns the outcome only when the person comes back from Groupon's page, so a status can lag behind a payment. uncertain appears only after 24 hours without an outcome. Before that, a checkout the person has left for Groupon shows as handed_off or pending.