Data contract and templates

Kelynto developer documentation. Sandbox access: marc@kelynto.com.

Kelynto reads weekly aggregates from files. This page says which files, what has to be in them, how a file is checked before it is loaded, and what to do when one is refused. The column-by-column contract is also in the product, under Data, Data contract, where it always matches the version you are running.

The six files

FileOne row perNeeded for
StoresstoreEverything. Code and region are required; latitude and longitude are strongly recommended.
Salesstore, week and categoryEverything. Actual sales and plan sales.
In-stockstore, week and categoryTelling a stockout apart from other causes. Optional.
Promotionsweek and categoryStating that a promotion was on the calendar. Optional.
Receiptsdelivery (store, week, category and an optional purchase order reference)Answering whether the goods landed: what was planned to land, what did, and when, in amounts or units. The Outlook sizes a late or short delivery ahead; the review lists one of its week with no amount. Optional.
Signalslocal factRecords only you know: a competitor opening, a remodel, a closure. Optional.

Stores come first: sales rows for a store code Kelynto does not know are skipped. Item-level, transaction, shopper, payment and employee data are not needed and should not be sent.

One week of sales with plan is enough to write a review. In-stock is compared with each store and category's usual level over the eight weeks before, so nine weeks of in-stock gives the full comparison.

File formats

  • CSV, Excel .xlsx and the older Excel .xls. A delimited file may use a comma, semicolon, tab or pipe; the separator is detected.
  • UTF-8 with or without a byte order mark, Windows-1252 and UTF-16 are read.
  • In a workbook with several sheets, the sheet whose columns match the dataset is read; a sheet of notes beside the data is passed over. When that cannot be told, you are asked which.
  • A recap workbook laid out as a grid (stores down the side and weeks across the top, categories by week, or stores by categories for one week) is read as rows, with a title row, merged header cells and a totals row recognised. The totals row is checked against what would load; when they do not add up, the file is held for a decision. Store names that look like stores on file are proposed and matched only when you confirm them. Tick "keep this mapping as a source profile" on the preview and next week's workbook of the same shape maps by itself.
  • Every preview carries a data quality report (missing weeks, repeated rows, stores missing either way, a negative or zero plan, weeks that are not week-ending dates, mixed currency or units, the workbook's totals, rows with errors), kept with the upload and its delivery and downloadable as CSV.
  • Not read: password-protected workbooks, Parquet, JSON, XML and fixed-width files. A file that cannot be read is refused with what to change.
  • The default limit is 50 MB per file. Send large files as CSV, and split a long history by date range: a later file for the same weeks updates them in place.

Upload a file and read the preview

  1. Open Data, then Upload, and choose the file. An analyst or an admin can do this.
  2. Kelynto checks it and shows a preview. Nothing is stored yet.
  3. Under How each column is read, check each column of your file against the field it will be loaded as.
  4. Under Repairs made, read what was changed: a title above the header row, currency symbols, blank lines and blank rows, a totals row the export added under its table (left out, never loaded as a store called "Total"), names that differ only in capitals or spacing.
  5. Answer any question the preview asks. Some things are never guessed: whether 03/04 is the third of April or the fourth of March, how the file writes numbers, and whether two rows for the same store, week and category that differ only in their amounts are parts of one total to add up or the same record sent twice to hold back. The answer is remembered for the dataset, and a row added into another row counts as loaded, not left out.
  6. Read Worth checking: a week that has not ended yet is loaded as sent and flagged, because its sales so far read against the whole week's plan; its review is run only on purpose and says it was run before the week ended.
  7. Confirm to load, or choose Cancel, load nothing.

Map columns, or start from a template

Column names the data contract knows are mapped by themselves. For any other column the preview proposes a field from the name and the values. Change any proposal that is wrong, and set a column you do not want to Do not load. When the table is right, choose Use this mapping: nothing is read from a proposed column until you do, and the row counts at the top of the preview are then worked out again.

A confirmed mapping is remembered for next week's file, however it arrives.

Under Start from a template you can pick a ready-made mapping for a common shape of export, such as weekly plan against actual by store and category. The templates are generic: none is the layout of a named product.

Read the report and fix a refused file

Every file gets a report with one of three outcomes.

Accepted : Every row loaded.

Partial : Some rows were skipped, for example unreadable values or store codes that are not in your stores file. The rest loaded.

Rejected : Nothing was loaded. A required column is missing, more than one row in five has an error, no row could be loaded, or a sales or in-stock file arrived before any store was loaded.

Each problem names the row, the column by its header and its spreadsheet letter, the value found, the rule it broke and a suggested fix. To fix a file:

  1. Open Data, then Upload history, and open the file's report.
  2. Download the full list of problems and hand it to whoever produces the export.
  3. Upload the corrected file. Rows for the same store, week and category are updated in place; nothing is doubled.

A file that was loaded with a wrong mapping can be read again from its stored copy, with a before and after.

Check what is loaded

  • Data, Coverage lists the weeks loaded, with the number of stores that have sales in each, and the local signals on file.
  • Data, Health shows whether the data expected for the latest week has arrived.
  • Data, Upload history lists every file with its outcome.

Stores and their coordinates

Data, Stores lists the stores and shows which have no latitude and longitude. A store without coordinates gets no weather, event or road-work record matched to it, and cannot be placed on the Watch map. Add the two columns to the stores file and upload it again.

Fetch files on a schedule

An admin can have Kelynto collect files from an SFTP folder, an S3-compatible bucket or an Azure Blob container.

  1. Open Data, then Scheduled drops, and add a drop.
  2. Give the place, the dataset its files hold, a file-name pattern, how often to look, and what happens to a file once taken: left, moved or deleted.
  3. For SFTP, accept the server's host key before anything is sent to it.

Each file goes through the same checks as an upload, and every run is listed with one line per file. Credentials are stored encrypted and never shown again. Only public addresses can be reached. In a deployment in your own environment, scheduled drops are off until your operator switches them on.

Send files from a program

A program can send a file of any dataset to the API, with a Kelynto API key that holds the scope to write data, or with a token of your identity provider. The same checks run and the same report is returned. An Idempotency-Key header makes a retry safe. Control totals go with the file as a second part named controls:

curl -sS -X POST "https://kelynto.example.com/api/v1/inbound/submissions/sales" \
  -H "Authorization: Bearer $KELYNTO_KEY" \
  -H "Idempotency-Key: sales-2026-10-04" \
  -F "file=@sales_2026-10-04.csv" \
  -F "controls=@sales_2026-10-04.csv.controls.json"

The answer is 201 when the file loaded, 202 when it is held for a decision, 200 when the same content was received before (nothing is loaded again, and its control totals are still checked), 422 when it was refused, by validation or because its control totals could not be read, and 409 when the Idempotency-Key was used for another file. Each answer carries delivery, with the control totals' result. See the API reference and, for making a key, Administration.

Govern a recurring export

For an export that arrives every week without anyone watching it, an analyst or admin can make Kelynto check each delivery against a contract before it touches the review.

  1. Load one file of the export the usual way, and check its preview until it reads right.
  2. Open Data, then Deliveries, and choose Make a profile. Choose that upload, name the profile after the export, and choose where it applies: browser uploads, the inbound API or a scheduled drop. Choose what it requires: control totals with every delivery, whether the readable rows of a file with problems may load, and whether a change to a published review is held.
  3. Ask whoever runs the export to send control totals with it: the records and the sums of actual and plan sales per week, and per store if they can, in a small JSON or CSV file beside the export (Control totals, below).

From then on a delivery that differs from the profile (a column renamed, added or gone, a column that changed type, a changed week start), whose control totals do not reconcile exactly, or that would change a published review is held: nothing of it loads, and the admins and analysts are told. On Deliveries they read exactly what differs and exactly what loading it would change: each row with its figures before and after, the weeks, stores and categories it moves, and, for a published review, the variance the review stated and the variance with the delivery loaded. Then they approve it with a reason, accept a column change as the profile's next version (checking how each column will be read, and changing any), or reject it with a reason. The person who sent a held file does not approve it while another admin or analyst can; in a workspace with one admin or analyst, that person may, and the history marks it. A file received twice is recognised and loaded once, and control totals sent with it are still checked against it; "Load it again" in the browser puts a week's original file back after a correction. A profile can let the columns it does not load come and go. Every load is read back from the database and rolled back if what was stored differs from what was accepted.

The delivery history on the same tab lists every file received, from every channel, with its outcome, its control totals, the profile version that read it, the reviews it affected and who decided; it downloads as a CSV file. Planners read it; a member limited to some stores does not see it.

Control totals

Control totals say what a delivery holds, produced from the same source by whoever runs the export. When a delivery carries them, the file must match them exactly before anything loads: the records, the weeks, and, for sales, the sums of actual and plan sales per week (and per store and week, if given), added up without rounding and compared to the cent. As CSV, one line per week with the store code blank, and optionally one per store and week:

week_start,store_code,rows,actual_sales,plan_sales
2026-09-21,,3,3310.75,3600.00
2026-09-21,007,1,1000.50,1100.00

Or as JSON: {"rows": 3, "weeks": [{"week_start": "2026-09-21", "rows": 3, "actual_sales": "3310.75", "plan_sales": "3600.00"}]}, with stores, store_codes, categories and a reference (where the figures come from) as options. A week may be given by its last day (week_ending) instead. Write amounts with a dot for decimals and no thousands separator or currency sign.

How the file arrivesWhere its control totals go
Uploaded in the browserChosen with the file on the import preview
A scheduled dropA file beside it, named after it: sales_w39.csv.controls.json or sales_w39.csv.controls.csv
The inbound APIA second part of the request named controls, or the Kelynto-Controls header with the JSON on one line

Add records only you know

The signals file holds one local fact per row: a type (event, weather, road work, competitor opening, competitor closing, store operations, or other), a title, a start time, and either a store code or coordinates. An end time and the categories affected are optional. These records are matched to stores by distance and week, and are listed in the review and on Watch as records on file, with their place and dates.