STAGINGOpen PROD

Without the return: read the cart

Last updated ยท Page 3 of 11

A shopper may close the tab, and an agent may never open your redirect URL. Your server can still learn the sale: once Groupon records an order on a cart, every cart response carries it in grouponOrderUuid, and the cart's status reads CHECKED_OUT. Keep the redirect as your main path; reading the cart catches the shopper who does not come back.

bash
curl -s "https://api-staging-core.livingsocial.com/partner_storefront/carts/<cartId>" \
  -H "Authorization: Bearer $GROUPON_API_KEY"

Read the carts whose shoppers left for Groupon, once a minute is enough. Once a cart names an order it answers buyLink: null: after a fraud decline Groupon's checkout of that cart sends the shopper to an empty cart, so the Partner API never hands it out again. Read the order (below):

  • CONFIRMED or REDEEMED: match its items to the cart's lines, then mark the cart purchased as in steps 3 to 5 above.
  • REFUNDED: the shopper paid and Groupon gave the money back. Mark the cart refunded, never as a purchase still open.
  • ON_HOLD or PENDING: read it again later.
  • REJECTED or EXPIRED: the payment did not go through. It is not the outcome on its own: after a card decline, Groupon's own decline page lets the shopper pay again on the same cart, and the cart keeps naming the declined order. Do not rebuild the cart or ask the shopper to pay again on this alone. When the shopper comes back to your site, offer a new cart with the same lines (step 4 above); that is the one way to pay again through your site.
  • CANCELLED: an order that was paid and then cancelled with nothing charged. Nothing to retry.

The order named is the first one the shopper's browser placed within 24 hours of the cart, which can be a different purchase, or the newest order placed from this cart's checkout that Groupon marked with the cart's id: never mark anything purchased without the item match.