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

# Locker Availability

> Get live compartment availability for a locker location. The location is looked up by its ID (the `id` returned by the locations endpoints) and its availability is retrieved from GoLocker. Availability is real time and is not cached.



## OpenAPI

````yaml GET /locations/{location_id}/availability
openapi: 3.1.0
info:
  title: R4 API
  description: API for integrating dry cleaning location services and order tracking
  version: 1.0.0
servers:
  - url: https://dev.api.r4technology.io
security:
  - basicAuth: []
paths:
  /locations/{location_id}/availability:
    get:
      description: >-
        Get live compartment availability for a locker location. The location is
        looked up by its ID (the `id` returned by the locations endpoints) and
        its availability is retrieved from GoLocker. Availability is real time
        and is not cached.
      parameters:
        - name: location_id
          in: path
          description: The ID of the location
          required: true
          schema:
            type: integer
            example: 42
      responses:
        '200':
          description: Compartment availability for the location
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LockerAvailabilityResponse'
              example:
                total_available: 58
                total_in_use: 7
                sizes_available:
                  S: 34
                  M: 20
                  L: 3
                  XL: 1
                sizes_in_use:
                  S: 3
                  L: 3
                  XL: 1
        '400':
          description: The location has no locker (GoLocker external ID) configured
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            Location not found, not available to your integration, or the locker
            was not found at GoLocker
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: >-
            Availability could not be retrieved from GoLocker. Retry the
            request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    LockerAvailabilityResponse:
      type: object
      properties:
        total_available:
          description: Total number of compartments currently available
          type: integer
        total_in_use:
          description: Total number of compartments currently in use
          type: integer
        sizes_available:
          description: >-
            Number of available compartments by size code (S, M, L, XL). Sizes
            with no available compartments are omitted.
          type: object
          additionalProperties:
            type: integer
        sizes_in_use:
          description: >-
            Number of in-use compartments by size code (S, M, L, XL). Sizes with
            no compartments in use are omitted.
          type: object
          additionalProperties:
            type: integer
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.