{
  "openapi": "3.1.0",
  "info": {
    "title": "boutiquerugs.com Storefront API",
    "summary": "Machine-callable storefront API for boutiquerugs.com.",
    "description": "Public Shopify Ajax endpoints for catalog browse, cart management, and checkout handoff.",
    "version": "1.0.0",
    "contact": {
      "name": "boutiquerugs.com",
      "email": null,
      "url": "https://boutiquerugs.com"
    },
    "x-machine-payment-protocol": {
      "version": "0.1",
      "checkout_handoff": {
        "type": "redirect",
        "url": "https://boutiquerugs.com/checkout",
        "description": "After cart is built, the agent must redirect the user to this URL."
      },
      "supported_payment_methods": [
        "card",
        "shop_pay",
        "apple_pay",
        "google_pay",
        "paypal"
      ],
      "currency": "USD",
      "currencies_supported": [
        "USD"
      ],
      "tax_inclusive": false,
      "shipping_required": true,
      "agent_capabilities": {
        "build_cart": true,
        "complete_payment": false,
        "view_invoice": false,
        "subscribe": false,
        "refund": false
      },
      "auth": {
        "cart_session": "cookie",
        "customer_account": "oauth2",
        "oauth_protected_resource": "https://boutiquerugs.com/.well-known/oauth-protected-resource"
      }
    }
  },
  "x-service-info": {
    "categories": [
      "commerce",
      "catalog",
      "checkout"
    ],
    "docs": {
      "homepage": "https://boutiquerugs.com",
      "apiReference": "https://boutiquerugs.com/.well-known/openapi.json"
    }
  },
  "servers": [
    {
      "url": "https://boutiquerugs.com",
      "description": "boutiquerugs.com storefront"
    }
  ],
  "tags": [
    {
      "name": "catalog",
      "description": "Browse products and collections"
    },
    {
      "name": "cart",
      "description": "Build and modify the cart session"
    },
    {
      "name": "checkout",
      "description": "Hand off to Shopify hosted checkout"
    },
    {
      "name": "policy",
      "description": "Store policies"
    }
  ],
  "paths": {
    "/search/suggest.json": {
      "get": {
        "tags": [
          "catalog"
        ],
        "operationId": "searchProducts",
        "summary": "Predictive product search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resources[type]",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "const": "product"
            }
          },
          {
            "name": "resources[limit]",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10,
              "maximum": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching products",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/products/{handle}.json": {
      "get": {
        "tags": [
          "catalog"
        ],
        "operationId": "getProduct",
        "summary": "Get product detail",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product detail",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "Product not found"
          }
        }
      }
    },
    "/products.json": {
      "get": {
        "tags": [
          "catalog"
        ],
        "operationId": "listProducts",
        "summary": "List products (paginated)",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 30,
              "maximum": 250
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product list",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/collections.json": {
      "get": {
        "tags": [
          "catalog"
        ],
        "operationId": "listCollections",
        "summary": "List collections",
        "responses": {
          "200": {
            "description": "Collection list",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/collections/{handle}/products.json": {
      "get": {
        "tags": [
          "catalog"
        ],
        "operationId": "getCollectionProducts",
        "summary": "Get products in a collection",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Products in collection",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/cart.js": {
      "get": {
        "tags": [
          "cart"
        ],
        "operationId": "getCart",
        "summary": "Get current cart",
        "responses": {
          "200": {
            "description": "Cart state",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/cart/add.js": {
      "post": {
        "tags": [
          "cart"
        ],
        "operationId": "addToCart",
        "summary": "Add item to cart",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "default": 1
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  }
                },
                "required": [
                  "items"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated line items",
            "content": {
              "application/json": {}
            }
          },
          "422": {
            "description": "Variant unavailable"
          }
        }
      }
    },
    "/cart/update.js": {
      "post": {
        "tags": [
          "cart"
        ],
        "operationId": "updateCart",
        "summary": "Update cart line quantities",
        "responses": {
          "200": {
            "description": "Updated cart"
          }
        }
      }
    },
    "/cart/clear.js": {
      "post": {
        "tags": [
          "cart"
        ],
        "operationId": "clearCart",
        "summary": "Clear the cart",
        "responses": {
          "200": {
            "description": "Empty cart"
          }
        }
      }
    },
    "/checkout": {
      "get": {
        "tags": [
          "checkout"
        ],
        "operationId": "startCheckout",
        "summary": "Start checkout (redirect)",
        "x-machine-payment-handoff": true,
        "x-payment-info": {
          "intent": "charge",
          "method": "card",
          "amount": "100",
          "currency": "USD",
          "description": "Full product feed (single charge)",
          "x-payment-alternates": [
            {
              "intent": "charge",
              "method": "lightning",
              "amount": "1000",
              "currency": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
              "description": "x402 micropayment on base-sepolia"
            }
          ]
        },
        "responses": {
          "302": {
            "description": "Redirect to hosted checkout",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "402": {
            "description": "Payment required for direct agent checkout. Retry with one of the methods in x-payment-info.",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/api/v1": {
      "get": {
        "tags": [
          "catalog"
        ],
        "operationId": "getPaidProductFeed",
        "summary": "Paid full-catalog product feed (x402 / MPP)",
        "description": "Returns the full product catalog as a single JSON document. Gated by HTTP 402 Payment Required; pay via x402 (USDC) or any MPP-compatible offer advertised below.",
        "x-payment-info": {
          "intent": "charge",
          "method": "card",
          "amount": "100",
          "currency": "USD",
          "description": "Full product feed (single charge)",
          "x-payment-alternates": [
            {
              "intent": "charge",
              "method": "lightning",
              "amount": "1000",
              "currency": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
              "description": "x402 micropayment on base-sepolia"
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Full product feed",
            "content": {
              "application/json": {}
            }
          },
          "402": {
            "description": "Payment required. Body advertises x402 payment requirements; retry with X-PAYMENT header.",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/policies/{handle}": {
      "get": {
        "tags": [
          "policy"
        ],
        "operationId": "getPolicy",
        "summary": "Get a store policy",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "shipping-policy",
                "refund-policy",
                "privacy-policy",
                "terms-of-service"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Policy HTML",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "cartCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "cart"
      },
      "customerOAuth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://shopify.com/authentication/55087005888/oauth/authorize",
            "tokenUrl": "https://shopify.com/authentication/55087005888/oauth/token",
            "scopes": {
              "openid": "OpenID Connect",
              "email": "Customer email",
              "customer-account-api:full": "Full customer account access"
            }
          }
        }
      }
    }
  }
}