Skip to content

Offline sync

Reps often work in stores with no signal, so the field app treats offline as normal. It keeps a local copy of everything it needs and sends store checks when it can.

GET /v1/{team}/sync

The response has five parts:

Key What’s in it
assignments The rep’s pending and in_progress visits, outside closed campaigns, each with its checklist and customer.
audit_types Active checklists the rep can submit, with their fields.
customers Active customers.
campaigns Open campaigns behind the rep’s visits, with their items and detail fields.
last_synced_at The server time of this sync.

Records here use numeric ids, which is what customer_id expects when you submit a store check.

JSON columns such as settings, options and validation are always objects, never [], so typed clients can model them as maps.

  1. On first sign-in, call sync without parameters and store everything.
  2. Next time, send since set to the previous last_synced_at. You get only visits, checklists and customers that changed since then. Campaigns are always sent in full.
  3. Merge the changes into the local copy by id, then save the new last_synced_at.

Sync when the app opens, when it comes back online and when the rep pulls to refresh. Show the time of the last sync in the app, as the styleguide’s offline rules ask.