{
  "openapi": "3.1.0",
  "info": {
    "title": "Go Brewing agent API",
    "version": "1.0.0",
    "summary": "Read-only access to Go Brewing non-alcoholic beers, prices, stock and nearby stores.",
    "description": "Public, read-only, no sign-in. Every beer is non-alcoholic (under 0.5% ABV); buyers must be 21 or older. Nothing here places an order: get-cart-link returns a gobrewing.com link the person opens to review and pay. Agent checkout runs through Shopify UCP (https://gobrewing.com/.well-known/ucp). The same tools are available as an MCP server at https://gobrewing.com/api/agent/mcp. Limit: 60 requests per minute per IP.",
    "contact": {
      "name": "Go Brewing",
      "url": "https://gobrewing.com/pages/contact"
    }
  },
  "externalDocs": {
    "description": "Developer page",
    "url": "https://gobrewing.com/pages/developers"
  },
  "servers": [
    {
      "url": "https://gobrewing.com/api/agent/v1"
    }
  ],
  "tags": [
    {
      "name": "beers"
    },
    {
      "name": "stores"
    },
    {
      "name": "cart"
    }
  ],
  "paths": {
    "/beers": {
      "get": {
        "operationId": "searchBeers",
        "tags": [
          "beers"
        ],
        "summary": "List or search Go Brewing beers, starter kits and hop water",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Words to match, e.g. \"hazy ipa\", \"sour\", \"pilsner\".",
            "example": "hazy ipa"
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "beer",
                "starter_kit",
                "hop_water"
              ]
            }
          },
          {
            "name": "crafted_without_gluten",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Only beers crafted without gluten."
          },
          {
            "name": "in_stock_only",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching products",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "handle": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "beer",
                              "starter_kit",
                              "hop_water"
                            ]
                          },
                          "description": {
                            "type": "string"
                          },
                          "crafted_without_gluten": {
                            "type": "boolean"
                          },
                          "rating": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "review_count": {
                            "type": "integer"
                          },
                          "from_price_usd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "in_stock": {
                            "type": "boolean"
                          },
                          "awards": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Medals and honors, e.g. \"2026 World Beer Cup · Bronze\"."
                          }
                        },
                        "required": [
                          "name",
                          "handle",
                          "url",
                          "kind",
                          "in_stock"
                        ]
                      }
                    }
                  },
                  "required": [
                    "count",
                    "products"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          }
        }
      }
    },
    "/beers/{handle}": {
      "get": {
        "operationId": "getBeer",
        "tags": [
          "beers"
        ],
        "summary": "Full details for one product: medals, each pack size, variant_id, price and stock",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9-]+$"
            },
            "example": "disarm-hazy-ipa"
          }
        ],
        "responses": {
          "200": {
            "description": "The product",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "handle": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "crafted_without_gluten": {
                      "type": "boolean"
                    },
                    "rating": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "review_count": {
                      "type": "integer"
                    },
                    "image_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "awards": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "awards_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri",
                      "description": "Every Go Brewing medal with links to the official competition results."
                    },
                    "variants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "variant_id": {
                            "type": "string"
                          },
                          "size": {
                            "type": "string"
                          },
                          "price_usd": {
                            "type": "number"
                          },
                          "compare_at_usd": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "available": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "variant_id",
                          "price_usd",
                          "available"
                        ]
                      }
                    }
                  },
                  "required": [
                    "name",
                    "handle",
                    "url",
                    "variants"
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          }
        }
      }
    },
    "/stores": {
      "get": {
        "operationId": "findStoresNear",
        "tags": [
          "stores"
        ],
        "summary": "Stores, bars and restaurants near a US zip code that recently bought a Go Brewing beer",
        "parameters": [
          {
            "name": "beer",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Short beer name.",
            "example": "Disarm"
          },
          {
            "name": "zip",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{5}$"
            },
            "example": "60540"
          },
          {
            "name": "venue",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "stores",
                "bars_restaurants",
                "all"
              ],
              "default": "all"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 5
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Places, nearest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "product": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "stores": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "account_name": {
                            "type": "string"
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "state": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "zip": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "formatted_address": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lat": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "lng": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "distance_miles": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "last_active_month": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "account_name"
                        ]
                      }
                    }
                  },
                  "required": [
                    "product",
                    "count",
                    "stores"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          }
        }
      }
    },
    "/cart-link": {
      "get": {
        "operationId": "getCartLink",
        "tags": [
          "cart"
        ],
        "summary": "Build a gobrewing.com checkout link for the person to review and pay (places no order)",
        "parameters": [
          {
            "name": "items",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated <variant_id>:<quantity> pairs (1–10 items, quantity 1–24). variant_id comes from /beers/{handle}.",
            "example": "43000000000001:2"
          }
        ],
        "responses": {
          "200": {
            "description": "Checkout link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "size": {
                            "type": "string"
                          },
                          "quantity": {
                            "type": "integer"
                          },
                          "price_usd": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "subtotal_usd": {
                      "type": "number"
                    },
                    "note": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url",
                    "items",
                    "subtotal_usd"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "502": {
            "$ref": "#/components/responses/E502"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. `hint` says how to fix the request.",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "description": "Error code, e.g. INVALID_PARAMETER."
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "hint": {
            "type": "string"
          },
          "docs": {
            "type": "string"
          }
        },
        "required": [
          "title",
          "status",
          "detail"
        ]
      },
      "ProductSummary": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "handle": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "kind": {
            "type": "string",
            "enum": [
              "beer",
              "starter_kit",
              "hop_water"
            ]
          },
          "description": {
            "type": "string"
          },
          "crafted_without_gluten": {
            "type": "boolean"
          },
          "rating": {
            "type": [
              "number",
              "null"
            ]
          },
          "review_count": {
            "type": "integer"
          },
          "from_price_usd": {
            "type": [
              "number",
              "null"
            ]
          },
          "in_stock": {
            "type": "boolean"
          },
          "awards": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Medals and honors, e.g. \"2026 World Beer Cup · Bronze\"."
          }
        },
        "required": [
          "name",
          "handle",
          "url",
          "kind",
          "in_stock"
        ]
      }
    },
    "responses": {
      "E400": {
        "description": "The request has a missing or invalid parameter.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "E404": {
        "description": "Nothing matched.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "E429": {
        "description": "Rate limited. Wait 60 seconds.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "E502": {
        "description": "The catalog service is unavailable. Try again shortly.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    }
  }
}