STAGINGOpen PROD

Keeping your catalog fresh

Last updated ยท Page 4 of 5

RunWhenWhat it reads
Full syncFirst, onceEvery product in your scope
Full resyncEvery 8 hours: the minimumEvery product again, then stop listing what the walk did not return
Delta refreshEvery hour: optionalOnly what changed since your last refresh (updatedSince)

A delta returns every product whose price, content or status changed since updatedSince, expired products included: stop listing those. A delta alone is not enough: it cannot show you an offer that left your scope or stopped being sellable for another reason, which only the full resync removes. The catalog you walk is LivingSocial for Agents' copy of Groupon's, refreshed every hour, so a delta more often than that finds nothing new. A change of only merchantRating, merchantWebsite, rating, bought, a location's hours or its phone does not bring a product into a delta: the full resync refreshes them.

One walk serves all three runs. Walk each market your storefront sells on its own (country=US, then country=CA; GET /partner_storefront/me lists them in inventoryCountries):

text
seen = empty set                                     # resync only
params = { country: "US", limit: 100 }               # delta: add updatedSince: lastRefreshAt
cursor = none
repeat:
    page = GET https://api-staging-core.livingsocial.com/partner_storefront/products?params (+ cursor if set)
    upsert every product in page.data by its id      # replace options, prices, status
    add every id in page.data to seen                # resync only
    cursor = page.nextCursor
until page.hasMore == false
stop listing every product whose id is not in seen   # resync only; keep the row
lastRefreshAt = page.timestamp                       # the final page's timestamp