The review in the API

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

What GET /api/v1/outbound/reviews/{week_start} returns, field by field, as release 2.18.0 sends it. The arithmetic behind the amounts is on How the week is stated; the routes and who may call them are on the API reference. Amounts are in the workspace's currency, shares are numbers from 0 to 1, dates are ISO 8601, and every instant (a time with a date) is in UTC, written with its offset +00:00, whatever zone the workspace keeps. A field that does not apply is null or left out.

The review

FieldWhat it is
api_versionThe version of this shape, 1
week_start, week_endingThe first and last day of the fiscal week
statusdraft, in_review or published. With include=in_progress, a week that is not published is sent as it stands
published_atWhen the review was published, or null
analyzed_atWhen the run that produced the statement finished
engine_versionThe version of the analysis that produced it
workspaceThe workspace's short name
restatedSet when this review restates the week on data loaded again after an earlier review of it, so that a pull does not overwrite an earlier figure without a flag: restated_at, from_run_produced_at, replaces (the review readers had before, when one was published: published_at and its variance_amount; null when none was), labels_carried, planner_causes_carried, actions_carried and reading. null for a review that is not a restatement. For a key or a member limited to some stores, replaces.variance_amount is the variance of their stores as the earlier review stated it (from the store totals kept with that review; null for a review produced before release 2.16), and the carried counts, which are the company's, are null; reading says so. Between a load of new data and the run that states it, a limited caller's pull answers 409 data_changed, as the review does: their stores cannot be stated from the kept whole-week figures
limited_toFor a key limited to some stores: which stores. Left out otherwise
statementThe three parts of the week, below
commentaryformat (markdown) and body, the commentary as it stands. For a key limited to some stores, the draft written for those stores, with generated_for_scope
recorded_by_plannersThe causes planners added, each as the planner stated it, with reading, count and causes. A cause's ref is the same for every caller, a key limited to some stores included. Never part of the statement's arithmetic
decision_historyThe planners' decisions on the review, newest first
readingOne paragraph on how to read the statement

The statement

FieldWhat it is
schema_versionThe version of the statement's shape
basisHow the statement was produced: derived-from-findings, stated by Kelynto from the findings of the run
period_start, period_endThe week's first and last instants (midnight at its start and at the start of the following week, in the workspace's zone), written in UTC
currency, measureThe currency of the amounts, and what is measured (money)
scopeThe level stated: level, label, region, store_code, category, trail (the levels above it, each with level and label) and limited_to
reference_kindWhat the actual is compared with: PLAN_ON_FILE, the plan in your sales file
reference_amount, actual_amountPlan and actual sales for the level
variance_amount, variance_pctActual less plan, as an amount and as a share of plan
net_shortfall_amountPlan less actual when the level is below plan, otherwise 0. The net gap, not what the shares are of
residual_after_estimatesActual less plan less every recorded cause's estimate, lifts included. What the estimates leave of the net gap; no part of the review is stated from it
grossThe week on gross movements: shortfall_amount (every store and category cell below plan, added up), lift_amount (every cell above plan), net_amount (the two together), granularity (store_category) and share_basis (shortfalls: every share is of shortfall_amount)
data_changedSet when the sales or plan of the week changed after the review was produced: reviewed_reference_amount, reviewed_actual_amount, reviewed_variance_amount (what the review was produced from), reference_amount, actual_amount, variance_amount (what is on file now) and kept (true: the statement's figures are the review's own)
run_before_week_endedSet when the review was run on or before the last day of its week, in the workspace's zone: run_on (the day it ran), week_ends and days_missing (the days of the week not yet in). The actual is the sales loaded by then, read against the whole week's plan. Null for a week that had ended
amount_causesThe kinds of cause that may carry an estimated amount
context_kindsThe kinds of record that are listed as context and carry no amount
partsrecorded_with_estimated_impact, on_file_not_credited and not_explained, below
wordsThe sentences every surface uses for the week: summary, short, net, sides, recorded, not_explained, lifts and named (what planners named, or empty)
headlineThe answer in three states that add up to the amount under plan: basis, under_plan_amount (every store and category cell under plan, added up), net_amount, order and states. states holds sized (estimated from the records, with amount_low and amount_high when the engine stated a range), explained_by_team (under plan where a planner confirmed a record on file mattered, named the cause or added one, with no amount attributed to any cause; its items each carry key, kind, title, cause_label, by, store_count, place_label and the amount it covers) and open (nothing on file and no cause named). Each state has label, what, amount and share. words holds position, sized, team, open and lead; pattern says what kind of miss it is (kind, words, stores, records, categories). explained_by_team and open add up to the amount of part 3
plan_biasWhere the plan has run off at the stores of the level for some weeks, as the engine reads it: direction, pct, weeks, store_count, stores and words. A reading of the plan beside the three states, never added to them
named_by_plannersThe causes planners named for items of the statement: count and items, each with finding_id, title, cause_type, cause_label, note, by, user_id and at. Outside the arithmetic
childrenThe level below, as places (regions, or stores) and categories, each with level, rows and rows_not_listed
product_levelAt a category: what is on file by product. Left out elsewhere

Part 1: recorded this week, with estimated impact

FieldWhat it is
titleThe part's heading
estimated_amountThe shortfalls the recorded causes are credited with
share_of_shortfallsThat amount over gross.shortfall_amount
offset_amount, lift_creditedThe lifts the recorded causes are credited with
itemsOne per recorded cause with an estimate
without_estimateRecorded causes with no estimate: id, cause, cause_label, title, category, place_label, store_count and reason

Each of items:

FieldWhat it is
id, finding_idThe item's id in the review
cause, cause_labelThe kind of cause, as a code and in words
title, category, region, place_labelWhat and where, in words
store_count, store_codesHow many stores the cause is recorded at, and every one of their codes
gross_effect_estimateThe engine's estimate of the cause's effect: negative for lower sales, positive for higher
gross_loss_estimate, gross_offset_estimateThe same estimate split into its loss and its lift
credited_against_shortfallsThe part of the loss credited against the shortfalls where the cause's records sit
lift_creditedThe part of the lift credited against the lifts where its records sit
budget_adjustmentThe part of the estimated loss that found no shortfall where the cause's records sit, and is credited nowhere
share_of_shortfallscredited_against_shortfalls over gross.shortfall_amount
amount_low, amount_highThe low and the high figure of the estimate's range, on the credited amount, read from how much the store and category ordinarily move. null where the review has no measure of that. The range is the week's ordinary movement around the estimate; it does not say the cause is proven
record_confirmation, limitationsWhat the record confirms, and what the estimate does not
method_id, amount_method_labelWhich method sized the amount when the engine recorded one (model or rule; the label reads "the engine's estimate" or "a one-line rule from the records"), else null
calendarFor a promotion: category, on_calendar, every_store, estimated_at, left_out, left_out_unexplained and left_out_no_lift (the calendar's stores the estimate leaves out; those of them whose movement is under part 3; and those at or below plan in the category, with no lift to estimate)
evidencebasis (what the estimate rests on, in words), summary, stores (the largest stores, each with store_code, store_name, region, categories, estimated_amount and records) and stores_not_listed. Each record has record_type, record_id, text, starts_on, ends_on and source (label, upload_id, file, loaded_at)
planner_notesPlanners' notes on the item: finding_id, store_count, place_label, store_codes

Part 2: on file this week, not credited

FieldWhat it is
title, record_count, as_ofThe heading, how many records, and when they were matched to the stores: run (kept with the review when it was produced) or read (matched when the statement is read, for a review produced before records were kept with it)
itemsOne per record, or per set of records that say the same thing at several stores
other_recordsRecords of a kind the review does not use as context, listed so that nothing on file goes unseen
deliveries, delivery_countDeliveries of the week the receipts file says were late or short (release 2.22.0). Each: id, kind (late_delivery), kind_label, status (late, short, late_short), status_label, title, category, store_code, store_name, region, place_label, week_start, measure (amount or units), measure_label, planned, received, not_landed (the file's own figures), expected_date, received_date, purchase_order_id, source_label, upload_id, note. No amount is credited to a delivery. Absent on a review produced before the receipts file existed

Each of items: id, kind, kind_label, signal_type, title, description, source, source_label, starts_at, ends_at, place_label, place_count, regions (each region with its number of stores), record_ids, records (each with record_id, store_code, store_name, region, distance_km, days_in_week, known_at and after_run), records_not_listed, after_run (true when every record came on file after the review was produced) and planner_notes. No item carries an amount.

Part 3: not explained

FieldWhat it is
titleThe part's heading
amountEvery shortfall no recorded cause is credited with, store by category
share_of_shortfallsamount over gross.shortfall_amount
basisshortfalls when the level has shortfalls; no_shortfall when it has none; incomplete_input when plan or actual is missing
reasonsHow the part was stated, in words
concentratedThe movements the engine named inside it: title, amount, cells, place_label, store_count and stores
spread_amount, spread_cellsWhat is spread over other stores and categories, and over how many cells
lift_amountLifts no recorded cause is credited with
movementsThe engine's findings behind concentrated: id, title, place_label, store_count, category, observations and observations_not_listed

Rows of the level below

Each row of children.places.rows and children.categories.rows: key, label, store_code, params (how to ask for that level: region, store or category), reference_amount, actual_amount, variance_amount, variance_pct, net_shortfall_amount, shortfall_amount, lift_amount, recorded_amount, recorded_causes, amount_not_explained, share_not_explained (of the row's shortfall_amount) and records_on_file.

At a category, product_level has available, contract, method_id, lowest_level, products_on_file, note and items (each with product_code, product_name, reference_amount, actual_amount, variance_amount, stores and recorded: cause, cause_label, estimated_amount, gross_effect_estimate and credited_against_shortfalls).

  • API reference
  • How the week is stated