STAGINGOpen PROD

Buying through your assistant

Last updated ยท Page 5 of 6

  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 100, within the option's own limit), 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. Once a checkout is paid, the lines it carried leave the session's cart: get_cart no longer lists them and the next prepare_checkout never bills them again. A line added or changed after that checkout was prepared stays in the cart.

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.
rejectedGroupon declined the payment, at its checkout or in its fraud review. Not paid. The page the person comes back to offers to pay again with another payment method on the same checkout; if they do, the status becomes confirmed.
refundedGroupon confirmed the order, then refunded it. Its codes no longer work.
cancelled, expiredNot paid.
uncertainLivingSocial could not confirm the outcome. The person should check their Groupon account before buying again.

A checkout's orderBasket says whether the order Groupon took holds exactly the checkout's lines (as_sent) or more (changed_at_groupon): when the person is signed in at Groupon, Groupon's checkout can add their own Groupon cart, and the amount charged then differs from totalMinor. The status still says how the order ended.

LivingSocial learns the outcome from Groupon's order for the checkout, or when the person comes back from Groupon's page, so a status can lag behind a payment by a few minutes. 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. Two outcomes can still change: LivingSocial keeps reading a confirmed purchase for a refund for 30 days, and a rejected one for a payment made again until 24 hours after the person left for Groupon.