{
  "openapi": "3.1.0",
  "info": {
    "title": "Apirro Demo Store (sandbox)",
    "version": "1.0.0",
    "description": "Public sandbox store operated by Apirro for testing AI shopping agents. All products are fictional, checkout is disabled, the store is not listed in any directory, and no orders or payments are ever created. Carts expire 24 hours after creation. REST endpoints allow 300 requests per minute per IP; friendly MCP and UCP MCP share a separate 300-per-minute bucket. Sample feeds: https://apirro.ai/m/demo/feeds/openai-product-feed.json and https://apirro.ai/m/demo/feeds/google-product-feed.xml. Display-only samples with [SAMPLE] titles, not submitted to any shopping program."
  },
  "servers": [
    {
      "url": "https://apirro.ai"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "catalog",
      "description": "Read-only store, product, FAQ and policy endpoints."
    },
    {
      "name": "cart",
      "description": "Sandbox carts; checkout is always refused."
    }
  ],
  "paths": {
    "/m/demo/feeds/openai-product-feed.json": {
      "get": {
        "operationId": "getOpenAiSampleFeed",
        "tags": [
          "catalog"
        ],
        "summary": "OpenAI product feed (sample)",
        "description": "Fictional display-only products; all eligibility flags are false. Not submitted to any program.",
        "responses": {
          "200": {
            "description": "Sample JSON feed.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "notice",
                    "sandbox",
                    "products"
                  ],
                  "properties": {
                    "notice": {
                      "type": "string"
                    },
                    "sandbox": {
                      "const": true
                    },
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo/feeds/google-product-feed.xml": {
      "get": {
        "operationId": "getGoogleSampleFeed",
        "tags": [
          "catalog"
        ],
        "summary": "Google Merchant feed (sample)",
        "description": "RSS 2.0 with Google product namespace, [SAMPLE] titles and all shopping destinations excluded. Not submitted to any program.",
        "responses": {
          "200": {
            "description": "Sample XML feed.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo": {
      "get": {
        "operationId": "getStore",
        "tags": [
          "catalog"
        ],
        "summary": "Store profile",
        "description": "Returns the sandbox store profile and its endpoint map.",
        "responses": {
          "200": {
            "description": "Store profile.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Store"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo/products": {
      "get": {
        "operationId": "searchProducts",
        "tags": [
          "catalog"
        ],
        "summary": "Search products",
        "description": "Lists or searches products; only items with availability `in_stock` and inventory above zero can be added to a cart.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text search over title and description.",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum products to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of products to skip for pagination.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching products.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo/product/{id}": {
      "get": {
        "operationId": "getProduct",
        "tags": [
          "catalog"
        ],
        "summary": "Get product",
        "description": "Returns one product with price, stock and attributes such as GTIN, delivery and returns.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product id from searchProducts.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The product.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "slug",
                    "product"
                  ],
                  "properties": {
                    "slug": {
                      "type": "string"
                    },
                    "sandbox": {
                      "type": "boolean"
                    },
                    "product": {
                      "$ref": "#/components/schemas/Product"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo/faq": {
      "get": {
        "operationId": "getStoreFaq",
        "tags": [
          "catalog"
        ],
        "summary": "Store FAQ",
        "description": "Returns the store's frequently asked questions.",
        "responses": {
          "200": {
            "description": "FAQ entries.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "slug": {
                      "type": "string"
                    },
                    "faq": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "q",
                          "a"
                        ],
                        "properties": {
                          "q": {
                            "type": "string"
                          },
                          "a": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo/policies": {
      "get": {
        "operationId": "getStorePolicies",
        "tags": [
          "catalog"
        ],
        "summary": "Store policies",
        "description": "Returns shipping, returns and checkout policies for the sandbox store.",
        "responses": {
          "200": {
            "description": "Policies.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "slug": {
                      "type": "string"
                    },
                    "sandbox": {
                      "type": "boolean"
                    },
                    "policies": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo/ucp/carts": {
      "post": {
        "operationId": "createCart",
        "tags": [
          "cart"
        ],
        "summary": "Create cart",
        "description": "Creates a sandbox cart; every product must be in stock and quantities cannot exceed available inventory.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemsInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Cart created.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cart"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo/ucp/carts/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Cart id returned by createCart.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "get": {
        "operationId": "getCart",
        "tags": [
          "cart"
        ],
        "summary": "Get cart",
        "description": "Returns the cart with line totals, subtotal, delivery and total.",
        "responses": {
          "200": {
            "description": "The cart with recalculated totals.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cart"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo/ucp/carts/{id}/items": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Cart id returned by createCart.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "addCartItem",
        "tags": [
          "cart"
        ],
        "summary": "Add items",
        "description": "Adds in-stock products to the cart, merging quantities for products already present.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ItemsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cart with recalculated totals.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cart"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo/ucp/carts/{id}/items/{lineId}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Cart id returned by createCart.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        },
        {
          "name": "lineId",
          "in": "path",
          "required": true,
          "description": "Line item id (`line_items[].id`).",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "patch": {
        "operationId": "updateCartItem",
        "tags": [
          "cart"
        ],
        "summary": "Update quantity",
        "description": "Sets a line's quantity (0 removes it); the new quantity must not exceed stock.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "quantity"
                ],
                "properties": {
                  "quantity": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 99,
                    "description": "New quantity; 0 removes the line."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cart with recalculated totals.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cart"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "removeCartItem",
        "tags": [
          "cart"
        ],
        "summary": "Remove line",
        "description": "Removes one line item from the cart.",
        "responses": {
          "200": {
            "description": "The cart with recalculated totals.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cart"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "410": {
            "$ref": "#/components/responses/Gone"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/m/demo/ucp/carts/{id}/checkout": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "description": "Cart id returned by createCart.",
          "schema": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "post": {
        "operationId": "checkout",
        "tags": [
          "cart"
        ],
        "summary": "Checkout (disabled)",
        "description": "Always refused in the sandbox: no order or payment is ever created.",
        "responses": {
          "403": {
            "description": "Checkout is disabled in the sandbox.",
            "headers": {
              "RateLimit-Limit": {
                "description": "Requests per minute per IP in this bucket.",
                "schema": {
                  "type": "integer",
                  "example": 300
                }
              },
              "RateLimit-Remaining": {
                "description": "Requests remaining in this minute.",
                "schema": {
                  "type": "integer"
                }
              },
              "Retry-After": {
                "description": "Seconds before retrying; 0 when allowed.",
                "schema": {
                  "type": "integer"
                }
              },
              "Access-Control-Allow-Origin": {
                "description": "Always `*`.",
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              },
              "Cache-Control": {
                "description": "Caching policy for this response.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": "sandbox_checkout_disabled",
                  "message": "sandbox: checkout disabled"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Money": {
        "type": "object",
        "required": [
          "amount",
          "currency",
          "display"
        ],
        "properties": {
          "amount": {
            "type": "integer",
            "description": "Amount in minor units (cents)."
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "display": {
            "type": "string",
            "example": "$189.00"
          },
          "rule": {
            "type": "string",
            "description": "Present on delivery: how delivery is priced."
          }
        }
      },
      "Product": {
        "type": "object",
        "required": [
          "id",
          "title",
          "price",
          "currency",
          "availability"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "Major units, e.g. 189 = $189.00."
          },
          "currency": {
            "type": "string"
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "ai_score": {
            "type": [
              "integer",
              "null"
            ]
          },
          "availability": {
            "type": "string",
            "enum": [
              "in_stock",
              "out_of_stock"
            ],
            "description": "Only `in_stock` products can be added to a cart."
          },
          "inventory_quantity": {
            "type": [
              "integer",
              "null"
            ]
          },
          "attributes": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "gtin": {
                "type": "string"
              },
              "brand": {
                "type": "string"
              },
              "returns": {
                "type": "string"
              },
              "delivery": {
                "type": "string"
              },
              "fictional": {
                "type": "boolean"
              }
            }
          },
          "self": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ProductList": {
        "type": "object",
        "required": [
          "products"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "sandbox": {
            "type": "boolean"
          },
          "query": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          }
        }
      },
      "CartLine": {
        "type": "object",
        "required": [
          "id",
          "item",
          "quantity",
          "unit_price",
          "line_total"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "item": {
            "type": "object",
            "required": [
              "id",
              "title"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "title": {
                "type": "string"
              },
              "sku": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "quantity": {
            "type": "integer",
            "minimum": 1
          },
          "unit_price": {
            "$ref": "#/components/schemas/Money"
          },
          "line_total": {
            "$ref": "#/components/schemas/Money"
          }
        }
      },
      "Cart": {
        "type": "object",
        "required": [
          "id",
          "status",
          "currency",
          "line_items",
          "totals",
          "checkout"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "example": "open"
          },
          "sandbox": {
            "type": "boolean"
          },
          "currency": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "line_items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CartLine"
            }
          },
          "totals": {
            "type": "object",
            "required": [
              "subtotal",
              "delivery",
              "total"
            ],
            "properties": {
              "subtotal": {
                "$ref": "#/components/schemas/Money"
              },
              "delivery": {
                "$ref": "#/components/schemas/Money"
              },
              "total": {
                "$ref": "#/components/schemas/Money"
              }
            },
            "description": "Delivery is free over $100.00, otherwise $8.00."
          },
          "checkout": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean",
                "const": false
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "ItemsInput": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "type": "object",
              "required": [
                "product_id"
              ],
              "properties": {
                "product_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 99,
                  "default": 1
                }
              }
            }
          }
        }
      },
      "Store": {
        "type": "object",
        "required": [
          "slug",
          "name"
        ],
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sandbox": {
            "type": "boolean"
          },
          "notice": {
            "type": "string"
          },
          "endpoints": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "retry_after": {
            "type": "integer"
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid input, out of stock or insufficient stock.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Product, cart or line not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Gone": {
        "description": "Cart expired (24 hours after creation).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "More than 300 requests per minute from this IP in the REST bucket.",
        "headers": {
          "RateLimit-Limit": {
            "description": "Requests per minute per IP in this bucket.",
            "schema": {
              "type": "integer",
              "example": 300
            }
          },
          "RateLimit-Remaining": {
            "description": "Requests remaining in this minute.",
            "schema": {
              "type": "integer"
            }
          },
          "Retry-After": {
            "description": "Seconds before retrying; 0 when allowed.",
            "schema": {
              "type": "integer"
            }
          },
          "Access-Control-Allow-Origin": {
            "description": "Always `*`.",
            "schema": {
              "type": "string",
              "example": "*"
            }
          },
          "Cache-Control": {
            "description": "Caching policy for this response.",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}