Skip to main content

Data

Data is the inbound connection: everything that has to exist inside Loyal Guru before the loyalty program can run. The Promo Engine cannot evaluate a cart against a product that is not in the catalogue, and it cannot award points to a Customer it does not know. Every other connection reads the state this one creates — which is why it comes first in every project.

Two families of data, five entities:

SectionEntitiesWhat it covers
Company DataCatalogue · Locations · CartsThe master data the retailer owns: products and their classification, stores and their features, and the sales that have already happened.
Customer DataCustomers · Custom EventsWho the customer is, and what they do beyond buying.

Reading data back out for reporting is a different connection with a different channel — see BI and Data Lake.

Two channels for the same data​

The Streaming API is ready to receive every entity on this page, and it is the recommended channel: data lands in Loyal Guru as it happens, and your systems get an immediate answer on whether each record was accepted.

It is not the only option. Every entity can also arrive as agreed flat files — CSV delivered on a schedule — and that applies to Customer Data exactly as it does to the catalogue. Files are the normal channel for the initial load, where the volume makes real-time requests impractical, and they stay a valid channel for ongoing synchronisation when the source system cannot call an API. Integration is never the constraint: if the retailer cannot expose API calls, the same data model is loaded from files.

ChannelHow it worksBest for
Streaming APIYour middleware calls the create/update/delete endpoints of each entity. Recommended.Ongoing synchronisation, near-real-time changes, per-record confirmation of what was accepted
Flat filesThe retailer (or its middleware) drops CSV files on the agreed transport and schedule, and Loyal Guru ingests them. Transport is normally SFTP; S3 and Google Cloud Storage are also supported.Initial historical load, large volumes, source systems that already export feeds
Owner AppOperators create or edit records directly in the Loyal Guru screens.Manual corrections, pilots, taxonomy design before automation

Most production projects are hybrid, and that is the recommended shape: files for the initial load, API for the deltas afterwards. Some projects stay hybrid permanently — a weekly catalogue file, real-time carts — and that is a legitimate design. What matters is not which channel each entity uses, but that both channels write to the same records: see One ID strategy, whatever the channel.

note

File layouts, field-level definitions, drop locations and schedules are project-specific and agreed during technical onboarding. Ask the Loyal Guru project team for the Data Tracks template: it carries the exact columns, data types, and which fields are mandatory for each entity.

Initial load, then periodical load​

Every project runs the data connection in two phases, and they are usually built by different people at different times.

PhaseWhat it isChannel
Initial loadA one-off export that brings Loyal Guru up to the retailer's current state: the full catalogue, all stores, the customer base, and the sales history — typically the last 24 months of tickets, which is what makes historical segmentation and tier calculation possible from day one.Flat files, in practice always
Periodical loadOngoing synchronisation of creates, updates and deletes once the program is live.Streaming API (recommended) or scheduled files

For the periodical load, a daily frequency is the minimum that keeps a program coherent; anything less means campaigns evaluate against a catalogue or a customer base that no longer matches reality. Higher frequencies — up to per-transaction API calls — are what most projects converge on for carts.

What each entity needs​

Reference shape of a standard project. Frequencies are the usual starting point, not a constraint: confirm yours with the Loyal Guru project team.

EntityIn the initial loadTypical frequencyDelta or full refreshAPI path
CustomersYesDailyDeltaPOST / PATCH / DELETE /customers
CatalogueYesWeeklyDelta/products, /taxonomies, /taxonomies/{slug}/features
LocationsYesWeeklyFull refresh/locations, /locations/taxonomies
CartsYes — ticket headers and lines, 24 months of historyDaily, or per closed ticketIncrementalPOST /carts/realtime
Custom EventsNoAs events happenIncrementalPOST /custom_events

In the file world, ticket headers and ticket lines are two separate files that are loaded together; over the API they are a single cart payload with a lines array. Carts covers both shapes.

One ID strategy, whatever the channel​

This is the single decision that most often decides whether a data integration works or has to be redone.

Every entity is identified in Loyal Guru by the external ID the retailer's own systems use. A product loaded from a weekly file and the same product updated through the API must carry the same identifier, because that identifier is what a cart line will reference at checkout months later.

  • Pick the ID strategy before the initial load, not after. Changing it later means reloading history.
  • Use the identifier the POS and e-commerce actually send at runtime — not an internal warehouse key they cannot resolve.
  • Keep it stable across channels: files, API and Owner App all write to the same record when the ID matches, and create a duplicate when it does not.
  • Deletions and status changes need the same discipline: a retired SKU that keeps its ID stays reconcilable in historical carts.

Before you send the first load​

These checks catch the failures that are expensive to unwind once the data is in. They apply to files and to API payloads equally.

  1. Ticket lines add up to the ticket header total.
  2. Every ticket line references a ticket header that exists in the load.
  3. Every ticket header references a location that exists in the location data.
  4. Every ticket line references a product that exists in the catalogue.
  5. Returns carry negative totals and quantities.
  6. Unidentified purchases — sales with no loyalty card — carry an empty customer identifier rather than a placeholder one.
  7. Customer email is unique across the customer file.

For file loads, the Data Tracks template also fixes the field-level conventions: integers, floats with . as the decimal separator, strings up to 255 characters, dates as YYYY-MM-DD, timestamps as YYYY-MM-DDTHH:MM:SSZ, and booleans as true / false. Mandatory fields are marked there; a missing mandatory field rejects the row, not the file.