{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/passportcraft-com/json-schema/passportcraft-com-passport-links-schema.json",
  "title": "PassportLinks",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/passportcraft-com-openapi.json#/components/schemas/PassportLinks",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "const": "passport_links"
    },
    "id": {
      "type": "string",
      "maxLength": 255
    },
    "name": {
      "type": "string",
      "maxLength": 255
    },
    "organization_id": {
      "type": "string",
      "maxLength": 255
    },
    "passport": {
      "type": "string",
      "maxLength": 255
    },
    "status": {
      "type": "string",
      "enum": [
        "draft",
        "published",
        "deactivated",
        "trashed",
        "readonly"
      ]
    },
    "livemode": {
      "type": "boolean"
    },
    "gtin": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "serial_number": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "public_url": {
      "type": "string"
    },
    "qr_target": {
      "description": "Exactly what the printed QR code encodes. For a battery model, this is the model's own address; each battery's code is the `qr_target` of its unit.",
      "type": "string"
    },
    "gs1_digital_links": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "uri": {
            "type": "string"
          },
          "gtin14": {
            "type": "string"
          },
          "serial": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "linkset_url": {
            "type": "string"
          },
          "unavailable_reason": {
            "type": "null"
          },
          "variant_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "colour": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "uri",
          "gtin14",
          "serial",
          "linkset_url",
          "unavailable_reason",
          "variant_id",
          "size",
          "colour"
        ],
        "additionalProperties": {}
      }
    },
    "gs1_digital_link": {
      "type": "object",
      "properties": {
        "uri": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "gtin14": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "serial": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "linkset_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "unavailable_reason": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "gtin_missing",
                "gtin_invalid",
                "example_passport"
              ]
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "uri",
        "gtin14",
        "serial",
        "linkset_url",
        "unavailable_reason"
      ],
      "additionalProperties": {}
    },
    "resolves_publicly": {
      "type": "boolean"
    },
    "not_resolvable_reason": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "test_mode",
            "not_published"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "preview_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "object",
    "id",
    "name",
    "organization_id",
    "passport",
    "status",
    "livemode",
    "gtin",
    "serial_number",
    "public_url",
    "qr_target",
    "gs1_digital_links",
    "gs1_digital_link",
    "resolves_publicly",
    "not_resolvable_reason",
    "preview_url"
  ],
  "additionalProperties": {}
}