{
  "openapi": "3.1.0",
  "info": {
    "title": "Barcode & QR Tools API",
    "description": "Use Barcode & QR Tools API to read QR codes, decode 1D barcodes, identify formats, detect multiple codes, generate barcode images and validate payloads. Call POST /v1/barcode with operation decode, generate, formats or validate. All relay endpoints return JSON; generated images use temporary HTTPS URLs with a one-hour TTL. Access this contract through a configured POKT gateway or signed supplier relay. The public docs/results host does not expose /v1 endpoints.",
    "version": "0.1.0"
  },
  "paths": {
    "/v1/health": {
      "get": {
        "summary": "Health",
        "operationId": "health_v1_health_get",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "408": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "413": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "500": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/identity": {
      "get": {
        "summary": "Identity",
        "operationId": "identity_v1_identity_get",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "408": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "413": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "500": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/barcode": {
      "post": {
        "summary": "Barcode",
        "operationId": "barcode_v1_barcode_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/GenerateRequest"
                  },
                  {
                    "$ref": "#/components/schemas/DecodeRequest"
                  },
                  {
                    "$ref": "#/components/schemas/FormatsRequest"
                  }
                ],
                "title": "Body",
                "discriminator": {
                  "propertyName": "operation",
                  "mapping": {
                    "generate": "#/components/schemas/GenerateRequest",
                    "validate": "#/components/schemas/GenerateRequest",
                    "decode": "#/components/schemas/DecodeRequest",
                    "formats": "#/components/schemas/FormatsRequest"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "408": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "413": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "500": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        },
        "description": "Use formats for the verified format inventory. Decode accepts public HTTPS JPEG, PNG or WebP images (25 MiB download, 30 million pixels). Generation accepts UTF-8 text up to 4096 bytes, dimensions up to 4096 each and 16 million pixels total. Unsupported payloads and formats are rejected. GS1 generation is not enabled. max_results is at most 32. Results expire after one hour. Output URLs vary by request."
      }
    },
    "/v1/self-test": {
      "post": {
        "summary": "Self Test",
        "operationId": "self_test_v1_self_test_post",
        "responses": {
          "200": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "408": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "413": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "422": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "429": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          },
          "500": {
            "description": "JSON response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DecodeParams": {
        "properties": {
          "formats": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 32,
            "title": "Formats"
          },
          "try_harder": {
            "type": "boolean",
            "title": "Try Harder",
            "default": true
          },
          "max_results": {
            "type": "integer",
            "maximum": 32.0,
            "minimum": 1.0,
            "title": "Max Results",
            "default": 16
          }
        },
        "additionalProperties": false,
        "type": "object",
        "title": "DecodeParams"
      },
      "DecodeRequest": {
        "properties": {
          "operation": {
            "type": "string",
            "const": "decode",
            "title": "Operation"
          },
          "image_url": {
            "type": "string",
            "maxLength": 2048,
            "title": "Image Url"
          },
          "params": {
            "$ref": "#/components/schemas/DecodeParams"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "operation",
          "image_url"
        ],
        "title": "DecodeRequest"
      },
      "FormatsRequest": {
        "properties": {
          "operation": {
            "type": "string",
            "const": "formats",
            "title": "Operation"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "operation"
        ],
        "title": "FormatsRequest"
      },
      "GenerateParams": {
        "properties": {
          "format": {
            "type": "string",
            "title": "Format"
          },
          "text": {
            "type": "string",
            "maxLength": 4096,
            "title": "Text"
          },
          "width": {
            "type": "integer",
            "maximum": 4096.0,
            "minimum": 1.0,
            "title": "Width",
            "default": 1024
          },
          "height": {
            "type": "integer",
            "maximum": 4096.0,
            "minimum": 1.0,
            "title": "Height",
            "default": 1024
          },
          "margin": {
            "type": "integer",
            "maximum": 20.0,
            "minimum": 0.0,
            "title": "Margin",
            "default": 4
          },
          "error_correction": {
            "type": "string",
            "enum": [
              "L",
              "M",
              "Q",
              "H"
            ],
            "title": "Error Correction",
            "default": "M"
          },
          "encoding": {
            "type": "string",
            "const": "UTF-8",
            "title": "Encoding",
            "default": "UTF-8"
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png",
              "svg"
            ],
            "title": "Output Format",
            "default": "png"
          },
          "gs1": {
            "type": "boolean",
            "const": false,
            "title": "Gs1",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "format",
          "text"
        ],
        "title": "GenerateParams"
      },
      "GenerateRequest": {
        "properties": {
          "operation": {
            "type": "string",
            "enum": [
              "generate",
              "validate"
            ],
            "title": "Operation"
          },
          "params": {
            "$ref": "#/components/schemas/GenerateParams"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "operation",
          "params"
        ],
        "title": "GenerateRequest"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "ApiResponse": {
        "type": "object",
        "required": [
          "ok"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "code": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "output": {
            "type": "object"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "count": {
            "type": "integer"
          },
          "valid": {
            "type": "boolean"
          },
          "read_formats": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "write_formats": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  },
  "servers": []
}
