Without the return: read the cart
Page 3 of 9
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-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. When a cart names an order, read the order (below):
CONFIRMEDorREDEEMED: match its items to the cart's lines, then mark the cart purchased as in steps 3 to 5 above.ON_HOLDorPENDING: read it again later.REJECTED,CANCELLEDorEXPIRED: it is not the outcome. The cart names the shopper's first order only, so a payment that went through after a declined one is never named on it: wait for the redirect, and do not rebuild the cart or ask the shopper to pay again on this alone.
The order named is the first one the shopper's browser placed within 24 hours of the cart, which can be a different purchase: never mark anything purchased without the item match. An order placed later than 24 hours after the cart was created is never named on it.