{
 "openapi": "3.1.0",
 "info": {
  "title": "bevGTIN",
  "version": "0.1.0",
  "description": "bevGTIN — the beverage alcohol sourcing GTIN confirmation. agent-bev developed bevGTIN — the beverage alcohol sourcing GTIN confirmation for AI agents.",
  "contact": {
   "email": "mk@agent-bev.ai"
  },
  "x-provider": "agent-bev",
  "x-owner": "Agentic Enterprises S.A."
 },
 "servers": [
  {
   "url": "https://bevgtin.ai"
  }
 ],
 "paths": {
  "/01/{gtin14}": {
   "get": {
    "operationId": "confirmGtin",
    "summary": "Confirm one beverage alcohol GTIN (GS1 Digital Link)",
    "parameters": [
     {
      "name": "gtin14",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "8, 12, 13 or 14 digits"
     },
     {
      "name": "market",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "ISO 3166-1 alpha-2"
     }
    ],
    "responses": {
     "200": {
      "description": "the signed answer",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Answer"
        }
       }
      }
     },
     "400": {
      "description": "not a GTIN-shaped number"
     },
     "404": {
      "description": "no observation: gtin14, well_formed and the notice only"
     }
    }
   }
  },
  "/x402/01/{gtin14}": {
   "get": {
    "operationId": "confirmGtinPaid",
    "summary": "The paid confirm (x402 on Base): HTTP 402 with the offer; with PAYMENT-SIGNATURE, the signed answer with its receipt",
    "parameters": [
     {
      "name": "gtin14",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "PAYMENT-SIGNATURE",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "the x402 payment payload, base64 JSON"
     }
    ],
    "responses": {
     "200": {
      "description": "settled: the Answer plus receipt {nonce, tx_hash, receipt_url, signature}"
     },
     "402": {
      "description": "the offer (x402 v2; also in the PAYMENT-REQUIRED header): USDC and Open USD on Base, the pay-to addresses, the record, the paid path, the receipt key"
     }
    }
   }
  },
  "/x402/receipt/{nonce}": {
   "get": {
    "operationId": "receipt",
    "summary": "a settlement receipt, forever",
    "responses": {
     "200": {
      "description": "the receipt"
     },
     "404": {
      "description": "unknown"
     }
    }
   }
  },
  "/x402/settled.json": {
   "get": {
    "operationId": "settled",
    "summary": "the till's register: settlement count and last settlement, counts only",
    "responses": {
     "200": {
      "description": "the register"
     }
    }
   }
  },
  "/mcp": {
   "post": {
    "operationId": "mcp",
    "summary": "Streamable HTTP MCP: initialize, tools/list, tools/call confirm_gtin (pay: true for the paid confirm; HTTP 402 with the offer until paid)",
    "responses": {
     "200": {
      "description": "JSON-RPC 2.0"
     },
     "402": {
      "description": "the paid confirm's offer (JSON-RPC error -32042, data = the offer)"
     }
    }
   }
  },
  "/.well-known/jwks.json": {
   "get": {
    "operationId": "jwks",
    "summary": "the signing key (kid bevgtin-2026-10)",
    "responses": {
     "200": {
      "description": "JWKS"
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Answer": {
    "type": "object",
    "properties": {
     "gtin14": {
      "type": "string"
     },
     "well_formed": {
      "type": "boolean"
     },
     "packaging_level": {
      "type": "string"
     },
     "product": {
      "type": "object"
     },
     "seen": {
      "type": "object"
     },
     "cuvee_category": {
      "type": "object"
     },
     "strength": {
      "type": "object"
     },
     "container": {
      "type": "object"
     },
     "deposit": {
      "type": "object"
     },
     "excise_class": {
      "type": "object"
     },
     "age_gated": {
      "type": "object"
     },
     "markets_seen": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "banners_seen": {
      "type": "array"
     },
     "signed": {
      "type": "object",
      "properties": {
       "kid": {
        "type": "string"
       },
       "alg": {
        "type": "string"
       },
       "signature": {
        "type": "string"
       }
      }
     },
     "notice": {
      "type": "string"
     }
    },
    "required": [
     "gtin14",
     "well_formed",
     "signed",
     "notice"
    ]
   }
  }
 }
}