Skip to content

Instantly share code, notes, and snippets.

@madebysofa
Created February 16, 2010 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madebysofa/305951 to your computer and use it in GitHub Desktop.
Save madebysofa/305951 to your computer and use it in GitHub Desktop.
lastSyncedOrderTimestamp = 123456789 # (utc epoch timestamp)
# Fetch all orders since last timestamp per 20
ordersToProcess = api.orders.all(
since=lastSyncedOrderTimestamp, size=20)
# Process the order one by one
for order in ordersToProcess:
try:
crazyOrderConvertToAEFunction(order)
except SomeCrazyError:
handleError()
exit()
# Set the new last synced order timestamp
lastSyncedOrderTimestamp = order['date']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment