Hilfe - Alle Produkte & Anleitungen

Examples

This page shows typical requests against the Public API. The examples cover almost all available operations: read queries as well as the asynchronous pushing of orders and payments.

The IDs and amounts used here are placeholders; replace <your-api-token> with your token. For the basics of authentication, pagination and time zones, see Getting Started.

Querying Sales Point closings

Shifts (Sales Point closings) can be filtered by Sales Point and period:

Bash
curl -H "Authorization: Token <your-api-token>" \
  "https://api.diekasse.app/v1/public/shifts/?sales_point=450e8400-e29b-41d4-a716-446655440001&timestamp__gte=2026-06-01T00:00:00Z&timestamp__lte=2026-06-30T23:59:59Z"
JSON
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "sales_point": "450e8400-e29b-41d4-a716-446655440001",
      "started": "2026-06-15T09:00:00Z",
      "started_by_username": "cashier_001",
      "ended": "2026-06-15T17:30:00Z",
      "ended_by_username": "cashier_001",
      "timestamp": "2026-06-15T17:30:00Z"
    }
  ]
}

For background on this process, see Sales Point Closing.

Querying an invoice with its orders and line items

A payment (invoice) returns key data and the payment items:

Bash
curl -H "Authorization: Token <your-api-token>" \
  "https://api.diekasse.app/v1/public/payments/650e8400-e29b-41d4-a716-446655440006/"
JSON
{
  "id": "650e8400-e29b-41d4-a716-446655440006",
  "sales_point": "450e8400-e29b-41d4-a716-446655440001",
  "type": "CARD",
  "sequential_id": 1234,
  "timestamp": "2026-06-15T15:30:00Z",
  "items": [
    { "method_name": "VISA", "method_type": "CARD", "gross_price": "19.99", "tip": "1.00", "currency": "EUR" }
  ],
  "metadata": { "gross": "19.99", "net": "16.80", "vat": "3.19" }
}

Retrieve the associated orders including their line items via the payment filter:

Bash
curl -H "Authorization: Token <your-api-token>" \
  "https://api.diekasse.app/v1/public/orders/?payment=650e8400-e29b-41d4-a716-446655440006"
JSON
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440010",
      "payment": "650e8400-e29b-41d4-a716-446655440006",
      "order_group_name": "Table 5",
      "items": [
        { "article_name": "Espresso", "quantity": 2.0, "gross_price": "5.00", "vat_rate": "20.00" }
      ],
      "metadata": { "gross": "5.00", "net": "4.17", "vat": "0.83" }
    }
  ]
}

Querying reports

Turnover reports expect a period and a Sales Point:

Bash
curl -H "Authorization: Token <your-api-token>" \
  "https://api.diekasse.app/v1/public/reports/turnover/venue/?sales_point=450e8400-e29b-41d4-a716-446655440001&start=2026-06-01T00:00:00Z&end=2026-06-30T23:59:59Z"
JSON
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "name": "Main location",
      "net": "5234.56",
      "vat": "1046.91",
      "gross": "6281.47",
      "methods": [
        { "name": "VISA", "method_type": "CARD", "gross": "3650.00", "count": 45 },
        { "name": "Cash", "method_type": "CASH", "gross": "2631.47", "count": 112 }
      ]
    }
  ]
}

For an overview of the analyses in the interface, see Reports on the Sales Point.

Querying stock levels

The current stock level is returned per article and warehouse:

Bash
curl -H "Authorization: Token <your-api-token>" \
  "https://api.diekasse.app/v1/public/stock-transactions/latest/?warehouse=150e8400-e29b-41d4-a716-446655440002"
JSON
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "article_name": "Espresso beans 1 kg",
      "warehouse_name": "Main warehouse",
      "quantity": "45.5",
      "quantity_unit": "kg",
      "updated": "2026-06-15T10:00:00Z"
    }
  ]
}

For more on stock handling, see Inventory Management.

Pushing an order (asynchronous)

An order is submitted as a job:

Bash
curl -X POST -H "Authorization: Token <your-api-token>" -H "Content-Type: application/json" \
  "https://api.diekasse.app/v1/public/requests/orders/" \
  -d '{
    "sales_point": "450e8400-e29b-41d4-a716-446655440001",
    "order_group_type": "TABLE",
    "order_group_nr": 5,
    "items": [
      { "article": "050e8400-e29b-41d4-a716-446655440005", "quantity": 1.0, "price": "2.50" }
    ]
  }'

The response contains the job ID; processing happens asynchronously:

JSON
{
  "id": "770e8400-e29b-41d4-a716-446655440020",
  "type": "ORDER",
  "sales_point": "450e8400-e29b-41d4-a716-446655440001",
  "created": "2026-06-15T15:35:00Z",
  "received": null,
  "processed": null,
  "success": null,
  "result": null
}

Query the status afterwards via GET /v1/public/requests/orders/<id>/. received and processed are set once the Sales Point has received and processed the job; success (true/false) and result contain the outcome.

Pushing a payment (asynchronous)

A payment for an open order group is submitted in the same way:

Bash
curl -X POST -H "Authorization: Token <your-api-token>" -H "Content-Type: application/json" \
  "https://api.diekasse.app/v1/public/requests/payment/" \
  -d '{
    "sales_point": "450e8400-e29b-41d4-a716-446655440001",
    "payment": {
      "open_order_group": "250e8400-e29b-41d4-a716-446655440007",
      "payments": [
        { "method": "550e8400-e29b-41d4-a716-446655440008", "value": "5.95", "tip": "0.50", "currency": "EUR" }
      ]
    }
  }'
JSON
{
  "id": "880e8400-e29b-41d4-a716-446655440030",
  "type": "PAYMENT",
  "sales_point": "450e8400-e29b-41d4-a716-446655440001",
  "created": "2026-06-15T15:40:00Z",
  "received": null,
  "processed": null,
  "success": null,
  "result": null
}

To cancel a payment, use POST /v1/public/requests/payment-cancel/ with the Sales Point and the payment ID:

JSON
{
  "sales_point": "450e8400-e29b-41d4-a716-446655440001",
  "payment": "650e8400-e29b-41d4-a716-446655440006"
}

As with pushing, the status is queried via the respective GET .../requests/.../<id>/ endpoint.