{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nmi/json-schema/nmi-device-list-response-schema.json",
  "title": "Device List Response",
  "description": "Response containing a list of devices with pagination",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nmi-devices-api-openapi.yml#/components/schemas/DeviceListResponse",
  "type": "object",
  "required": [
    "devices",
    "total_count",
    "limit",
    "offset",
    "has_more"
  ],
  "properties": {
    "devices": {
      "type": "array",
      "description": "Array of device objects",
      "items": {
        "$ref": "#/$defs/DeviceResponse"
      }
    },
    "total_count": {
      "type": "integer",
      "description": "Total number of devices registered to the merchant"
    },
    "limit": {
      "type": "integer",
      "description": "Number of devices returned per page"
    },
    "offset": {
      "type": "integer",
      "description": "Pagination offset"
    },
    "has_more": {
      "type": "boolean",
      "description": "Whether there are more devices available"
    }
  },
  "$defs": {
    "DeviceResponse": {
      "type": "object",
      "title": "Device Response",
      "description": "Response containing cloud device data",
      "required": [
        "object",
        "id",
        "registration_status"
      ],
      "properties": {
        "object": {
          "type": "string",
          "enum": [
            "device"
          ],
          "description": "String representing the object's type. Always 'device' for device objects."
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for the device"
        },
        "device_nickname": {
          "type": [
            "string",
            "null"
          ],
          "description": "Nickname assigned to the device"
        },
        "make": {
          "type": [
            "string",
            "null"
          ],
          "description": "Device manufacturer"
        },
        "model": {
          "type": [
            "string",
            "null"
          ],
          "description": "Device model"
        },
        "serial_number": {
          "type": [
            "string",
            "null"
          ],
          "description": "Device serial number"
        },
        "registration_status": {
          "type": "string",
          "enum": [
            "registered",
            "deregistered"
          ],
          "description": "Current registration status of the device"
        },
        "last_transaction_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Date and time of the last transaction processed on this device"
        },
        "date_registered": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Date and time when the device was registered"
        },
        "date_deregistered": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Date and time when the device was deregistered"
        },
        "connection_status": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the device is currently connected"
        },
        "last_connected_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Date and time when the device was last connected"
        },
        "last_disconnected_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Date and time when the device was last disconnected"
        },
        "battery_info": {
          "type": [
            "object",
            "null"
          ],
          "description": "Battery information (only included when current_status=true)"
        },
        "wifi_info": {
          "type": [
            "object",
            "null"
          ],
          "description": "WiFi information (only included when current_status=true)"
        }
      }
    }
  }
}