> ## Documentation Index
> Fetch the complete documentation index at: https://docs.algure.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve counting

> Get a counting by its ID.



## OpenAPI

````yaml openapi-v1.json get /v1/countings/{counting_id}
openapi: 3.1.0
info:
  title: Algure API
  version: '1'
servers:
  - url: https://api.algure.com
    description: Algure Production Public API
security: []
paths:
  /v1/countings/{counting_id}:
    get:
      tags:
        - Countings
      summary: Retrieve counting
      description: Get a counting by its ID.
      operationId: retrieveCounting
      parameters:
        - name: counting_id
          in: path
          required: true
          schema:
            type: string
          description: The ID of the counting to retrieve
      responses:
        '200':
          description: The counting
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - startedAt
                  - endsAt
                  - warehouse
                  - active
                  - participants
                  - totalProducts
                  - totalProductsCounted
                  - totalProductsLeft
                  - totalDiscrepancies
                  - totalIncidents
                  - products
                properties:
                  id:
                    type: string
                  startedAt:
                    type: string
                    format: date-time
                    description: Counting start timestamp
                  endsAt:
                    type: string
                    format: date-time
                    description: Counting end timestamp (max. date)
                  warehouse:
                    type: object
                    required:
                      - name
                      - id
                      - code
                      - slug
                    properties:
                      name:
                        type: string
                        description: Human-readable warehouse name
                      id:
                        type: number
                        description: Warehouse internal numeric identifier
                      code:
                        type: string
                        description: Unique warehouse code within an organization
                      slug:
                        type: string
                        description: URL-safe warehouse slug within an organization
                    description: Warehouse where the counting took place
                  active:
                    type: boolean
                    description: If the counting is ongoing
                  participants:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - username
                      properties:
                        id:
                          type: number
                        username:
                          type:
                            - string
                            - 'null'
                    description: Users that participated in the counting
                  totalProducts:
                    type: number
                    description: Total number of products to count
                  totalProductsCounted:
                    type: number
                    description: Total number of products counted
                  totalProductsLeft:
                    type: number
                    description: Total number of products left to count
                  totalDiscrepancies:
                    type: number
                    description: Total number of stock discrepancies detected
                  totalIncidents:
                    type: number
                    description: Total number of incidents detected
                  products:
                    type: array
                    items:
                      $ref: '#/components/schemas/CountingProduct'
      security:
        - PublicAuth: []
components:
  schemas:
    CountingProduct:
      type: object
      required:
        - id
        - updatedAt
        - startedAt
        - finishedAt
        - index
        - assignedUser
        - documentation
        - productStock
        - productLocationStock
        - lotStock
        - lotLocationStock
        - costPrice
        - countedStock
        - difference
        - prevCountedStock
        - prevDifference
        - product
        - location
        - lot
        - productLocation
        - lotLocation
        - counting
        - incident
      properties:
        id:
          type: number
        updatedAt:
          type: string
          format: date-time
        startedAt:
          oneOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Current count status
        finishedAt:
          oneOf:
            - type: string
              format: date-time
            - type: 'null'
        index:
          type: number
          description: Ordering (0 based)
        assignedUser:
          type: object
          required:
            - id
            - username
          properties:
            id:
              type: number
            username:
              type:
                - string
                - 'null'
        documentation:
          oneOf:
            - type: object
              required:
                - body
                - id
                - createdAt
                - user
                - reason
                - stock
              properties:
                body:
                  type:
                    - string
                    - 'null'
                  description: Context for the discrepancy reason
                id:
                  type: number
                createdAt:
                  type: string
                  format: date-time
                  description: Timestamps
                user:
                  type: object
                  required:
                    - id
                    - username
                  properties:
                    id:
                      type: number
                    username:
                      type:
                        - string
                        - 'null'
                reason:
                  type: object
                  required:
                    - name
                    - id
                  properties:
                    name:
                      type: string
                    id:
                      type: number
                stock:
                  type:
                    - number
                    - 'null'
            - type: 'null'
        productStock:
          type: number
        productLocationStock:
          type: number
        lotStock:
          type: number
        lotLocationStock:
          type: number
        costPrice:
          type: number
        countedStock:
          type:
            - number
            - 'null'
        difference:
          type:
            - number
            - 'null'
        prevCountedStock:
          type:
            - number
            - 'null'
        prevDifference:
          type:
            - number
            - 'null'
        product:
          type: object
          required:
            - id
            - updatedAt
            - code
            - warehouse
            - costPrice
            - stock
            - metrics
            - description
            - packagingUnit
          properties:
            id:
              type: string
            updatedAt:
              type: string
              format: date-time
            code:
              type: string
              description: Unique Product Code (SKU)
            warehouse:
              type: object
              required:
                - name
                - code
              properties:
                name:
                  type: string
                  description: Human-readable warehouse name
                code:
                  type: string
                  description: Unique warehouse code within an organization
            costPrice:
              type: number
              description: Product cost
            stock:
              type: number
              description: The stock in this warehouse (sum of locations)
            metrics:
              oneOf:
                - type: object
                  required:
                    - updatedAt
                    - abc
                    - ranking
                    - valueAbc
                    - valueRanking
                    - valueTotal
                    - stockAbc
                    - stockRanking
                    - stockMonth
                    - stock6Mo
                    - stockYear
                    - priceAbc
                    - priceRanking
                    - priceMonth
                    - price6Mo
                    - priceYear
                    - movementAbc
                    - movementRanking
                    - movementMonth
                    - movement6Mo
                    - movementYear
                  properties:
                    updatedAt:
                      type: string
                      format: date-time
                    abc:
                      type: string
                      enum:
                        - A
                        - B
                        - C
                      description: The global product ABC categorization
                    ranking:
                      type: number
                    valueAbc:
                      type: string
                      enum:
                        - A
                        - B
                        - C
                      description: Metrics on overall warehouse value
                    valueRanking:
                      type: number
                    valueTotal:
                      type: number
                    stockAbc:
                      type: string
                      enum:
                        - A
                        - B
                        - C
                      description: Metrics on stock rotation
                    stockRanking:
                      type: number
                    stockMonth:
                      type: number
                    stock6Mo:
                      type: number
                    stockYear:
                      type: number
                    priceAbc:
                      type: string
                      enum:
                        - A
                        - B
                        - C
                    priceRanking:
                      type: number
                    priceMonth:
                      type: number
                    price6Mo:
                      type: number
                    priceYear:
                      type: number
                    movementAbc:
                      type: string
                      enum:
                        - A
                        - B
                        - C
                    movementRanking:
                      type: number
                    movementMonth:
                      type: number
                    movement6Mo:
                      type: number
                    movementYear:
                      type: number
                - type: 'null'
            description:
              type: string
              description: Short description
            packagingUnit:
              type: number
              description: Minimum selling unit
        location:
          type: object
          required:
            - id
            - code
          properties:
            id:
              type: string
            code:
              type: string
        lot:
          oneOf:
            - type: object
              required:
                - id
                - code
                - stock
              properties:
                id:
                  type: string
                code:
                  type: string
                stock:
                  type: number
                  description: The stock of this lot (sum of locations)
            - type: 'null'
        productLocation:
          type: object
          required:
            - stock
          properties:
            stock:
              type: number
              description: The amount of stock in this location
        lotLocation:
          oneOf:
            - type: object
              required:
                - stock
              properties:
                stock:
                  type: number
                  description: The amount of stock in this location
            - type: 'null'
        counting:
          type: object
          required:
            - id
            - startedAt
            - warehouse
          properties:
            id:
              type: string
            startedAt:
              type: string
              format: date-time
              description: Counting start timestamp
            warehouse:
              type: object
              required:
                - id
              properties:
                id:
                  type: number
                  description: Warehouse internal numeric identifier
        incident:
          oneOf:
            - type: object
              required:
                - body
                - id
                - createdAt
                - type
              properties:
                body:
                  type:
                    - string
                    - 'null'
                  description: Written context of the incident
                id:
                  type: number
                createdAt:
                  type: string
                  format: date-time
                type:
                  oneOf:
                    - type: object
                      required:
                        - name
                      properties:
                        name:
                          type: string
                          description: The display name of the incident type
                    - type: 'null'
            - type: 'null'
  securitySchemes:
    PublicAuth:
      type: http
      scheme: basic
      description: >-
        Use Integration API credentials as HTTP Basic auth (username: client id,
        password: client secret).

````