stabisoDocs

API reference

Till

Till: a shop's tills selling from a warehouse's stock at prices that include VAT, paid in cash or by card (the goods leave the stock with each sale), and the daily Z-report that counts the cash and books the day: its invoice to the walk-in customer, the cash and card receipts and any cash difference.

Operation Summary Scope Idempotency-Key
GET /v1/till-days/{day_id} Get a Z-report read
POST /v1/till-days/{day_id}/book Book a Z-report draft
GET /v1/till-days/{day_id}/pdf Print a Z-report read
GET /v1/till-sales/{sale_id} Get a till sale read
GET /v1/till-sales/{sale_id}/receipt Print a till sale's receipt read
POST /v1/till-sales/{sale_id}/send E-mail a receipt draft required
GET /v1/tills List tills read
POST /v1/tills Add a till draft required
GET /v1/tills/{till_id} Get a till read
PATCH /v1/tills/{till_id} Change a till draft
GET /v1/tills/{till_id}/days List Z-reports read
POST /v1/tills/{till_id}/days Close a till's day draft required
GET /v1/tills/{till_id}/sales List till sales read
POST /v1/tills/{till_id}/sales Sell at a till draft required
GET /v1/tills/{till_id}/shelf List what a till sells read
PUT /v1/tills/{till_id}/shelf/{product}/price Price a product on a till's shelf draft

GET /v1/till-days/{day_id}

Get a Z-report

One Z-report with its takings by VAT rate and what booked them.

Required scope read (admin implies every scope)
Operation id get_day_v1_till_days__day_id__get

Parameters

In Name Type Required Description
path day_id string (uuid) yes Id of the Z-report.

Example request

curl "$ERP_URL/v1/till-days/{day_id}" \
  -H "Authorization: Bearer $ERP_KEY"

Responses

Status Meaning Body
200 OK TillDayOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "number": "string",
  "till": "string",
  "till_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "till_name": "",
  "currency": "",
  "day": "2026-09-21",
  "sales": 1,
  "total": "string",
  "cash_sales": "string",
  "card_sales": "string",
  "rounding": "0.00",
  "cash_float": "string",
  "counted_cash": "string",
  "expected_cash": "string",
  "difference": "string",
  "by_rate": [
    {}
  ],
  "status": "booked",
  "invoice": "string",
  "invoice_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "invoice_total": "string",
  "difference_entry_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "problem": "string",
  "closed_by": {},
  "closed_at": "2026-09-21T09:30:00Z",
  "booked_at": "2026-09-21T09:30:00Z"
}

POST /v1/till-days/{day_id}/book

Book a Z-report

Book a waiting Z-report now rather than at the next scheduled job; it stays waiting, with its problem, while it cannot be.

Required scope draft (admin implies every scope)
Idempotency-Key not used
Operation id book_day_v1_till_days__day_id__book_post

Parameters

In Name Type Required Description
path day_id string (uuid) yes Id of the Z-report.

Example request

curl -X POST "$ERP_URL/v1/till-days/{day_id}/book" \
  -H "Authorization: Bearer $ERP_KEY"

Responses

Status Meaning Body
200 OK TillDayOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
409 The request conflicts with the data: an Idempotency-Key reused with a different request, a closed period, or an integrity rule of the database (conflict, integrity_violation). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "number": "string",
  "till": "string",
  "till_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "till_name": "",
  "currency": "",
  "day": "2026-09-21",
  "sales": 1,
  "total": "string",
  "cash_sales": "string",
  "card_sales": "string",
  "rounding": "0.00",
  "cash_float": "string",
  "counted_cash": "string",
  "expected_cash": "string",
  "difference": "string",
  "by_rate": [
    {}
  ],
  "status": "booked",
  "invoice": "string",
  "invoice_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "invoice_total": "string",
  "difference_entry_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "problem": "string",
  "closed_by": {},
  "closed_at": "2026-09-21T09:30:00Z",
  "booked_at": "2026-09-21T09:30:00Z"
}

GET /v1/till-days/{day_id}/pdf

Print a Z-report

The Z-report as a PDF in the company's language: the day's sales and takings in cash and by card (with the rounding of the cash to the coin), the cash drawer (float, expected, counted, difference), the takings by tax rate and the invoice that booked them. The header X-Content-SHA256 carries its SHA-256.

Required scope read (admin implies every scope)
Operation id get_day_pdf_v1_till_days__day_id__pdf_get

Parameters

In Name Type Required Description
path day_id string (uuid) yes Id of the Z-report.
query download boolean true sends the file as an attachment; false inline. (default false)

Example request

curl "$ERP_URL/v1/till-days/{day_id}/pdf" \
  -H "Authorization: Bearer $ERP_KEY"

Responses

Status Meaning Body
200 The PDF. application/pdf
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

GET /v1/till-sales/{sale_id}

Get a till sale

One sale, as the receipt shows it.

Required scope read (admin implies every scope)
Operation id get_sale_v1_till_sales__sale_id__get

Parameters

In Name Type Required Description
path sale_id string (uuid) yes Id of the sale.

Example request

curl "$ERP_URL/v1/till-sales/{sale_id}" \
  -H "Authorization: Bearer $ERP_KEY"

Responses

Status Meaning Body
200 OK SaleOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "number": "string",
  "till": "string",
  "day": "2026-09-21",
  "sold_at": "2026-09-21T09:30:00Z",
  "paid_by": "card",
  "lines": [
    {
      "product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "code": "string",
      "name": "string",
      "quantity": "string",
      "unit_price": "string",
      "amount": "string",
      "rate_type": "string",
      "rate": "string"
    }
  ],
  "total": "string",
  "cash_given": "string",
  "change": "string",
  "rounding": "0.00",
  "stock_posting": "string",
  "z_report": "string",
  "created_by": {}
}

GET /v1/till-sales/{sale_id}/receipt

Print a till sale's receipt

The sale's receipt as a PDF in the company's language: what was sold at the prices paid, the tax in them by rate (in the US the tax added to the prices), how it was paid and, in cash, the rounding to the coin, the cash given and the change. The header X-Content-SHA256 carries its SHA-256.

Required scope read (admin implies every scope)
Operation id get_receipt_v1_till_sales__sale_id__receipt_get

Parameters

In Name Type Required Description
path sale_id string (uuid) yes Id of the sale.
query download boolean true sends the file as an attachment; false inline. (default false)

Example request

curl "$ERP_URL/v1/till-sales/{sale_id}/receipt" \
  -H "Authorization: Bearer $ERP_KEY"

Responses

Status Meaning Body
200 The PDF. application/pdf
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

POST /v1/till-sales/{sale_id}/send

E-mail a receipt

E-mail the sale's receipt (the PDF) to the address the customer gives, within the organization's hourly limit of messages. Only a person sends (an agent key answers 403). 409 in a test copy or when this server has no mail server (receipts_by_email of the till says so beforehand: print it instead); 422 for an address that is none; 429 beyond the hourly limit; 502 when the mail server refuses. Needs an Idempotency-Key.

Required scope draft (admin implies every scope)
Idempotency-Key required
Operation id send_receipt_v1_till_sales__sale_id__send_post

Parameters

In Name Type Required Description
path sale_id string (uuid) yes Id of the sale.

Request body

application/json (required): ReceiptSendInput

Field Type Required Description
to string yes The e-mail address the customer gave for the receipt. (min length 3; max length 254)

Example request

curl -X POST "$ERP_URL/v1/till-sales/{sale_id}/send" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "to": "anna@example.com"
}'

Responses

Status Meaning Body
200 OK SaleOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
409 The request conflicts with the data: an Idempotency-Key reused with a different request, a closed period, or an integrity rule of the database (conflict, integrity_violation). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError
429 A per-organization limit was reached, e.g. messages sent per hour (rate_limited, with retry_after_seconds). ErrorEnvelope

Example response (shape)

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "number": "string",
  "till": "string",
  "day": "2026-09-21",
  "sold_at": "2026-09-21T09:30:00Z",
  "paid_by": "card",
  "lines": [
    {
      "product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "code": "string",
      "name": "string",
      "quantity": "string",
      "unit_price": "string",
      "amount": "string",
      "rate_type": "string",
      "rate": "string"
    }
  ],
  "total": "string",
  "cash_given": "string",
  "change": "string",
  "rounding": "0.00",
  "stock_posting": "string",
  "z_report": "string",
  "created_by": {}
}

GET /v1/tills

List tills

The tills by entity and code, with the warehouse they sell from, their float and what their open sales took in, in cash and by card.

Required scope read (admin implies every scope)
Operation id list_tills_v1_tills_get

Parameters

In Name Type Required Description
query entity string or null Only this entity's (code or id).
query active boolean or null Only those in use (or not).

Example request

curl "$ERP_URL/v1/tills" \
  -H "Authorization: Bearer $ERP_KEY"

Responses

Status Meaning Body
200 OK array of TillOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entity": "string",
    "code": "string",
    "name": "string",
    "warehouse": "string",
    "warehouse_name": "string",
    "customer": "string",
    "currency": "string",
    "cash_float": "string",
    "active": true,
    "open_sales": 1,
    "open_total": "string",
    "open_cash": "string",
    "open_card": "string",
    "open_since": "2026-09-21",
    "cash_step": "string",
    "closed_today": "string",
    "receipts_by_email": false,
    "created_by": {},
    "created_at": "2026-09-21T09:30:00Z"
  }
]

POST /v1/tills

Add a till

A till for a shop, by its name: it sells from the entity's default warehouse (or the one named), in the functional currency, to the company's walk-in customer (Shop customers, made with the first till). The accounts its takings book to are added from the chart when the company lacks them: the cash on hand, the card acquirer's balance and the cash differences. Nothing is posted. Needs an Idempotency-Key.

Required scope draft (admin implies every scope)
Idempotency-Key required
Operation id create_till_v1_tills_post

Request body

application/json (required): TillInput

Field Type Required Description
entity string yes Code (or id) of the entity whose shop it is. (min length 1)
name string yes What the till is called: Shop Bahnhofstrasse. (min length 1; max length 100)
warehouse string or null Code (or id) of the warehouse whose stock it sells (the shop); omitted: the entity's default warehouse.
cash_float decimal string or null The cash left in the drawer for change after each day, counted with the takings at the Z-report. Omitted: 0. (min 0)

Example request

curl -X POST "$ERP_URL/v1/tills" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "entity": "CH01",
  "name": "Shop Bahnhofstrasse"
}'

Responses

Status Meaning Body
201 Created TillOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
409 The request conflicts with the data: an Idempotency-Key reused with a different request, a closed period, or an integrity rule of the database (conflict, integrity_violation). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "entity": "string",
  "code": "string",
  "name": "string",
  "warehouse": "string",
  "warehouse_name": "string",
  "customer": "string",
  "currency": "string",
  "cash_float": "string",
  "active": true,
  "open_sales": 1,
  "open_total": "string",
  "open_cash": "string",
  "open_card": "string",
  "open_since": "2026-09-21",
  "cash_step": "string",
  "closed_today": "string",
  "receipts_by_email": false,
  "created_by": {},
  "created_at": "2026-09-21T09:30:00Z"
}

GET /v1/tills/{till_id}

Get a till

The till with what its open sales took in.

Required scope read (admin implies every scope)
Operation id get_till_v1_tills__till_id__get

Parameters

In Name Type Required Description
path till_id string (uuid) yes Id of the till (GET /v1/tills).

Example request

curl "$ERP_URL/v1/tills/{till_id}" \
  -H "Authorization: Bearer $ERP_KEY"

Responses

Status Meaning Body
200 OK TillOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "entity": "string",
  "code": "string",
  "name": "string",
  "warehouse": "string",
  "warehouse_name": "string",
  "customer": "string",
  "currency": "string",
  "cash_float": "string",
  "active": true,
  "open_sales": 1,
  "open_total": "string",
  "open_cash": "string",
  "open_card": "string",
  "open_since": "2026-09-21",
  "cash_step": "string",
  "closed_today": "string",
  "receipts_by_email": false,
  "created_by": {},
  "created_at": "2026-09-21T09:30:00Z"
}

PATCH /v1/tills/{till_id}

Change a till

Rename it, set its float, or take it out of use (active: false): it then sells no more, and its days stay.

Required scope draft (admin implies every scope)
Idempotency-Key not used
Operation id update_till_v1_tills__till_id__patch

Parameters

In Name Type Required Description
path till_id string (uuid) yes Id of the till (GET /v1/tills).

Request body

application/json (required): TillUpdate

Field Type Required Description
name string or null Its name. (min length 1; max length 100)
cash_float decimal string or null The cash left in the drawer for change after each day, counted with the takings at the Z-report. (min 0)
active boolean or null false: the till sells no more (its days stay).

Example request

curl -X PATCH "$ERP_URL/v1/tills/{till_id}" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "cash_float": "200.00"
}'

Responses

Status Meaning Body
200 OK TillOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
409 The request conflicts with the data: an Idempotency-Key reused with a different request, a closed period, or an integrity rule of the database (conflict, integrity_violation). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "entity": "string",
  "code": "string",
  "name": "string",
  "warehouse": "string",
  "warehouse_name": "string",
  "customer": "string",
  "currency": "string",
  "cash_float": "string",
  "active": true,
  "open_sales": 1,
  "open_total": "string",
  "open_cash": "string",
  "open_card": "string",
  "open_since": "2026-09-21",
  "cash_step": "string",
  "closed_today": "string",
  "receipts_by_email": false,
  "created_by": {},
  "created_at": "2026-09-21T09:30:00Z"
}

GET /v1/tills/{till_id}/days

List Z-reports

The till's Z-reports, newest first.

Required scope read (admin implies every scope)
Operation id list_days_v1_tills__till_id__days_get

Parameters

In Name Type Required Description
path till_id string (uuid) yes Id of the till (GET /v1/tills).
query limit integer How many, newest first. (min 1; max 1000; default 100)

Example request

curl "$ERP_URL/v1/tills/{till_id}/days" \
  -H "Authorization: Bearer $ERP_KEY"

Responses

Status Meaning Body
200 OK array of TillDayOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "number": "string",
    "till": "string",
    "till_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "till_name": "",
    "currency": "",
    "day": "2026-09-21",
    "sales": 1,
    "total": "string",
    "cash_sales": "string",
    "card_sales": "string",
    "rounding": "0.00",
    "cash_float": "string",
    "counted_cash": "string",
    "expected_cash": "string",
    "difference": "string",
    "by_rate": [
      {}
    ],
    "status": "booked",
    "invoice": "string",
    "invoice_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "invoice_total": "string",
    "difference_entry_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "problem": "string",
    "closed_by": {},
    "closed_at": "2026-09-21T09:30:00Z",
    "booked_at": "2026-09-21T09:30:00Z"
  }
]

POST /v1/tills/{till_id}/days

Close a till's day

The Z-report: the cash counted against the float plus the cash takings, and the difference. It closes the day's open sales and books them: the day's invoice to the walk-in customer (VAT as for every sale), its receipts into the cash on hand and the card acquirer's balance, and the difference against the cash differences account. While the invoice waits for approval the report is waiting, and the scheduled jobs book it then. 409 (till_day_open_before) while an earlier day has sales open; 409 (till_day_closed) when the day is closed. Needs an Idempotency-Key.

Required scope draft (admin implies every scope)
Idempotency-Key required
Operation id close_day_v1_tills__till_id__days_post

Parameters

In Name Type Required Description
path till_id string (uuid) yes Id of the till (GET /v1/tills).

Request body

application/json (required): TillDayInput

Field Type Required Description
counted_cash decimal string yes All the cash in the drawer when the day closes, float included. (min 0)
day string (date) or null The day to close; omitted: the oldest day with sales still open, else today. Its open sales are closed; sales of a later day stay open.

Example request

curl -X POST "$ERP_URL/v1/tills/{till_id}/days" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "counted_cash": "1432.50"
}'

Responses

Status Meaning Body
201 Created TillDayOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
409 The request conflicts with the data: an Idempotency-Key reused with a different request, a closed period, or an integrity rule of the database (conflict, integrity_violation). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "number": "string",
  "till": "string",
  "till_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "till_name": "",
  "currency": "",
  "day": "2026-09-21",
  "sales": 1,
  "total": "string",
  "cash_sales": "string",
  "card_sales": "string",
  "rounding": "0.00",
  "cash_float": "string",
  "counted_cash": "string",
  "expected_cash": "string",
  "difference": "string",
  "by_rate": [
    {}
  ],
  "status": "booked",
  "invoice": "string",
  "invoice_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "invoice_total": "string",
  "difference_entry_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "problem": "string",
  "closed_by": {},
  "closed_at": "2026-09-21T09:30:00Z",
  "booked_at": "2026-09-21T09:30:00Z"
}

GET /v1/tills/{till_id}/sales

List till sales

The till's sales with their lines, payment, stock posting and Z-report.

Required scope read (admin implies every scope)
Operation id list_sales_v1_tills__till_id__sales_get

Parameters

In Name Type Required Description
path till_id string (uuid) yes Id of the till (GET /v1/tills).
query open boolean Only those no Z-report closed yet, oldest first. (default false)
query z_report string (uuid) or null Only those this Z-report closed (its id), newest first.
query limit integer How many, newest first. (min 1; max 5000; default 200)

Example request

curl "$ERP_URL/v1/tills/{till_id}/sales" \
  -H "Authorization: Bearer $ERP_KEY"

Responses

Status Meaning Body
200 OK array of SaleOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "number": "string",
    "till": "string",
    "day": "2026-09-21",
    "sold_at": "2026-09-21T09:30:00Z",
    "paid_by": "card",
    "lines": [
      {
        "product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "code": "string",
        "name": "string",
        "quantity": "string",
        "unit_price": "string",
        "amount": "string",
        "rate_type": "string",
        "rate": "string"
      }
    ],
    "total": "string",
    "cash_given": "string",
    "change": "string",
    "rounding": "0.00",
    "stock_posting": "string",
    "z_report": "string",
    "created_by": {}
  }
]

POST /v1/tills/{till_id}/sales

Sell at a till

Ring up a sale today: each line at its shelf price (the list price plus VAT) or the price given, paid in cash (with the change to give) or by card. Its goods kept in stock leave the till's warehouse at once at moving average cost; 409 (not_enough_stock) when they are not on hand, and nothing is sold. 409 (till_day_closed) once today's Z-report closed the till. The takings are booked by the Z-report. Needs an Idempotency-Key.

Required scope draft (admin implies every scope)
Idempotency-Key required
Operation id sell_v1_tills__till_id__sales_post

Parameters

In Name Type Required Description
path till_id string (uuid) yes Id of the till (GET /v1/tills).

Request body

application/json (required): SaleInput

Field Type Required Description
lines array of SaleLineInput yes What is sold, at least one line. (min items 1; max items 200)
paid_by "card" | "cash" yes cash or card.
cash_given decimal string or null Cash only: what the customer handed over, to give the change; omitted: exactly the total (in cash, rounded to the till's cash_step). (greater than 0)

Example request

curl -X POST "$ERP_URL/v1/tills/{till_id}/sales" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "lines": [
    {
      "product": "MUG"
    },
    {
      "product": "TEA",
      "quantity": 2
    }
  ],
  "paid_by": "card"
}'

Responses

Status Meaning Body
201 Created SaleOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
409 The request conflicts with the data: an Idempotency-Key reused with a different request, a closed period, or an integrity rule of the database (conflict, integrity_violation). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "number": "string",
  "till": "string",
  "day": "2026-09-21",
  "sold_at": "2026-09-21T09:30:00Z",
  "paid_by": "card",
  "lines": [
    {
      "product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "code": "string",
      "name": "string",
      "quantity": "string",
      "unit_price": "string",
      "amount": "string",
      "rate_type": "string",
      "rate": "string"
    }
  ],
  "total": "string",
  "cash_given": "string",
  "change": "string",
  "rounding": "0.00",
  "stock_posting": "string",
  "z_report": "string",
  "created_by": {}
}

GET /v1/tills/{till_id}/shelf

List what a till sells

The products sold by the piece with their shelf price today (the list price plus VAT) and how many the till's warehouse holds.

Required scope read (admin implies every scope)
Operation id list_shelf_v1_tills__till_id__shelf_get

Parameters

In Name Type Required Description
path till_id string (uuid) yes Id of the till (GET /v1/tills).
query search string or null Only products whose code or name holds it. (max length 100)
query limit integer How many, by code. (min 1; max 500; default 50)

Example request

curl "$ERP_URL/v1/tills/{till_id}/shelf" \
  -H "Authorization: Bearer $ERP_KEY"

Responses

Status Meaning Body
200 OK array of ShelfItemOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

[
  {
    "product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "code": "string",
    "name": "string",
    "unit": "string",
    "unit_price": "string",
    "list_price": "string",
    "rate_type": "string",
    "rate": "string",
    "on_hand": "string",
    "price_from": "2026-09-21"
  }
]

PUT /v1/tills/{till_id}/shelf/{product}/price

Price a product on a till's shelf

Give a product the price the shelf shows, from today: with VAT in a VAT country (a round 5.00, kept as the list price before VAT that gives it to the cent: 4.625 at 8.1 %), before tax where sales tax is added at the end (the US). It is the product's list price in the till's currency from today on. 409 (product_price_exists) when the product has a price from today already; 422 (till_not_on_shelf) for a product the till does not sell (a service).

Required scope draft (admin implies every scope)
Idempotency-Key not used
Operation id set_shelf_price_v1_tills__till_id__shelf__product__price_put

Parameters

In Name Type Required Description
path till_id string (uuid) yes Id of the till (GET /v1/tills).
path product string yes Code (or id) of the product.

Request body

application/json (required): ShelfPriceInput

Field Type Required Description
price decimal string yes The price of one as the shelf shows it, from today: with VAT in a VAT country (kept as the list price before VAT that gives it to the cent), before tax where sales tax is added at the end (the US). (greater than 0)

Example request

curl -X PUT "$ERP_URL/v1/tills/{till_id}/shelf/MUG/price" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "price": "5.00"
}'

Responses

Status Meaning Body
200 OK ShelfItemOut
401 Missing or invalid API key (unauthorized). ErrorEnvelope
403 The caller lacks the required scope (missing_right, with scope), the key belongs to no person where a person is needed (forbidden), or the approval policy denies the action (policy_denied, with action and rule_id). ErrorEnvelope
404 The resource does not exist, or belongs to another organization (not_found). ErrorEnvelope
409 The request conflicts with the data: an Idempotency-Key reused with a different request, a closed period, or an integrity rule of the database (conflict, integrity_violation). ErrorEnvelope
422 Validation failed: the error envelope (validation_failed). For a malformed body or parameter its message is in sentences ("Line 2: the quantity must be above zero") and fields lists each error with pydantic's loc, type and msg beside its sentence (message) and its parts, to word it in another language: items (name and number from 1: line 2), field (its name as sent) and the rule it breaks with its limit, count and choices (none for a validator's own sentence); FastAPI's own detail list stays beside the envelope. HTTPValidationError

Example response (shape)

{
  "product_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "code": "string",
  "name": "string",
  "unit": "string",
  "unit_price": "string",
  "list_price": "string",
  "rate_type": "string",
  "rate": "string",
  "on_hand": "string",
  "price_from": "2026-09-21"
}

Schemas

ReceiptSendInput

Field Type Required Description
to string yes The e-mail address the customer gave for the receipt. (min length 3; max length 254)

SaleInput

Field Type Required Description
lines array of SaleLineInput yes What is sold, at least one line. (min items 1; max items 200)
paid_by "card" | "cash" yes cash or card.
cash_given decimal string or null Cash only: what the customer handed over, to give the change; omitted: exactly the total (in cash, rounded to the till's cash_step). (greater than 0)

SaleLineInput

Field Type Required Description
product string yes Code (or id) of the product sold.
quantity decimal string How many; default 1. (greater than 0; default "1")
unit_price decimal string or null The price of one as the shelf shows it, when it is not the shelf price (a discount): VAT included where VAT is in the price, before tax where sales tax is added (US); omitted: the product's list price on the day (plus its VAT where VAT is in the price). (min 0)

SaleLineOut

Field Type Required Description
product_id string (uuid) yes Id of the product.
code string yes Product code.
name string yes Product name.
quantity string yes How many.
unit_price string yes Price of one as the shelf shows it: VAT included, or before tax where sales tax is added (US; the line's amount is then its net plus the tax of that net).
amount string yes The line's amount, VAT included.
rate_type string yes The VAT rate type of the product.
rate string yes Its VAT rate on the day, in percent.

SaleOut

Field Type Required Description
id string (uuid) yes Id of the sale.
number string yes TS-2026-000001, gap-free per entity and year.
till string yes Code of the till.
day string (date) yes The day it was sold, where the company is.
sold_at string (date-time) yes When (UTC).
paid_by "card" | "cash" yes cash or card.
lines array of SaleLineOut yes What was sold.
total string yes What it came to, VAT included.
cash_given string or null yes Cash handed over; null: by card.
change string or null yes Change given back; null: by card.
rounding string In cash, the total's rounding to the till's cash_step (the cash taken is the total plus it); by card 0. (default "0.00")
stock_posting string or null yes Number of the stock posting that took the goods out; null: nothing kept in stock was sold.
z_report string or null yes Number of the Z-report that closed it; null: open.
created_by object yes Who sold it.

ShelfItemOut

Field Type Required Description
product_id string (uuid) yes Id of the product.
code string yes Product code.
name string yes Product name.
unit string yes What one is: piece, kg.
unit_price string or null yes The shelf price of one today, tax included; null: the till cannot sell it today (it has no list price in the till's currency, or no tax rate is known for it).
list_price string or null Its list price of one today, before tax (what a US shop shows on the shelf); null with unit_price.
rate_type string yes The product's VAT rate type.
rate string yes The tax the day's invoice charges it, in percent of its net: the VAT rate, or in the US the sales tax of the shop's place on the part of the price its state taxes.
on_hand string or null yes How many are in the till's warehouse; null: not kept in stock (a service).
price_from string (date) or null Only in the answer to setting a price: the day the price set applies from (today, or tomorrow where the product already has a price from today, which is never changed); its unit_price and list_price are that price.

ShelfPriceInput

Field Type Required Description
price decimal string yes The price of one as the shelf shows it, from today: with VAT in a VAT country (kept as the list price before VAT that gives it to the cent), before tax where sales tax is added at the end (the US). (greater than 0)

TillDayInput

Field Type Required Description
counted_cash decimal string yes All the cash in the drawer when the day closes, float included. (min 0)
day string (date) or null The day to close; omitted: the oldest day with sales still open, else today. Its open sales are closed; sales of a later day stay open.

TillDayOut

Field Type Required Description
id string (uuid) yes Id of the Z-report.
number string yes Z-2026-000001, gap-free per entity and year.
till string yes Code of the till.
till_id string (uuid) or null Id of the till.
till_name string Name of the till. (default "")
currency string ISO 4217 code of its amounts (the till's). (default "")
day string (date) yes The day it closed.
sales integer yes How many sales it closed.
total string yes What they took in, VAT included.
cash_sales string yes What they took in cash, each sale rounded to the coin (Swiss cash to 5 Rappen); its invoice bills the sales to the cent and the rounding is a cash difference.
card_sales string yes What they took by card.
rounding string The rounding of the cash sales to the coin, in cash_sales (Swiss cash to 5 Rappen): the day's invoice bills the sales to the cent, so its total is total less this, and the rounding is booked to the cash differences. (default "0.00")
cash_float string yes The float the drawer held.
counted_cash string yes The cash counted, float included.
expected_cash string yes The float plus the cash takings.
difference string yes The cash counted less what was expected: below zero the drawer is short. Booked to the cash differences account.
by_rate array of object yes The day's sales by VAT rate, from its invoice once drafted: [{rate, net, vat, gross}].
status "booked" | "waiting" yes booked once the day's invoice, its receipts and the difference are posted or submitted; waiting while the invoice waits for approval or the walk-in customer for its activation (the scheduled jobs book it then).
invoice string or null yes Number (or id, before it posts) of the day's invoice.
invoice_id string (uuid) or null yes Id of the day's invoice.
invoice_total string or null The day's invoice's total: total less rounding; null before it is drafted.
difference_entry_id string (uuid) or null yes Id of the journal entry of the difference; null: none.
problem string or null yes Why it waits, in words; null when it does not.
closed_by object yes Who closed the day.
closed_at string (date-time) yes When (UTC).
booked_at string (date-time) or null yes When it was booked (UTC).

TillInput

Field Type Required Description
entity string yes Code (or id) of the entity whose shop it is. (min length 1)
name string yes What the till is called: Shop Bahnhofstrasse. (min length 1; max length 100)
warehouse string or null Code (or id) of the warehouse whose stock it sells (the shop); omitted: the entity's default warehouse.
cash_float decimal string or null The cash left in the drawer for change after each day, counted with the takings at the Z-report. Omitted: 0. (min 0)

TillOut

Field Type Required Description
id string (uuid) yes Id of the till.
entity string yes Entity code.
code string yes The till's code, made from its name.
name string yes Its name.
warehouse string yes Code of the warehouse whose stock it sells.
warehouse_name string yes Name of that warehouse (the shop).
customer string yes Code of the walk-in customer its days are invoiced to.
currency string yes ISO 4217 code of its prices (the functional currency).
cash_float string yes The cash left in the drawer for change after each day, counted with the takings at the Z-report.
active boolean yes Whether it sells.
open_sales integer yes Sales not closed by a Z-report yet.
open_total string yes What they took in, VAT included.
open_cash string yes What they took in cash (each sale to the coin).
open_card string yes What they took by card.
open_since string (date) or null yes The day of the oldest of them; null: none.
cash_step string or null The smallest coin a cash sale is paid to (0.05 in CHF: the total rounded half up, the change from that); null: to the cent. A card pays to the cent.
closed_today string or null Number of the Z-report that closed today where the company is: the till sells again tomorrow (409 till_day_closed); null: it sells today.
receipts_by_email boolean Whether a sale's receipt can be e-mailed from here (POST /v1/till-sales/{sale_id}/send): false while this server has no mail server, and in a test copy. It can always be printed (GET /v1/till-sales/{sale_id}/receipt). (default false)
created_by object yes Who added it.
created_at string (date-time) yes When (UTC).

TillUpdate

Field Type Required Description
name string or null Its name. (min length 1; max length 100)
cash_float decimal string or null The cash left in the drawer for change after each day, counted with the takings at the Z-report. (min 0)
active boolean or null false: the till sells no more (its days stay).
Stabiso, the Enterprise System of Record · generated from the code and its guides · release 3262ae655e81