Read Inspection

GET /reports/inspections/:id

Path parameters

  • id: The created timestamp of the Inspection you want to see.

Status codes

  • 200 on success
  • 404 if the inspection was not found

Response properties

The response format is JSON with the following properties:

  • url: The URL where the report can be accessed.

Example response:

{
  "url": "https://s3.eu-central-1.amazonaws.com/exports.yourbarmate.com/c6a61b00-178f-4604-a51b-927cb9b4e302/report-1730205514020.json?..."
}

The report is generated fresh every time you request it.

Report

The report data is JSON with the following properties:

  • created: The created timestamp of the inspection.
  • area_id: Area ID of the inspection.
  • location: The site or location where the area is located. (optional)
    • id: The id of the location.
    • name: Location name.
    • cost_center: Cost center associated with the location. (optional)
  • state: The state of the inspection (see below for details).
  • name: The user provided name of the inspection.
  • counted_items: The number of counted items in all inspection lists.
  • total_items: The number of total items in all inspection lists.
  • lists: An array of objects representing the inspection lists.
    • inspection_list_id: The ID of the inspection list.
    • area_inspection_list_id: The ID of the inspection list association with the area.
    • name: The user provided name of the inspection list.
    • counted_items: The number of counted items in the list.
    • total_items: The number of total items in the list.
    • counts: An object describing how items where counted.
      • groups: An array of groups in the inspection list.
        • id: The group ID.
        • name: The name of the group.
        • entries: The entries in the group (same format as the other entries array below).
      • other: An array of entries that are not in a group.
        • id: The entry ID.
        • item: The item ID.
        • counts: An array of counts for the item.
          • count: The counted vessels. Can be a decimal number.
          • bundle: The bundle (see "Bundles" in Items). (optional)
        • fractions: An array of fractions for the item. (optional)
          • amount: The counted fraction amount.
          • unit: The unit of the fraction. One of l, dl, cl, ml, kg, g, quantity or percent.
    • history: An array of history entries.
      • idempotency: The idempotency key of the history entry.
      • created: The created timestamp of the history entry.
      • type: The type of the history entry, one of REPORT_CREATE or REPORT_AMEND.
    • summary: An object with the report summaries.
      • total: The total value of the counted items in cents.
      • category: The summary by category. An array of objects with the following properties:
        • id: The ID of the category.
        • name: The default name of the category.
        • name_en: The name override of the category in English. (optional)
        • name_de: The name override of the category in German. (optional)
        • items: The number of counted items.
        • total: The total value of the counted items in cents.
      • account_code: The summary by account code. An array of objects with the following properties:
        • id: The account code, or '0' for "no account code".
        • items: The number of counted items.
        • total: The total value of the counted items in cents.
      • supplier: The summary by supplier. An array of objects with the following properties:
        • id: The supplier ID, or 0 for "no supplier".
        • name: The name of the supplier.
        • items: The number of counted items.
        • total: The total value of the counted items in cents.
    • stock: An array of stock entries.
      • item: The expanded item data as described in GET /items/:id.
      • lists: An array of area inspection list IDs where the item was counted.
      • summary: The summary object of the stock (see "Stock" below).
      • queue: The stock queue array (see "Stock" below).
Inspection state

The state object of an inspection entry always has a status property. The status can be one of the following:

  • COMPLETED: The inspection is completed. No additional properties.
  • PROCESSED: The inspection was processed with pending differences. The differences property will be present and reflect the number of pending differences.
  • PROCESSING: The inspection is being processed. If an error occurs during processing, the error property will be present with the timestamp when the error occurred.
Stock

The stock is represented as a queue containing counts at different price points. Counts are represented in both human readable and normalised values.

Each stock queue item contains the following properties:

  • count: The count of full vessels.
  • ml: The fraction in g / ml / pieces, depending on the vessel unit. (optional)
  • fraction: The fraction expressed in a human readable format showing how it was counted. (optional)
    • amount: Fraction amount
    • unit: Fraction unit, one of g / l / dl / cl / ml / kg / quantity / percent
  • normalised: The weight / volume / count of the item. Depending on the vessel, it is in g , ml or pieces.
  • price: The price of one vessel in cents (1250 = €12.50).
  • total: The total value in cents.

Example:

For an item with vessel of 1kg.

[
  {
    "price": 3150,
    "value": 31500,
    "count": 10,
    "normalised": 10000
  },
  {
    "price": 3120,
    "value": 105300,
    "count": 33,
    "ml": 750,
    "fraction": { "amount": 750, "unit": "g" },
    "normalised": 33750
  }
]