{
  "openapi": "3.1.0",
  "info": {
    "title": "StructOCR API",
    "version": "1.1.0",
    "summary": "Structured OCR REST API for identity documents, PDFs, tables, invoices, automotive, and logistics records.",
    "description": "StructOCR converts document images and PDFs into schema-validated JSON and spreadsheet tables.\n\n- Authentication: `x-api-key` HTTP header\n- Pricing: Unified pay-as-you-go non-expiring credits (200 free credits on signup; paid packs start at $5 for 500 credits; failed requests are automatically refunded)\n- Strict Zero Data Retention endpoints: `/v1/pdf-extract`, `/v1/image-to-excel`, `/v1/driver-license-pdf417`, `/v1/driver-license-verify`, `/v1/health-card`, `/v1/visa`, `/v1/proof-of-address`\n- Full Markdown docs for LLMs: https://structocr.com/llms-full.txt",
    "termsOfService": "https://structocr.com/terms",
    "contact": {
      "name": "StructOCR Support",
      "url": "https://structocr.com/contact"
    }
  },
  "externalDocs": {
    "description": "StructOCR Developer Documentation & LLM Reference",
    "url": "https://structocr.com/developers"
  },
  "servers": [
    {
      "url": "https://api.structocr.com",
      "description": "Production API Gateway"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Identity & KYC"
    },
    {
      "name": "PDF & Tables"
    },
    {
      "name": "Finance & Tax"
    },
    {
      "name": "Automotive & Fleet"
    },
    {
      "name": "Logistics & Maritime"
    },
    {
      "name": "Account & Billing"
    }
  ],
  "paths": {
    "/v1/passport": {
      "post": {
        "operationId": "extractPassport",
        "tags": [
          "Identity & KYC"
        ],
        "summary": "Passport OCR",
        "description": "Extract structured passport bio-page fields and ICAO 9303 TD3 MRZ data with deterministic check-digit validation.\n\nCost: 2 credits (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/passport-ocr",
        "externalDocs": {
          "description": "Passport OCR Developer Guide",
          "url": "https://structocr.com/developers/passport-ocr"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/passport-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Passport OCR. Typical fields include: document_type, issuing_country, passport_number, surname, given_names, nationality, date_of_birth, sex, date_of_expiry, personal_number, mrz_lines, mrz_valid.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/national-id": {
      "post": {
        "operationId": "extractNationalId",
        "tags": [
          "Identity & KYC"
        ],
        "summary": "National ID OCR",
        "description": "Extract structured fields from national ID cards worldwide including UAE Emirates ID, Saudi National ID / Iqama, Egypt National ID, EU eID / CIE, and TD1 MRZ cards.\n\nCost: 2 credits (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/national-id-ocr",
        "externalDocs": {
          "description": "National ID OCR Developer Guide",
          "url": "https://structocr.com/developers/national-id-ocr"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/national-id-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for National ID OCR. Typical fields include: country_code, document_number, personal_number, surname, given_names, full_name_native, nationality, date_of_birth, sex, date_of_issue, date_of_expiry, address.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/driver-license": {
      "post": {
        "operationId": "extractDriverLicense",
        "tags": [
          "Identity & KYC"
        ],
        "summary": "Driver License OCR",
        "description": "Extract visual front-side fields from global driver licenses across North America, Europe, UK, Australia, and GCC.\n\nCost: 2 credits (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/driver-license-ocr",
        "externalDocs": {
          "description": "Driver License OCR Developer Guide",
          "url": "https://structocr.com/developers/driver-license-ocr"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/driver-license-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Driver License OCR. Typical fields include: country_code, region, document_number, surname, given_names, date_of_birth, date_of_issue, date_of_expiry, sex, address, vehicle_class, card_security_number.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/driver-license-pdf417": {
      "post": {
        "operationId": "decodeDriverLicensePdf417",
        "tags": [
          "Identity & KYC"
        ],
        "summary": "Driver License PDF417 Barcode API",
        "description": "Deterministic AAMVA PDF417 2D barcode decoder for US and Canadian driver licenses and state IDs with native iPhone HEIC/HEIF support and strict zero data retention.\n\nCost: 2 credits (per successful request).\nPrivacy: Strict Zero Data Retention (images and extracted payloads are never stored).\nDocumentation: https://structocr.com/developers/driver-license-pdf417",
        "externalDocs": {
          "description": "Driver License PDF417 Barcode API Developer Guide",
          "url": "https://structocr.com/developers/driver-license-pdf417"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": true,
        "x-docs-url": "https://structocr.com/developers/driver-license-pdf417",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Driver License PDF417 Barcode API. Typical fields include: document_number, surname, first_name, middle_name, date_of_birth, date_of_issue, date_of_expiry, address, city, region, postal_code, document_discriminator, issuer_identification_number, aamva_version.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, HEIC, or HEIF image (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/driver-license-verify": {
      "post": {
        "operationId": "verifyDriverLicenseFrontBack",
        "tags": [
          "Identity & KYC"
        ],
        "summary": "Driver License Front + Back Verification API",
        "description": "Cross-check North American driver license front visual OCR against back AAMVA PDF417 barcode in a single zero-retention API call.\n\nCost: 4 credits (per verified request (full refund on 422 back-side failure)).\nPrivacy: Strict Zero Data Retention (images and extracted payloads are never stored).\nDocumentation: https://structocr.com/developers/driver-license-verify",
        "externalDocs": {
          "description": "Driver License Front + Back Verification API Developer Guide",
          "url": "https://structocr.com/developers/driver-license-verify"
        },
        "x-credits": 4,
        "x-credit-unit": "per verified request (full refund on 422 back-side failure)",
        "x-zero-retention": true,
        "x-docs-url": "https://structocr.com/developers/driver-license-verify",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriverLicenseVerifySuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Both front and back images of the North American driver license (JPG, PNG, WebP, HEIC, or HEIF; max 4.5MB per image).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "front",
                  "back"
                ],
                "properties": {
                  "front": {
                    "type": "string",
                    "format": "binary",
                    "description": "Front-side photo of the driver license (alias: front_image)."
                  },
                  "back": {
                    "type": "string",
                    "format": "binary",
                    "description": "Back-side photo showing the AAMVA PDF417 barcode (alias: back_image)."
                  },
                  "min_age": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 120,
                    "description": "Optional minimum age threshold evaluated deterministically against date of birth."
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "front",
                  "back"
                ],
                "properties": {
                  "front": {
                    "type": "string",
                    "description": "Base64 string or data URI of the front-side license image (alias: front_image)."
                  },
                  "back": {
                    "type": "string",
                    "description": "Base64 string or data URI of the back-side license image with PDF417 barcode (alias: back_image)."
                  },
                  "min_age": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 120,
                    "description": "Optional minimum age threshold (1-120)."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/visa": {
      "post": {
        "operationId": "extractTravelVisa",
        "tags": [
          "Identity & KYC"
        ],
        "summary": "Travel Visa OCR",
        "description": "Extract visa sticker and e-visa fields with ICAO 9303 MRV-A and MRV-B check-digit verification and strict zero data retention.\n\nCost: 2 credits (per successful request).\nPrivacy: Strict Zero Data Retention (images and extracted payloads are never stored).\nDocumentation: https://structocr.com/developers/visa-ocr",
        "externalDocs": {
          "description": "Travel Visa OCR Developer Guide",
          "url": "https://structocr.com/developers/visa-ocr"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": true,
        "x-docs-url": "https://structocr.com/developers/visa-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Travel Visa OCR. Typical fields include: issuing_country, visa_type, visa_number, passport_number, surname, given_names, nationality, valid_from, valid_until, entries, duration_of_stay, mrz_valid.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/proof-of-address": {
      "post": {
        "operationId": "extractProofOfAddress",
        "tags": [
          "Identity & KYC"
        ],
        "summary": "Proof of Address OCR",
        "description": "Extract resident name, issuer, document issue date, and normalized street address from utility bills, bank statements, and government letters for KYC onboarding.\n\nCost: 2 credits (per successful request).\nPrivacy: Strict Zero Data Retention (images and extracted payloads are never stored).\nDocumentation: https://structocr.com/developers/proof-of-address-ocr",
        "externalDocs": {
          "description": "Proof of Address OCR Developer Guide",
          "url": "https://structocr.com/developers/proof-of-address-ocr"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": true,
        "x-docs-url": "https://structocr.com/developers/proof-of-address-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Proof of Address OCR. Typical fields include: document_type, issuer_name, recipient_name, issue_date, full_address, street, city, state_or_region, postal_code, country_code.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/health-card": {
      "post": {
        "operationId": "extractHealthCard",
        "tags": [
          "Identity & KYC"
        ],
        "summary": "Health Insurance Card OCR",
        "description": "Extract member ID, group number, payer name, RxBIN/PCN/RxGrp, and copay fields from medical and health insurance cards with strict zero data retention.\n\nCost: 2 credits (per successful request).\nPrivacy: Strict Zero Data Retention (images and extracted payloads are never stored).\nDocumentation: https://structocr.com/developers/health-card-ocr",
        "externalDocs": {
          "description": "Health Insurance Card OCR Developer Guide",
          "url": "https://structocr.com/developers/health-card-ocr"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": true,
        "x-docs-url": "https://structocr.com/developers/health-card-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Health Insurance Card OCR. Typical fields include: payer_name, member_name, member_id, group_number, plan_name, rx_bin, rx_pcn, rx_group, effective_date, copays.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/pdf-extract": {
      "post": {
        "operationId": "extractPdfStructured",
        "tags": [
          "PDF & Tables"
        ],
        "summary": "PDF Extract API (Tables, Key-Values & Custom JSON)",
        "description": "Zero-retention general-purpose PDF and scanned document extraction returning stitched multi-page tables, key-value fields, and optional custom JSON schema output.\n\nCost: 2 credits (per succeeded page (failed pages automatically refunded)).\nPrivacy: Strict Zero Data Retention (images and extracted payloads are never stored).\nDocumentation: https://structocr.com/developers/pdf-extract",
        "externalDocs": {
          "description": "PDF Extract API (Tables, Key-Values & Custom JSON) Developer Guide",
          "url": "https://structocr.com/developers/pdf-extract"
        },
        "x-credits": 2,
        "x-credit-unit": "per succeeded page (failed pages automatically refunded)",
        "x-zero-retention": true,
        "x-docs-url": "https://structocr.com/developers/pdf-extract",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfExtractSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Multipart form upload with binary PDF, JPG, PNG, or WebP file (max 10MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Binary PDF, JPG, PNG, or WebP file (maximum 10MB)."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "tables",
                      "json"
                    ],
                    "default": "auto",
                    "description": "Extraction mode: auto (tables + key-values), tables (spreadsheet tables), or json (key-value/schema extraction)."
                  },
                  "pages": {
                    "type": "string",
                    "example": "1-5",
                    "description": "Optional 1-indexed page selector for multi-page PDFs (e.g., \"1-3\" or \"1,4,5\")."
                  },
                  "schema": {
                    "type": "string",
                    "description": "Optional JSON-encoded target schema string describing custom fields to extract into custom_data."
                  },
                  "stitch_tables": {
                    "type": "boolean",
                    "default": true,
                    "description": "Automatically merge continuation tables spanning adjacent PDF pages."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/image-to-excel": {
      "post": {
        "operationId": "extractImageToExcelTables",
        "tags": [
          "PDF & Tables"
        ],
        "summary": "Image to Excel OCR API",
        "description": "Zero-retention table extraction API optimized for converting photos, screenshots, and scanned documents into spreadsheet-ready structured tables (headers + rows).\n\nCost: 2 credits (per succeeded image or PDF page (failed pages refunded)).\nPrivacy: Strict Zero Data Retention (images and extracted payloads are never stored).\nDocumentation: https://structocr.com/developers/image-to-excel",
        "externalDocs": {
          "description": "Image to Excel OCR API Developer Guide",
          "url": "https://structocr.com/developers/image-to-excel"
        },
        "x-credits": 2,
        "x-credit-unit": "per succeeded image or PDF page (failed pages refunded)",
        "x-zero-retention": true,
        "x-docs-url": "https://structocr.com/developers/image-to-excel",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PdfExtractSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Multipart form upload with binary PDF, JPG, PNG, or WebP file (max 10MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Binary PDF, JPG, PNG, or WebP file (maximum 10MB)."
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "tables",
                      "json"
                    ],
                    "default": "tables",
                    "description": "Extraction mode: auto (tables + key-values), tables (spreadsheet tables), or json (key-value/schema extraction)."
                  },
                  "pages": {
                    "type": "string",
                    "example": "1-5",
                    "description": "Optional 1-indexed page selector for multi-page PDFs (e.g., \"1-3\" or \"1,4,5\")."
                  },
                  "schema": {
                    "type": "string",
                    "description": "Optional JSON-encoded target schema string describing custom fields to extract into custom_data."
                  },
                  "stitch_tables": {
                    "type": "boolean",
                    "default": true,
                    "description": "Automatically merge continuation tables spanning adjacent PDF pages."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/invoice": {
      "post": {
        "operationId": "extractInvoice",
        "tags": [
          "Finance & Tax"
        ],
        "summary": "Invoice OCR",
        "description": "Extract vendor/buyer tax IDs, invoice metadata, VAT/tax totals, line items, and GCC ZATCA / UAE FTA VAT fields from single images or multi-page PDF invoices.\n\nCost: 3 credits (per successful request (single image or multi-page PDF up to 5 pages)).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/invoice-ocr",
        "externalDocs": {
          "description": "Invoice OCR Developer Guide",
          "url": "https://structocr.com/developers/invoice-ocr"
        },
        "x-credits": 3,
        "x-credit-unit": "per successful request (single image or multi-page PDF up to 5 pages)",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/invoice-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Invoice OCR. Typical fields include: invoice_number, invoice_date, due_date, currency, vendor_name, vendor_tax_id, customer_name, subtotal, tax_amount, total_amount, line_items.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or multi-page PDF up to 5 pages (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/receipt": {
      "post": {
        "operationId": "extractReceipt",
        "tags": [
          "Finance & Tax"
        ],
        "summary": "Receipt OCR",
        "description": "Extract merchant, timestamp, subtotal, tax, tip, payment method, and line items from thermal and crumpled retail/restaurant receipts.\n\nCost: 1 credit (1 credit (accuracy=standard) or 2 credits (accuracy=enhanced)).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/receipt-ocr",
        "externalDocs": {
          "description": "Receipt OCR Developer Guide",
          "url": "https://structocr.com/developers/receipt-ocr"
        },
        "x-credits": 1,
        "x-credit-unit": "1 credit (accuracy=standard) or 2 credits (accuracy=enhanced)",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/receipt-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Receipt OCR. Typical fields include: merchant_name, date, time, currency, subtotal, tax, tip, total, payment_method, line_items.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "accuracy",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "standard",
                "enhanced"
              ],
              "default": "standard"
            },
            "description": "Extraction resolution tier: standard (1 credit) or enhanced (2 credits, ultra-high resolution for long or faded receipts)."
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/atm-cassette": {
      "post": {
        "operationId": "extractAtmCassette",
        "tags": [
          "Finance & Tax"
        ],
        "summary": "ATM Cassette & Counter Slip OCR",
        "description": "Extract cassette counts, denominations, reject/purge totals, and terminal identifiers from ATM cash reconciliation slips and screens.\n\nCost: 1 credit (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/atm-cassette-ocr",
        "externalDocs": {
          "description": "ATM Cassette & Counter Slip OCR Developer Guide",
          "url": "https://structocr.com/developers/atm-cassette-ocr"
        },
        "x-credits": 1,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/atm-cassette-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for ATM Cassette & Counter Slip OCR. Typical fields include: terminal_id, timestamp, cassettes, total_dispensed, total_rejected, currency.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/vin": {
      "post": {
        "operationId": "extractVin",
        "tags": [
          "Automotive & Fleet"
        ],
        "summary": "VIN OCR",
        "description": "Read 17-character ISO 3779 Vehicle Identification Numbers from windshields, door-jamb stickers, and documents with check-digit validation.\n\nCost: 1 credit (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/vin-ocr",
        "externalDocs": {
          "description": "VIN OCR Developer Guide",
          "url": "https://structocr.com/developers/vin-ocr"
        },
        "x-credits": 1,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/vin-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for VIN OCR. Typical fields include: vin, is_valid, wmi, vds, vis, model_year.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/vin-pro": {
      "post": {
        "operationId": "extractVinPro",
        "tags": [
          "Automotive & Fleet"
        ],
        "summary": "VIN Pro OCR (VIN + Vehicle Specs Decoding)",
        "description": "Extract the 17-character VIN from a photo and enrich it with decoded make, model, year, body class, engine, and trim specifications.\n\nCost: 2 credits (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/vin-pro-ocr",
        "externalDocs": {
          "description": "VIN Pro OCR (VIN + Vehicle Specs Decoding) Developer Guide",
          "url": "https://structocr.com/developers/vin-pro-ocr"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/vin-pro-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for VIN Pro OCR (VIN + Vehicle Specs Decoding). Typical fields include: vin, is_valid, vehicle.make, vehicle.model, vehicle.year, vehicle.body_class, vehicle.fuel_type.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/vehicle-registration": {
      "post": {
        "operationId": "extractVehicleRegistration",
        "tags": [
          "Automotive & Fleet"
        ],
        "summary": "Vehicle Registration OCR (Saudi Istimara, UAE Mulkiya, US DMV, Global)",
        "description": "Extract VIN, plate number, owner, make/model/year, and country-specific localized fields from global vehicle registration cards including Saudi Istimara (TGA details), UAE Mulkiya, US DMV, and India RC.\n\nCost: 2 credits (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/vehicle-registration-ocr",
        "externalDocs": {
          "description": "Vehicle Registration OCR (Saudi Istimara, UAE Mulkiya, US DMV, Global) Developer Guide",
          "url": "https://structocr.com/developers/vehicle-registration-ocr"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/vehicle-registration-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Vehicle Registration OCR (Saudi Istimara, UAE Mulkiya, US DMV, Global). Typical fields include: country_code, vin, plate_number, owner_name, make, model, year, color, expiry_date, localized.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/auto-insurance": {
      "post": {
        "operationId": "extractAutoInsurance",
        "tags": [
          "Automotive & Fleet"
        ],
        "summary": "Auto Insurance Card OCR",
        "description": "Extract policy number, insurer, NAIC code, effective/expiration dates, insured drivers, and covered vehicle VINs from auto insurance ID cards.\n\nCost: 2 credits (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/auto-insurance-ocr",
        "externalDocs": {
          "description": "Auto Insurance Card OCR Developer Guide",
          "url": "https://structocr.com/developers/auto-insurance-ocr"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/auto-insurance-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Auto Insurance Card OCR. Typical fields include: insurer_name, naic_code, policy_number, effective_date, expiration_date, insured_names, vehicles.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/license-plate": {
      "post": {
        "operationId": "extractLicensePlate",
        "tags": [
          "Automotive & Fleet"
        ],
        "summary": "License Plate OCR",
        "description": "Read vehicle license plates including US/EU plates and bilingual Arabic/English GCC plates (Saudi Arabia, UAE, Qatar, Kuwait).\n\nCost: 1 credit (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/license-plate-ocr",
        "externalDocs": {
          "description": "License Plate OCR Developer Guide",
          "url": "https://structocr.com/developers/license-plate-ocr"
        },
        "x-credits": 1,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/license-plate-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for License Plate OCR. Typical fields include: plate_number, plate_arabic, region, country_code, plate_type.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/container": {
      "post": {
        "operationId": "extractShippingContainer",
        "tags": [
          "Logistics & Maritime"
        ],
        "summary": "Shipping Container Code OCR (ISO 6346)",
        "description": "Extract ISO 6346 shipping container numbers (owner code, category, serial, check digit) and ISO size/type codes from horizontal or vertical container markings.\n\nCost: 1 credit (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/container-ocr",
        "externalDocs": {
          "description": "Shipping Container Code OCR (ISO 6346) Developer Guide",
          "url": "https://structocr.com/developers/container-ocr"
        },
        "x-credits": 1,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/container-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Shipping Container Code OCR (ISO 6346). Typical fields include: container_number, owner_code, equipment_category, serial_number, check_digit, is_valid_iso6346, iso_type_code.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/bill-of-lading": {
      "post": {
        "operationId": "extractBillOfLading",
        "tags": [
          "Logistics & Maritime"
        ],
        "summary": "Bill of Lading & Air Waybill OCR",
        "description": "Extract shipper, consignee, B/L or AWB number, vessel/voyage, ports, container numbers, cargo descriptions, and weights with ISO 6346 and IATA AWB validation.\n\nCost: 3 credits (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/bill-of-lading-ocr",
        "externalDocs": {
          "description": "Bill of Lading & Air Waybill OCR Developer Guide",
          "url": "https://structocr.com/developers/bill-of-lading-ocr"
        },
        "x-credits": 3,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/bill-of-lading-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Bill of Lading & Air Waybill OCR. Typical fields include: document_type, bl_number, awb_number, shipper, consignee, port_of_loading, port_of_discharge, containers, cargo_items, gross_weight.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/weighbridge-ticket": {
      "post": {
        "operationId": "extractWeighbridgeTicket",
        "tags": [
          "Logistics & Maritime"
        ],
        "summary": "Weighbridge & Scale Ticket OCR",
        "description": "Extract ticket number, vehicle plate, gross/tare/net weights, unit, material, and timestamps from dot-matrix and thermal weighbridge scale tickets.\n\nCost: 2 credits (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/weighbridge-ticket-ocr",
        "externalDocs": {
          "description": "Weighbridge & Scale Ticket OCR Developer Guide",
          "url": "https://structocr.com/developers/weighbridge-ticket-ocr"
        },
        "x-credits": 2,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/weighbridge-ticket-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Weighbridge & Scale Ticket OCR. Typical fields include: ticket_number, date, vehicle_plate, material, gross_weight, tare_weight, net_weight, weight_unit, customer_name.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/hin": {
      "post": {
        "operationId": "extractHin",
        "tags": [
          "Logistics & Maritime"
        ],
        "summary": "Marine HIN OCR (Hull Identification Number)",
        "description": "Extract and parse 12-character USCG/ISO Hull Identification Numbers (MIC, serial number, manufacture month/year, model year) from boat transoms and titles.\n\nCost: 1 credit (per successful request).\nPrivacy: Standard retention (deleted within 24 hours max).\nDocumentation: https://structocr.com/developers/hin-ocr",
        "externalDocs": {
          "description": "Marine HIN OCR (Hull Identification Number) Developer Guide",
          "url": "https://structocr.com/developers/hin-ocr"
        },
        "x-credits": 1,
        "x-credit-unit": "per successful request",
        "x-zero-retention": false,
        "x-docs-url": "https://structocr.com/developers/hin-ocr",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "data"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "description": "Structured extraction payload for Marine HIN OCR (Hull Identification Number). Typical fields include: hin, is_valid, mic, serial_number, certification_month, certification_year, model_year.",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient account credit balance (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Uploaded file exceeds maximum allowed size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type or file format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unreadable document or barcode (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "description": "Document file submitted as multipart/form-data or JSON base64. Accepted formats: JPG, PNG, WebP, or single-page PDF (max 4.5MB).",
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/MultipartFileRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonBase64ImageRequest"
              }
            }
          }
        }
      }
    },
    "/v1/account/balance": {
      "get": {
        "operationId": "getAccountBalance",
        "tags": [
          "Account & Billing"
        ],
        "summary": "Account & API Key Credit Balance",
        "description": "Check remaining account credit balance, lifetime usage, and current-month account and API-key request metrics.\n\nCost: 0 credits (free).\nPrivacy: Strict Zero Data Retention (images and extracted payloads are never stored).\nDocumentation: https://structocr.com/developers/account-balance",
        "externalDocs": {
          "description": "Account & API Key Credit Balance Developer Guide",
          "url": "https://structocr.com/developers/account-balance"
        },
        "x-credits": 0,
        "x-credit-unit": "free (0 credits)",
        "x-zero-retention": true,
        "x-docs-url": "https://structocr.com/developers/account-balance",
        "responses": {
          "200": {
            "description": "Extraction succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountBalanceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request payload or missing required field (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, or inactive x-api-key header (0 credits charged).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server or upstream processing failure (credits automatically refunded).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "StructOCR API key created in your Dashboard (https://structocr.com/dashboard/api-keys)."
      }
    },
    "schemas": {
      "MultipartFileRequest": {
        "type": "object",
        "required": [
          "file"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "Binary image or PDF document (alias field name: img; maximum 4.5MB)."
          }
        }
      },
      "JsonBase64ImageRequest": {
        "type": "object",
        "required": [
          "img"
        ],
        "properties": {
          "img": {
            "type": "string",
            "description": "Raw Base64-encoded file bytes or data URI (e.g., data:image/jpeg;base64,...). Alias: image."
          }
        }
      },
      "PdfExtractSuccessResponse": {
        "type": "object",
        "required": [
          "success",
          "mode",
          "document",
          "pages",
          "usage"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "mode": {
            "type": "string",
            "enum": [
              "auto",
              "tables",
              "json"
            ]
          },
          "document": {
            "type": "object",
            "required": [
              "summary",
              "fields",
              "tables"
            ],
            "properties": {
              "summary": {
                "type": "object",
                "properties": {
                  "document_type": {
                    "type": "string"
                  },
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "language": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "fields": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "string",
                    "number",
                    "boolean",
                    "null"
                  ]
                }
              },
              "tables": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "page_range",
                    "stitched",
                    "headers",
                    "rows"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "page_range": {
                      "type": "array",
                      "items": {
                        "type": "integer"
                      },
                      "minItems": 2,
                      "maxItems": 2
                    },
                    "stitched": {
                      "type": "boolean"
                    },
                    "headers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "custom_data": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "pages": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "page",
                "status"
              ],
              "properties": {
                "page": {
                  "type": "integer"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "ok",
                    "error"
                  ]
                },
                "tables_found": {
                  "type": "integer"
                },
                "error": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "required": [
              "page_count",
              "pages_processed",
              "pages_succeeded",
              "credits_per_page",
              "credits_charged"
            ],
            "properties": {
              "page_count": {
                "type": "integer"
              },
              "pages_processed": {
                "type": "integer"
              },
              "pages_succeeded": {
                "type": "integer"
              },
              "credits_per_page": {
                "type": "integer"
              },
              "credits_charged": {
                "type": "integer"
              }
            }
          }
        }
      },
      "DriverLicenseVerifySuccessResponse": {
        "type": "object",
        "required": [
          "success",
          "data"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "data": {
            "type": "object",
            "required": [
              "verification",
              "front",
              "back"
            ],
            "properties": {
              "verification": {
                "type": "object",
                "required": [
                  "overall_status",
                  "front_back_match",
                  "dd_dcf_match",
                  "mismatches",
                  "field_checks"
                ],
                "properties": {
                  "overall_status": {
                    "type": "string",
                    "enum": [
                      "verified_match",
                      "expired",
                      "mismatch",
                      "inconclusive"
                    ]
                  },
                  "front_back_match": {
                    "type": "boolean"
                  },
                  "dd_dcf_match": {
                    "type": "string",
                    "enum": [
                      "matched",
                      "mismatched",
                      "unavailable"
                    ]
                  },
                  "is_expired": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "is_over_18": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "is_over_21": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "age_years": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "meets_min_age": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "mismatches": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "field_checks": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "scope_notice": {
                    "type": "string"
                  }
                }
              },
              "front": {
                "type": "object",
                "additionalProperties": true
              },
              "back": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      },
      "AccountBalanceResponse": {
        "type": "object",
        "required": [
          "period",
          "account",
          "this_key"
        ],
        "properties": {
          "period": {
            "type": "object",
            "properties": {
              "start": {
                "type": "string",
                "format": "date-time"
              },
              "end": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "account": {
            "type": "object",
            "properties": {
              "credits_total": {
                "type": "number"
              },
              "credits_used": {
                "type": "number"
              },
              "credits_remaining": {
                "type": "number"
              },
              "credits_this_period": {
                "type": "number"
              },
              "requests_this_period": {
                "type": "integer"
              },
              "error_rate": {
                "type": "string"
              },
              "avg_latency_ms": {
                "type": "integer"
              }
            }
          },
          "this_key": {
            "type": "object",
            "properties": {
              "credits_used": {
                "type": "number"
              },
              "requests": {
                "type": "integer"
              },
              "error_rate": {
                "type": "string"
              },
              "avg_latency_ms": {
                "type": "integer"
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "string",
            "description": "Machine-readable error code."
          },
          "message": {
            "type": "string",
            "description": "Human-readable diagnostic message."
          },
          "failed_side": {
            "type": "string",
            "enum": [
              "front",
              "back"
            ]
          },
          "capture_issue": {
            "type": "string"
          }
        }
      }
    }
  }
}
