Skip to main content

Transaction history data specification

For sales analytics, elasticity modeling, and retail intelligence. Check the sample sample_transactions.
You can also load transaction data programmatically via the public Retailgrid REST API. API payloads use slightly different field names and required fields — see Loading via the API below.

1. Objective

Use this dataset for:
  • Sales performance analytics
  • Price elasticity modeling
  • Demand curve estimation
  • Price optimization
  • Promotion impact analysis
  • Store performance benchmarking
You must provide data at transaction line level.

2. Data granularity requirement

Each row must represent:
One product in one transaction
Correct: Incorrect:
  • Daily aggregated totals
  • Store-level summaries
  • Pivoted exports

3. Transaction history — unified data specification

4. Return handling policy (mandatory if returns exist)

Returns must be provided as separate transaction rows.

4.1 Format for returns

4.2 Example

Original Sale Return

4.3 Important rules

  • Do NOT delete original sale rows
  • Do NOT aggregate net values before export
  • Do NOT use positive quantity for returns
  • unit_price must remain positive
  • Returns must reflect the actual return date

5. Data format requirements (strict)

5.1 Timestamp

Must follow ISO 8601:
Example:
Timezone:
  • Preferably UTC
  • Or timezone must be clearly specified

5.2 Numeric fields

  • Decimal separator: .
  • No thousand separators
  • No currency symbols
  • No localized formats
Correct:
Incorrect:

5.3 Discount format

Must be a rate:
Not:

6. File format

Accepted:
  • CSV (UTF-8 encoding) — preferred
  • XLSX
No pivot tables
No formulas
Raw data only

7. Historical data requirements

Minimum:
  • 6–12 months of history
  • Preferably 24 months
Recommended minimum volume:
  • 10,000+ transaction rows per store

8. Data validation rules

  • quantity ≠ 0
  • quantity > 0 for sales
  • quantity < 0 for returns
  • unit_price ≥ 0
  • discount_rate between 0 and 1
  • transaction_timestamp not null
  • item_id must exist in product master file

9. SQL schema example

10. Minimal dataset (if system limitations exist)

If the system cannot provide full structure, minimum required:
Returns must still follow negative quantity logic.

11. Loading via the API

The public REST API accepts the same data through POST /v1/transactions/bulk (JSON records) or POST /v1/imports/transactions (CSV import), with two differences from the CSV schema:
  • There is no transaction_id field in the API. Use the optional external_transaction_id to carry your own transaction identifier — the API does not require one.
  • Required fields in API payloads: item_id, store_id, transaction_timestamp, quantity, selling_price.
API-only optional fields: sku, region, promo_type, zone_price.
The JSON API rejects unknown fields — payloads containing fields outside the schema fail validation.