{
  "openapi": "3.1.0",
  "info": {
    "title": "Derech Eretz (deer.co.il) Storefront API",
    "version": "2026-12-03",
    "summary": "Public product, collection, search and cart API for the Derech Eretz outdoor & camping gear store.",
    "description": "Machine-readable description of the public API surface of deer.co.il (דרך ארץ ציוד טיולים), an outdoor, hiking and camping gear store built on Shopify.\n\n- Read-only catalog endpoints (products, collections, search) need no authentication.\n- Cart endpoints act on the anonymous session cart identified by the `cart` cookie.\n- The Storefront GraphQL endpoint accepts tokenless requests for public catalog and cart data.\n- Agent shopping (catalog search, carts, checkout) is available through the UCP MCP server at /api/ucp/mcp; see https://deer.co.il/agents.md and https://deer.co.il/.well-known/ucp.\n- Buyer-authenticated actions use OAuth 2.0 (authorization code + PKCE) with the scopes declared in `components.securitySchemes.customerAccount`.\n\nPlace orders and submit payment only with the buyer's explicit authorization. Identify agent traffic with Web Bot Auth and back off on HTTP 429 (respect Retry-After).",
    "contact": { "name": "Derech Eretz", "url": "https://deer.co.il/pages/contact" },
    "termsOfService": "https://deer.co.il/policies/terms-of-service"
  },
  "externalDocs": { "description": "Developer docs: API & MCP server", "url": "https://deer.co.il/pages/api" },
  "servers": [ { "url": "https://deer.co.il", "description": "Production storefront" } ],
  "security": [ {} ],
  "tags": [
    { "name": "Catalog", "description": "Products and collections (read-only, public)." },
    { "name": "Search", "description": "Predictive search (read-only, public)." },
    { "name": "Cart", "description": "Session cart (cookie based)." },
    { "name": "GraphQL", "description": "Shopify Storefront GraphQL API." },
    { "name": "MCP", "description": "UCP Model Context Protocol server for AI agents." }
  ],
  "paths": {
    "/products.json": {
      "get": {
        "tags": ["Catalog"],
        "operationId": "listProducts",
        "summary": "List products",
        "security": [ {} ],
        "parameters": [
          { "$ref": "#/components/parameters/limit" },
          { "$ref": "#/components/parameters/page" }
        ],
        "responses": {
          "200": { "description": "A page of products.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductList" } } } },
          "429": { "$ref": "#/components/responses/TooManyRequests" }
        }
      }
    },
    "/products/{handle}.js": {
      "get": {
        "tags": ["Catalog"],
        "operationId": "getProduct",
        "summary": "Get a product by handle",
        "security": [ {} ],
        "parameters": [ { "$ref": "#/components/parameters/handle" } ],
        "responses": {
          "200": { "description": "The product, prices in agorot (minor units).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Product" } } } },
          "404": { "description": "No product with this handle." },
          "429": { "$ref": "#/components/responses/TooManyRequests" }
        }
      }
    },
    "/collections/{handle}/products.json": {
      "get": {
        "tags": ["Catalog"],
        "operationId": "listCollectionProducts",
        "summary": "List products in a collection",
        "description": "Use the handle `all` for the whole catalog. Main collections include clothing-and-footwear, bags-and-travel-gear, tents-sleeping-bags-and-camping-gear, camping-cookware, electronics-and-accessories, extreme-sports-equipment, new-arrivals and on-sale.",
        "security": [ {} ],
        "parameters": [
          { "name": "handle", "in": "path", "required": true, "schema": { "type": "string", "example": "tents-sleeping-bags-and-camping-gear" } },
          { "$ref": "#/components/parameters/limit" },
          { "$ref": "#/components/parameters/page" }
        ],
        "responses": {
          "200": { "description": "A page of products.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProductList" } } } },
          "404": { "description": "No collection with this handle." },
          "429": { "$ref": "#/components/responses/TooManyRequests" }
        }
      }
    },
    "/search/suggest.json": {
      "get": {
        "tags": ["Search"],
        "operationId": "searchSuggest",
        "summary": "Predictive search",
        "security": [ {} ],
        "parameters": [
          { "name": "q", "in": "query", "required": true, "schema": { "type": "string", "example": "אוהל" } },
          { "name": "resources[type]", "in": "query", "schema": { "type": "string", "default": "product", "example": "product,collection,page,article,query" } },
          { "name": "resources[limit]", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 10, "default": 10 } }
        ],
        "responses": {
          "200": { "description": "Search suggestions.", "content": { "application/json": { "schema": { "type": "object", "properties": { "resources": { "type": "object", "properties": { "results": { "type": "object", "additionalProperties": true } } } } } } } },
          "429": { "$ref": "#/components/responses/TooManyRequests" }
        }
      }
    },
    "/cart.js": {
      "get": {
        "tags": ["Cart"],
        "operationId": "getCart",
        "summary": "Get the current session cart",
        "security": [ { "cartCookie": [] } ],
        "responses": {
          "200": { "description": "The cart.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Cart" } } } }
        }
      }
    },
    "/cart/add.js": {
      "post": {
        "tags": ["Cart"],
        "operationId": "addToCart",
        "summary": "Add variants to the session cart",
        "security": [ { "cartCookie": [] } ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["items"],
                "properties": {
                  "items": { "type": "array", "items": { "type": "object", "required": ["id", "quantity"], "properties": { "id": { "type": "integer", "description": "Variant ID" }, "quantity": { "type": "integer", "minimum": 1 } } } }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "The added line items.", "content": { "application/json": { "schema": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/CartLine" } } } } } } },
          "422": { "description": "Variant unavailable or out of stock." }
        }
      }
    },
    "/api/2026-10/graphql.json": {
      "post": {
        "tags": ["GraphQL"],
        "operationId": "storefrontGraphql",
        "summary": "Shopify Storefront GraphQL API",
        "description": "Tokenless access works for public catalog and cart queries. A Storefront access token raises limits. Schema reference: https://shopify.dev/docs/api/storefront",
        "security": [ {}, { "storefrontToken": [] } ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GraphQLRequest" }, "example": { "query": "{ products(first: 5, query: \"אוהל\") { nodes { title handle priceRange { minVariantPrice { amount currencyCode } } } } }" } } }
        },
        "responses": {
          "200": { "description": "GraphQL response.", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" }, "errors": { "type": "array", "items": { "type": "object" } } } } } } },
          "429": { "$ref": "#/components/responses/TooManyRequests" }
        }
      }
    },
    "/api/ucp/mcp": {
      "post": {
        "tags": ["MCP"],
        "operationId": "ucpMcp",
        "summary": "UCP MCP server (JSON-RPC 2.0)",
        "description": "Model Context Protocol endpoint implementing the Universal Commerce Protocol (https://ucp.dev). Call `tools/list` for the current tools and schemas. Store profile: https://deer.co.il/.well-known/ucp. Protected-resource metadata: https://deer.co.il/.well-known/oauth-protected-resource. Docs: https://deer.co.il/pages/mcp",
        "security": [ {}, { "customerAccount": ["dev.ucp.shopping.catalog.search:read"] }, { "customerAccount": ["dev.ucp.shopping.checkout:manage"] } ],
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JsonRpcRequest" }, "example": { "jsonrpc": "2.0", "id": 1, "method": "tools/list" } } }
        },
        "responses": {
          "200": { "description": "JSON-RPC response.", "content": { "application/json": { "schema": { "type": "object" } } } },
          "401": { "description": "Buyer authentication required for this tool." },
          "429": { "$ref": "#/components/responses/TooManyRequests" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "customerAccount": {
        "type": "oauth2",
        "description": "Buyer (customer account) OAuth 2.0, authorization code flow with PKCE (S256). Authorization server metadata: https://shopify.com/authentication/76661260512/.well-known/openid-configuration",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://shopify.com/authentication/76661260512/oauth/authorize",
            "tokenUrl": "https://shopify.com/authentication/76661260512/oauth/token",
            "scopes": {
              "openid": "Sign the buyer in (OpenID Connect).",
              "email": "Read the buyer's email address.",
              "customer-account-api:full": "Customer Account API: orders, addresses and profile of the signed-in buyer.",
              "customer-account-mcp-api:full": "Customer account MCP tools for the signed-in buyer.",
              "dev.ucp.shopping.catalog.search:read": "UCP: search the catalog on the buyer's behalf.",
              "dev.ucp.shopping.checkout:manage": "UCP: create and update carts and checkouts on the buyer's behalf."
            }
          }
        }
      },
      "openIdConnect": {
        "type": "openIdConnect",
        "openIdConnectUrl": "https://shopify.com/authentication/76661260512/.well-known/openid-configuration"
      },
      "storefrontToken": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Shopify-Storefront-Access-Token",
        "description": "Optional Storefront API access token (higher limits). Not needed for public catalog queries."
      },
      "cartCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "cart",
        "description": "Anonymous session cart. Set automatically by the first cart request."
      }
    },
    "parameters": {
      "handle": { "name": "handle", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Product handle as in /products/{handle}." },
      "limit": { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 250, "default": 30 } },
      "page": { "name": "page", "in": "query", "schema": { "type": "integer", "minimum": 1, "default": 1 } }
    },
    "responses": {
      "TooManyRequests": { "description": "Rate limited. Back off and respect the Retry-After header.", "headers": { "Retry-After": { "schema": { "type": "integer" } } } }
    },
    "schemas": {
      "ProductList": { "type": "object", "properties": { "products": { "type": "array", "items": { "$ref": "#/components/schemas/Product" } } } },
      "Product": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "title": { "type": "string" },
          "handle": { "type": "string" },
          "body_html": { "type": "string" },
          "vendor": { "type": "string", "description": "Brand" },
          "product_type": { "type": "string" },
          "tags": { "oneOf": [ { "type": "array", "items": { "type": "string" } }, { "type": "string" } ] },
          "variants": { "type": "array", "items": { "$ref": "#/components/schemas/Variant" } },
          "images": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
          "options": { "type": "array", "items": { "type": "object", "additionalProperties": true } }
        },
        "additionalProperties": true
      },
      "Variant": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "title": { "type": "string" },
          "sku": { "type": ["string", "null"] },
          "price": { "type": ["string", "integer"], "description": "ILS. String (e.g. \"199.00\") in .json endpoints, integer agorot in .js endpoints." },
          "available": { "type": "boolean" }
        },
        "additionalProperties": true
      },
      "Cart": {
        "type": "object",
        "properties": {
          "token": { "type": "string" },
          "item_count": { "type": "integer" },
          "total_price": { "type": "integer", "description": "Agorot (ILS minor units)." },
          "currency": { "type": "string", "example": "ILS" },
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/CartLine" } }
        },
        "additionalProperties": true
      },
      "CartLine": {
        "type": "object",
        "properties": {
          "variant_id": { "type": "integer" },
          "quantity": { "type": "integer" },
          "title": { "type": "string" },
          "price": { "type": "integer", "description": "Agorot." }
        },
        "additionalProperties": true
      },
      "GraphQLRequest": { "type": "object", "required": ["query"], "properties": { "query": { "type": "string" }, "variables": { "type": "object" } } },
      "JsonRpcRequest": { "type": "object", "required": ["jsonrpc", "method"], "properties": { "jsonrpc": { "const": "2.0" }, "id": { "type": ["integer", "string"] }, "method": { "type": "string", "example": "tools/list" }, "params": { "type": "object" } } }
    }
  }
}
