Skip to main content

Register, Prices and Workbook

Read the contract register, recompute component prices per price period, fetch the contract workbook as a grid or xlsx file, and read EU ETS emissions cost.

Five read routes expose what the price models compute. GET /v1/price-baseline/register is the overview: one row per contract. GET /v1/price-baseline/models/{id}/prices recomputes every component's price per price period. GET /v1/price-baseline/models/{id}/sheets returns the contract workbook as a grid and GET /v1/price-baseline/models/{id}/workbook.xlsx writes the same workbook as an Excel file with live formulas. GET /v1/price-baseline/models/{id}/emissions adds the EU ETS view. All of them recompute from the stored models and index values at request time, so a value entered a moment ago is already in the answer.

The register has one row per contract, shown by its latest version, with the newest invoice check, the amount the workbook expects to be billed for the period, and how many inputs are still open. It is cached per workspace and year; a request during a rebuild may receive the last built rows. direction tells which side the workspace is on: only sell contracts count toward what customers should be billed. The response is a bare array.

GET/v1/price-baseline/register

Query parameters

yearintegerPlan year of the expected amounts. Default: the last full calendar year
inputsstringPass 0 to leave out the per-contract inputs lists; each row then carries an empty array.

Key row fields

iduuidThe contract's latest version.
contract_key / contract_number / customer / sitestring | nullIdentity of the contract as modelled.
versions / amended / pricedinteger / boolean / booleanNumber of versions, whether an amendment exists, and whether any version states a price.
invoiceobject | nullThe newest invoice check: comparison_id, invoice_number, period_from, period_to.
expectedobject | nullWhat the customer should be billed for the period: basis (invoice or plan), net, vat, gross, complete, currency, assumed_net, lines, check.
openobject | nullOpen inputs of the workbook: price, waiting, assumed, invoice and the period. Null when the workbook could not be built.
inputs[]arrayThe data the contract still needs for the year.
contractobject | nullWhat the Contracts app last published about the contract: contract_id, status, expiry_date, terminated_on.
directionstringsell, buy, or internal.
identifiersobjectEvery id the contract is known by outside its key: document_ids, record_ids, cost_units and where they came from.
duplicates[]arrayRows of the same contract kept apart by their keys, listed so their plan counts once.

cURL: Read the register for one plan year without input lists

curl "https://api.talonic.com/v1/price-baseline/register?year=2025&inputs=0" \
  -H "Authorization: Bearer $TALONIC_API_KEY"
GET/v1/price-baseline/models/{id}/prices

Query parameters

from*stringFirst month, YYYY-MM.
to*stringLast month, YYYY-MM; not before from.

Response fields

prices[].componentstringComponent key.
prices[].periodobjectlabel, from and to (YYYY-MM).
prices[].pricenumber | nullThe price, null when it could not be computed.
prices[].unitstringUnit of the price.
prices[].statusstringok, missing_index, missing_value, rebase_mismatch, unit_mismatch, custom_reference, or formula_error.
prices[].detailstring | nullWhy the price has a status other than ok.
prices[].indices[]arrayPer index variable: series, months read, value, sources, independent, rebase, assumed, from_invoice.
prices[].assumptions[]arrayEvery assumption the price rests on.
indices[]arrayThe stored index values the prices read: series, period, value, unit, source, source_url, quote, document_id, base_year.

Response: Prices and the index values behind them (excerpt)

{
  "prices": [
    {
      "component": "AP",
      "period": { "label": "Q1 2025", "from": "2025-01", "to": "2025-03" },
      "price": 7.184,
      "unit": "ct/kWh",
      "status": "ok",
      "detail": null,
      "indices": [
        {
          "variable": "G",
          "series": "destatis.erdgas.boerse",
          "months": ["2024-12"],
          "value": 142.6,
          "sources": ["destatis"],
          "independent": true
        }
      ],
      "assumptions": []
    }
  ],
  "indices": [
    {
      "series": "destatis.erdgas.boerse",
      "period": "2024-12",
      "value": 142.6,
      "unit": "Index",
      "source": "destatis",
      "source_url": "https://www-genesis.destatis.de/",
      "quote": "Dezember 2024: 142,6",
      "document_id": null,
      "base_year": 2021
    }
  ]
}

Prices are converted, never assumed. A value in another unit of the same quantity (EUR/MWh and ct/kWh) is converted; a pair that cannot be converted is unit_mismatch. When a contract quotes an index on another base year than the stored series, the value is rebased on the publisher's own numbers; if the twelve base-year months are not all stored, the price is rebase_mismatch. An index printed only on an invoice ranks last and sets independent: false.

GET/v1/price-baseline/models/{id}/sheets

Query parameters

comparison_iduuidInvoice check whose period the workbook covers. It must belong to a version of this contract (422).
fromstringFirst month, YYYY-MM.
tostringLast month, YYYY-MM. With from, defaults to December of year.
yearintegerCalendar year to prepare when no invoice applies. Default: the last full year

Response fields

title / lang / currency / contract_keystringWorkbook identity. lang is de or en and follows the contract.
sheets[]arrayname, widths and rows of cells. A cell has v (value), role, f (Excel formula without the leading =), fmt, src and note.
sources[]arrayThe source rows cells point to: what, document_id, document, url, quote, verified, problem.
gaps[]string[]What keeps a cell from being filled, one line per cell.
open[]arrayThe open inputs, each with key, kind, question and options.
periodobjectfrom and to of the workbook.
expectedobjectWhat the customer should be billed: basis, net, vat, gross, complete, lines.
assumptions[]arrayThe assumptions the workbook rests on.

The period of the workbook follows fixed rules. Without from, it is the period of the invoice check named by comparison_id, else of the contract's newest invoice check (the newest of year when year is given); with no check it is the calendar year year. With from, it is from to to. Without an invoice, expected.basis is plan: the agreed quantity times each billed component's price, pro rata by month.

GET/v1/price-baseline/models/{id}/workbook.xlsx

Query parameters

fromstringFirst month, YYYY-MM.
tostringLast month, YYYY-MM.
comparison_iduuidInvoice check whose period the workbook covers.
yearintegerCalendar year to prepare when no invoice applies.

cURL: Download the workbook for an invoice check

curl -OJ "https://api.talonic.com/v1/price-baseline/models/7b1f0a52-3c9d-4e08-a6d4-51c2e8f7b3a9/workbook.xlsx?comparison_id=e04a9b17-6d28-47c5-b3f1-9c5e2a8d7016" \
  -H "Authorization: Bearer $TALONIC_API_KEY"
GET/v1/price-baseline/models/{id}/emissions

Query parameters

yearintegerCalendar year. Default: the last full year

Response fields (inside data)

components[]arrayEU ETS components in force in the year, with the version that prices them.
clauseobject | nullWhat the clause says about the pass-through: full_cost, auction_price, free_allocation, prior_year_instalments, planned_t, quotes.
installationobject | nullThe matched installation with its years of verified emissions; null when none matched. certain is true when postcode, street and house number agree and nothing else comes close.
candidates[]arrayThe other installations at the postcode, best first.
costobject | nullThe expected CO2 cost of the year: settlement, instalments, tier (owed or estimated), why.
missing[]string[]Why no cost could be computed, when it could not.
When no version in force in the year prices an EU ETS component, no postcode is printed, or no installation matches, the relevant fields are empty and missing says why. An empty emissions view is a statement about the data, not an error.

Frequently asked questions

Why does a price have a status other than ok?+
A price is computed only from sourced numbers. missing_value means a contract value has no verified quote; missing_index means no index value is stored for the reference months; rebase_mismatch means the base-year months needed to rebase an index are not all stored; unit_mismatch means the units cannot be converted; custom_reference and formula_error flag a wording the engine cannot evaluate or a formula that fails.
Which period does the workbook cover?+
With from, the period from to to. Without it, the period of the invoice check named by comparison_id, else of the contract's newest invoice check, else the calendar year given by year (default: the last full year). With no invoice the expected amount is a plan built from the agreed quantities.
Why can the register show slightly older rows?+
The register is cached per workspace and year. A request during a rebuild may receive the last built rows rather than waiting. Use inputs=0 to leave out the per-contract input lists when only the totals are needed.
Does the workbook language follow my request?+
No. Labels follow the contract's language, reported as lang (de or en), not the caller's. The same grid is used by the xlsx download, so the file and the JSON always agree.