{
  "openapi": "3.1.0",
  "info": {
    "title": "Agora commerce reference",
    "version": "0.1.0",
    "description": "Selected routes from the supplied Agora source contract. Confirm the deployed contract, authentication and permissions before use."
  },
  "servers": [
    {
      "url": "/v1",
      "description": "API v1"
    }
  ],
  "paths": {
    "/payments/authorize": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Authorize payment",
        "responses": {
          "201": {
            "description": "Authorized"
          }
        }
      }
    },
    "/payments/capture": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Capture payment",
        "responses": {
          "200": {
            "description": "Captured"
          }
        }
      }
    },
    "/payments/refund": {
      "post": {
        "tags": [
          "Payments"
        ],
        "summary": "Refund payment",
        "responses": {
          "200": {
            "description": "Refunded"
          }
        }
      }
    },
    "/payments/transactions/{orderId}": {
      "get": {
        "tags": [
          "Payments"
        ],
        "summary": "List transactions for order",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transactions"
          }
        }
      }
    },
    "/admin/returns": {
      "get": {
        "tags": [
          "Returns"
        ],
        "summary": "GET /admin/returns",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/admin/returns/{id}": {
      "get": {
        "tags": [
          "Returns"
        ],
        "summary": "GET /admin/returns/{id}",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/admin/returns/{id}/approve": {
      "post": {
        "tags": [
          "Returns"
        ],
        "summary": "POST /admin/returns/{id}/approve",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/admin/returns/{id}/mark-received": {
      "post": {
        "tags": [
          "Returns"
        ],
        "summary": "POST /admin/returns/{id}/mark-received",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/admin/returns/{id}/restock": {
      "post": {
        "tags": [
          "Returns"
        ],
        "summary": "POST /admin/returns/{id}/restock",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/admin/returns/{id}/reject": {
      "post": {
        "tags": [
          "Returns"
        ],
        "summary": "POST /admin/returns/{id}/reject",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/b2b/companies": {
      "post": {
        "tags": [
          "b2b-accounts"
        ],
        "summary": "POST /b2b/companies",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      },
      "get": {
        "tags": [
          "b2b-accounts"
        ],
        "summary": "GET /b2b/companies",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/quotes": {
      "post": {
        "tags": [
          "quotes"
        ],
        "summary": "POST /quotes",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      },
      "get": {
        "tags": [
          "quotes"
        ],
        "summary": "GET /quotes",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/pricing/price-lists": {
      "get": {
        "tags": [
          "Pricing"
        ],
        "summary": "List price lists",
        "responses": {
          "200": {
            "description": "Price lists"
          }
        }
      },
      "post": {
        "tags": [
          "Pricing"
        ],
        "summary": "Create price list",
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/pos/sales/from-quote": {
      "post": {
        "tags": [
          "pos"
        ],
        "summary": "POST /pos/sales/from-quote",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/settlements": {
      "get": {
        "tags": [
          "settlements"
        ],
        "summary": "GET /settlements",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/settlements/orders/{orderId}/settle": {
      "post": {
        "tags": [
          "settlements"
        ],
        "summary": "POST /settlements/orders/{orderId}/settle",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/admin/financial/settlements/status": {
      "get": {
        "tags": [
          "financial"
        ],
        "summary": "GET /admin/financial/settlements/status",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/admin/orders/{id}/refund": {
      "post": {
        "tags": [
          "Admin / Orders"
        ],
        "summary": "POST /admin/orders/{id}/refund",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/admin/returns/{id}/refund": {
      "post": {
        "tags": [
          "Returns"
        ],
        "summary": "POST /admin/returns/{id}/refund",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/admin/analytics/commerce/refunds": {
      "get": {
        "tags": [
          "analytics"
        ],
        "summary": "GET /admin/analytics/commerce/refunds",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/products": {
      "post": {
        "tags": [
          "Catalog"
        ],
        "summary": "Create product",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "slug",
                  "displayName",
                  "defaultLocale",
                  "defaultCurrency"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "displayName": {
                    "type": "string"
                  },
                  "defaultLocale": {
                    "type": "string"
                  },
                  "defaultCurrency": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "brandId": {
                    "type": "string"
                  },
                  "defaultCategoryId": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      },
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "List products",
        "parameters": [
          {
            "name": "filter[status]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[type]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[brand_id]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter[search]",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Server-side ordering. `units_sold` / `revenue` / `stock` are rolled up from orders + inventory; every key is paired with `id` so pagination is stable. An unknown value is ignored and the default `-updated_at` applies.",
            "schema": {
              "type": "string",
              "enum": [
                "created_at",
                "-created_at",
                "updated_at",
                "-updated_at",
                "display_name",
                "-display_name",
                "price",
                "-price",
                "status",
                "-status",
                "stock",
                "-stock",
                "units_sold",
                "-units_sold",
                "revenue",
                "-revenue",
                "position",
                "-position"
              ]
            }
          },
          {
            "name": "include",
            "in": "query",
            "description": "Comma-separated. `metrics` attaches per-product sales + stock (units sold, revenue as an integer-minor STRING, on-hand, reorder point, and the unambiguous stock-adjust target when there is exactly one).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "metrics_window_days",
            "in": "query",
            "description": "Sales lookback for `include=metrics`. `0` = all time. Default 90.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 3650
            }
          },
          {
            "name": "page[size]",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page[after]",
            "in": "query",
            "description": "Opaque keyset cursor from the previous response. Valid only for the sort it was minted under; drop it when the sort or a filter changes.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product list"
          }
        },
        "security": []
      }
    },
    "/products/{id}": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "Get product",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product"
          },
          "404": {
            "description": "Not found"
          }
        },
        "security": []
      },
      "patch": {
        "tags": [
          "Catalog"
        ],
        "summary": "Update product",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      },
      "delete": {
        "tags": [
          "Catalog"
        ],
        "summary": "Delete product (soft)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          }
        }
      }
    },
    "/customers": {
      "post": {
        "tags": [
          "Customers"
        ],
        "summary": "Create customer",
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      },
      "get": {
        "tags": [
          "Customers"
        ],
        "summary": "List customers",
        "responses": {
          "200": {
            "description": "Customers"
          }
        }
      }
    },
    "/orders": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Place order from cart",
        "responses": {
          "201": {
            "description": "Order placed"
          }
        }
      },
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "List orders",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customer_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orders"
          }
        }
      }
    },
    "/orders/{id}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Get order with items",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order"
          }
        }
      }
    },
    "/inventory/locations": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "List locations",
        "responses": {
          "200": {
            "description": "Locations"
          }
        }
      },
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "Create location",
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/inventory/locations/{id}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "GET /inventory/locations/{id}",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      },
      "patch": {
        "tags": [
          "Inventory"
        ],
        "summary": "PATCH /inventory/locations/{id}",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/inventory/stock/{variantId}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Get stock level",
        "parameters": [
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Stock level"
          }
        }
      }
    },
    "/inventory/availability/{variantId}": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "Check availability",
        "parameters": [
          {
            "name": "variantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Availability"
          }
        }
      }
    },
    "/inventory/movements": {
      "get": {
        "tags": [
          "Inventory"
        ],
        "summary": "GET /inventory/movements",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/inventory/receive": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "POST /inventory/receive",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/inventory/adjust": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "Adjust stock",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "variantId",
                  "locationId",
                  "quantity"
                ],
                "properties": {
                  "variantId": {
                    "type": "string"
                  },
                  "locationId": {
                    "type": "string"
                  },
                  "quantity": {
                    "type": "integer"
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Adjusted"
          }
        }
      }
    },
    "/inventory/transfer": {
      "post": {
        "tags": [
          "Inventory"
        ],
        "summary": "POST /inventory/transfer",
        "x-schema-status": "TBD",
        "description": "This endpoint is exposed by the API but has not yet been documented with a request/response schema. Tracked as **FU-DOC-API-1**. Until then, consult the route source and core service contracts.",
        "responses": {
          "200": {
            "description": "Documented response (schema TBD)"
          },
          "4XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          },
          "5XX": {
            "description": "Standard error envelope - see components.schemas.Error"
          }
        }
      }
    },
    "/webhooks": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Register webhook endpoint",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "eventTypes"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "eventTypes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "secret": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Registered"
          }
        }
      },
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook endpoints",
        "responses": {
          "200": {
            "description": "Endpoints"
          }
        }
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deliveries"
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send test webhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Test sent"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "tenantHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Tenant-Id",
        "description": "Tenant UUID"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object"
              }
            }
          }
        }
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "displayId": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "simple",
              "configurable",
              "bundle",
              "virtual",
              "downloadable"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "published",
              "archived",
              "deleted"
            ]
          },
          "version": {
            "type": "integer"
          },
          "displayName": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "defaultLocale": {
            "type": "string"
          },
          "defaultCurrency": {
            "type": "string"
          }
        }
      },
      "Brand": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "Category": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "parentId": {
            "type": "string",
            "nullable": true
          },
          "depth": {
            "type": "integer"
          },
          "path": {
            "type": "string"
          }
        }
      },
      "Variant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "productId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "optionValues": {
            "type": "object"
          }
        }
      },
      "Order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "orderNumber": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "processing",
              "shipped",
              "delivered",
              "cancelled",
              "refunded"
            ]
          },
          "totalAmount": {
            "type": "integer",
            "description": "Minor units"
          },
          "currency": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderItem"
            }
          }
        }
      },
      "Cart": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "description": "ISO 4217"
          },
          "itemCount": {
            "type": "integer"
          },
          "subtotalAmount": {
            "type": "integer",
            "description": "Minor units"
          },
          "discountAmount": {
            "type": "integer",
            "description": "Minor units"
          },
          "taxAmount": {
            "type": "integer",
            "description": "Minor units"
          },
          "shippingAmount": {
            "type": "integer",
            "description": "Minor units"
          },
          "totalAmount": {
            "type": "integer",
            "description": "Minor units"
          },
          "metadata": {
            "type": "object"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "convertedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "orderId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "mergedIntoCartId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "version": {
            "type": "integer"
          },
          "lastActivityAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CartItem"
            }
          }
        }
      },
      "ProductFacetBucket": {
        "type": "object",
        "properties": {
          "value": {
            "type": "string",
            "description": "The id or enum value to filter by."
          },
          "label": {
            "type": "string",
            "description": "Display name; falls back to value."
          },
          "count": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "ProductFacets": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "brand": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductFacetBucket"
            }
          },
          "category": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductFacetBucket"
            }
          },
          "vendor": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductFacetBucket"
            }
          },
          "type": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductFacetBucket"
            }
          },
          "price": {
            "type": [
              "object",
              "null"
            ],
            "description": "Null when no matching product carries a default price.",
            "properties": {
              "min": {
                "type": "integer",
                "description": "Minor units"
              },
              "max": {
                "type": "integer",
                "description": "Minor units"
              },
              "currency": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "CartItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "cartId": {
            "type": "string",
            "format": "uuid"
          },
          "variantId": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "integer"
          },
          "unitPriceAmount": {
            "type": "integer",
            "description": "Minor units"
          },
          "unitPriceCurrency": {
            "type": "string"
          },
          "compareAtAmount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Minor units"
          },
          "productName": {
            "type": "string"
          },
          "variantName": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": "string"
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "optionValues": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "reservationId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "lineStatus": {
            "type": "string"
          },
          "metadata": {
            "type": "object"
          },
          "addedAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OrderItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "variantId": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "quantity": {
            "type": "integer"
          },
          "unitPriceAmount": {
            "type": "integer",
            "description": "Minor units"
          },
          "totalAmount": {
            "type": "integer",
            "description": "Minor units"
          },
          "currency": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "variantName": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": "string"
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "optionValues": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "fulfillmentStatus": {
            "type": "string"
          },
          "quantityFulfilled": {
            "type": "integer"
          },
          "quantityRefunded": {
            "type": "integer"
          },
          "metadata": {
            "type": "object"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Address": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "company": {
            "type": [
              "string",
              "null"
            ]
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": [
              "string",
              "null"
            ]
          },
          "postalCode": {
            "type": "string"
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Media": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "bucket": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "description": "image | video | document | model3d"
          },
          "objectKey": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer"
          },
          "sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "altText": {
            "type": [
              "string",
              "null"
            ]
          },
          "publicUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "status": {
            "type": "string"
          },
          "folderId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "finalizedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ShippingMethod": {
        "type": "object",
        "properties": {
          "rateId": {
            "type": "string"
          },
          "methodId": {
            "type": "string",
            "format": "uuid"
          },
          "methodSlug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount": {
            "type": "integer",
            "description": "Minor units"
          },
          "currency": {
            "type": "string"
          },
          "estimatedDaysMin": {
            "type": [
              "integer",
              "null"
            ]
          },
          "estimatedDaysMax": {
            "type": [
              "integer",
              "null"
            ]
          },
          "carrier": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Review": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "productId": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "orderId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "rating": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "helpfulCount": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ReviewAggregate": {
        "type": "object",
        "properties": {
          "averageRating": {
            "type": "number"
          },
          "total": {
            "type": "integer"
          },
          "ratingBreakdown": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "minItems": 5,
            "maxItems": 5,
            "description": "Index 0 is 1-star, index 4 is 5-star."
          }
        }
      },
      "PaymentMethod": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "isDefault": {
            "type": "boolean"
          },
          "lastFour": {
            "type": [
              "string",
              "null"
            ]
          },
          "brand": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Customer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "StockLevel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "variantId": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "quantityOnHand": {
            "type": "integer"
          },
          "quantityAvailable": {
            "type": "integer"
          }
        }
      },
      "Price": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "variantId": {
            "type": "string"
          },
          "amount": {
            "type": "integer",
            "description": "Minor units (cents)"
          },
          "currency": {
            "type": "string"
          }
        }
      },
      "Promotion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "percentage",
              "fixed_amount",
              "free_shipping",
              "buy_x_get_y"
            ]
          },
          "status": {
            "type": "string"
          }
        }
      }
    },
    "parameters": {
      "tenantId": {
        "name": "X-Tenant-Id",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      }
    }
  }
}