{
  "openapi": "3.1.1",
  "info": {
    "title": "1stBuddha public discovery and customer API",
    "version": "1.1.0",
    "description": "Read public store information without authentication. Customer account access requires an existing registered Shopify client, a consenting customer and the named scopes. This specification documents existing Shopify endpoints and grants no additional permissions.",
    "contact": {
      "url": "https://1stbuddha.com/pages/contact"
    }
  },
  "servers": [
    {
      "url": "https://1stbuddha.com"
    }
  ],
  "security": [],
  "externalDocs": {
    "description": "1stBuddha API documentation, quickstart and CLI",
    "url": "https://1stbuddha.com/developers"
  },
  "paths": {
    "/products/{handle}.js": {
      "get": {
        "operationId": "getPublicProduct",
        "summary": "Read a public Shopify product",
        "description": "Prices are currency subunits. Use the market/currency context and recheck availability before purchase. For checkout use the UCP service advertised by /.well-known/ucp.",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[a-z0-9][a-z0-9-]{0,254}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shopify Ajax product JSON. The existing storefront serves this JSON body with text/javascript; some Shopify contexts use application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProduct"
                }
              },
              "text/javascript": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProduct"
                }
              }
            }
          },
          "404": {
            "description": "Product not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/customer/api/2026-10/graphql": {
      "servers": [
        {
          "url": "https://account.1stbuddha.nl"
        }
      ],
      "post": {
        "operationId": "queryOwnCustomerAccount",
        "summary": "Access the authenticated customer's own Shopify account",
        "description": "Existing Shopify Customer Account GraphQL endpoint. Requires a registered client and a customer-authorized access token. The platform supplies a bundled account scope; request only catalog scopes for public shopping. This document does not enable or change account operations.",
        "security": [
          {
            "ShopifyCustomerOAuth": [
              "openid",
              "email",
              "customer-account-api:full"
            ]
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string"
                  },
                  "variables": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": true
                  },
                  "operationName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "GraphQL response; errors can be returned alongside data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "application/graphql-response+json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid customer access token",
            "content": {
              "application/graphql-response+json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/products/{handle}": {
      "get": {
        "operationId": "getProduct",
        "summary": "Read a public 1stBuddha product as JSON",
        "description": "Read the current public Shopify product. No API key is required. Prices are integer currency subunits in the storefront market context; checkout totals are authoritative. Missing products return RFC 9457 problem details. This endpoint provides no writes.",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "pattern": "^[a-z0-9][a-z0-9-]{0,254}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current public Shopify Ajax product data, served as JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProduct"
                }
              }
            }
          },
          "400": {
            "description": "Invalid product handle",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "Product or API route not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Origin rate limit; honor Retry-After",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "Shopify product data temporarily unavailable",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ShopifyCustomerOAuth": {
        "type": "oauth2",
        "description": "Existing Shopify authorization code flow. Use PKCE S256, state and nonce and registered redirect URIs. No credentials are published here.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://account.1stbuddha.nl/authentication/oauth/authorize",
            "tokenUrl": "https://account.1stbuddha.nl/authentication/oauth/token",
            "scopes": {
              "openid": "Identify the consenting customer with OpenID Connect.",
              "email": "Read the consenting customer's email claim.",
              "customer-account-api:full": "Access the consenting customer's own Customer Account API. Shopify exposes a bundled account scope.",
              "customer-account-mcp-api:full": "Access the consenting customer's own Customer Account MCP API.",
              "dev.ucp.shopping.checkout:manage": "Manage a buyer-authorized UCP checkout. Payment remains subject to buyer approval.",
              "dev.ucp.shopping.catalog.search:read": "Search the UCP product catalog."
            }
          }
        }
      }
    },
    "schemas": {
      "PublicProduct": {
        "type": "object",
        "required": [
          "id",
          "title",
          "handle",
          "variants"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "handle": {
            "type": "string"
          },
          "price": {
            "type": "integer",
            "description": "Price in currency subunits."
          },
          "available": {
            "type": "boolean"
          },
          "variants": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "Problem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "resolution"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "resolution": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-scope-source": "https://account.1stbuddha.nl/.well-known/openid-configuration",
  "x-verified-date": "2026-10-08",
  "x-discovery": {
    "ucp": "https://1stbuddha.com/.well-known/ucp",
    "permissions": "https://1stbuddha.com/.well-known/oauth-protected-resource",
    "sitemap": "https://1stbuddha.com/sitemap.xml",
    "agentGuide": "https://1stbuddha.com/llms.txt"
  }
}
