{
  "openapi": "3.0.3",
  "info": {
    "title": "Shoprivet Ecommerce API",
    "version": "1.0.0",
    "description": "Public Storefront API and Merchant Management REST API for Shoprivet.io. Keep merchant API keys (shoprivet_live_...) strictly on your server; use unauthenticated /public/stores/{slug} routes and guest cart credentials for browser storefronts.",
    "termsOfService": "https://shoprivet.io/terms-of-service",
    "contact": {
      "name": "Shoprivet Support",
      "url": "https://shoprivet.io/docs",
      "email": "support@shoprivet.io"
    }
  },
  "servers": [
    {
      "url": "https://api.shoprivet.io",
      "description": "Shoprivet Production API"
    }
  ],
  "tags": [
    {
      "name": "Public Storefront",
      "description": "Unauthenticated catalog, store metadata, widget runtime, enquiries, and paid digital file downloads."
    },
    {
      "name": "Public Carts",
      "description": "Server-side guest shopping carts scoped by cart bearer credential."
    },
    {
      "name": "Public Checkout",
      "description": "Guest checkout, payment gateway webhooks, order confirmation, and order status recovery."
    },
    {
      "name": "Stores",
      "description": "Authenticated merchant store CRUD."
    },
    {
      "name": "Catalog Widgets",
      "description": "Saved embeddable catalog widget presets."
    },
    {
      "name": "Products",
      "description": "Authenticated product, variant, inventory, and digital file management."
    },
    {
      "name": "Categories",
      "description": "Authenticated store category management."
    },
    {
      "name": "Orders",
      "description": "Authenticated order management and fulfillment updates."
    },
    {
      "name": "Payments & Refunds",
      "description": "Store checkout payment gateway integrations and refund operations."
    },
    {
      "name": "Discounts",
      "description": "Coupon codes, automatic promotions, and redemption analytics."
    },
    {
      "name": "Custom Domains",
      "description": "Custom hostname registration and DNS verification."
    },
    {
      "name": "Analytics",
      "description": "Store sales and order overview metrics."
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Merchant API key (shoprivet_live_...). Keep server-side only; never expose in browser code or NEXT_PUBLIC_ variables. Rate-limited per account plan (60, 300, or 1,000 requests/min)."
      },
      "bearerCartCredential": {
        "type": "http",
        "scheme": "bearer",
        "description": "Scoped guest cart credential returned by POST /public/stores/{slug}/carts."
      },
      "bearerOrderAccess": {
        "type": "http",
        "scheme": "bearer",
        "description": "Scoped order access token returned by checkout or POST /public/order-status/{slug}/recover."
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "statusCode": {
            "type": "integer",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Authentication required"
          }
        }
      },
      "ValidationErrorResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "message": {
            "type": "string",
            "example": "Validation failed"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "example": "price"
                },
                "message": {
                  "type": "string",
                  "example": "Expected number"
                }
              }
            }
          }
        }
      },
      "CreateStoreInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "type": {
            "default": "physical",
            "type": "string",
            "enum": [
              "physical",
              "digital"
            ]
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          }
        },
        "required": [
          "name"
        ]
      },
      "UpdateStoreInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "type": {
            "type": "string",
            "enum": [
              "physical",
              "digital"
            ]
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "logo": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused"
            ]
          },
          "primaryColor": {
            "type": "string"
          },
          "accentColor": {
            "type": "string"
          },
          "showDescription": {
            "type": "boolean"
          },
          "showLogo": {
            "type": "boolean"
          },
          "storefrontConfig": {},
          "storefrontSite": {}
        }
      },
      "CreateCatalogWidgetInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "config": {}
        },
        "required": [
          "name"
        ]
      },
      "UpdateCatalogWidgetInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "config": {}
        }
      },
      "CreateProductInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 5000
          },
          "price": {
            "type": "number",
            "minimum": 0
          },
          "comparePrice": {
            "type": "number",
            "minimum": 0
          },
          "type": {
            "default": "physical",
            "type": "string",
            "enum": [
              "physical",
              "digital"
            ]
          },
          "status": {
            "default": "draft",
            "type": "string",
            "enum": [
              "active",
              "draft"
            ]
          },
          "images": {
            "default": [],
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "stock": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "trackStock": {
            "default": false,
            "type": "boolean"
          },
          "sku": {
            "type": "string",
            "maxLength": 100
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "displayType": {
                  "default": "text",
                  "type": "string",
                  "enum": [
                    "text",
                    "color",
                    "image",
                    "dropdown"
                  ]
                },
                "values": {
                  "minItems": 1,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "priceAdjustment": {
                        "default": 0,
                        "type": "number"
                      },
                      "displayColor": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      },
                      "imageUrl": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                }
              },
              "required": [
                "name",
                "values"
              ]
            }
          },
          "categoryIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "variants": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "price": {
                  "type": "number",
                  "minimum": 0
                },
                "stock": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "sku": {
                  "type": "string",
                  "maxLength": 100
                },
                "options": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "images": {
                  "maxItems": 10,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              "required": [
                "name",
                "price"
              ]
            }
          },
          "deliveryUrl": {
            "type": "string",
            "maxLength": 2000,
            "format": "uri"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "url": {
                  "type": "string",
                  "minLength": 1
                },
                "size": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "mimeType": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "name",
                "url",
                "size",
                "mimeType"
              ]
            }
          }
        },
        "required": [
          "name",
          "price"
        ]
      },
      "UpdateProductInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": {
            "type": "string",
            "maxLength": 5000
          },
          "price": {
            "type": "number",
            "minimum": 0
          },
          "comparePrice": {
            "nullable": true,
            "type": "number",
            "minimum": 0
          },
          "type": {
            "type": "string",
            "enum": [
              "physical",
              "digital"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "draft",
              "archived"
            ]
          },
          "images": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "stock": {
            "nullable": true,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "trackStock": {
            "type": "boolean"
          },
          "sku": {
            "nullable": true,
            "type": "string",
            "maxLength": 100
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "displayType": {
                  "default": "text",
                  "type": "string",
                  "enum": [
                    "text",
                    "color",
                    "image",
                    "dropdown"
                  ]
                },
                "values": {
                  "minItems": 1,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "priceAdjustment": {
                        "default": 0,
                        "type": "number"
                      },
                      "displayColor": {
                        "type": "string",
                        "pattern": "^#[0-9a-fA-F]{6}$"
                      },
                      "imageUrl": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "name"
                    ]
                  }
                }
              },
              "required": [
                "name",
                "values"
              ]
            }
          },
          "categoryIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "variants": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "price": {
                  "type": "number",
                  "minimum": 0
                },
                "stock": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "sku": {
                  "type": "string",
                  "maxLength": 100
                },
                "options": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "images": {
                  "maxItems": 10,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              "required": [
                "name",
                "price"
              ]
            }
          },
          "deliveryUrl": {
            "nullable": true,
            "type": "string",
            "maxLength": 2000,
            "format": "uri"
          }
        }
      },
      "ProductStatusInput": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "active",
              "draft",
              "archived"
            ]
          }
        },
        "required": [
          "status"
        ]
      },
      "ReorderProductsInput": {
        "type": "object",
        "properties": {
          "productIds": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "productIds"
        ]
      },
      "AiDescriptionInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "keywords": {
            "type": "string",
            "maxLength": 500
          },
          "type": {
            "default": "physical",
            "type": "string",
            "enum": [
              "physical",
              "digital"
            ]
          }
        },
        "required": [
          "name"
        ]
      },
      "AddProductFileInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "url": {
            "type": "string",
            "minLength": 1
          },
          "size": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "mimeType": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "name",
          "url",
          "size",
          "mimeType"
        ]
      },
      "CreateCategoryInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "imageUrl": {
            "nullable": true,
            "type": "string",
            "maxLength": 2048
          }
        },
        "required": [
          "name"
        ]
      },
      "UpdateCategoryInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "imageUrl": {
            "nullable": true,
            "type": "string",
            "maxLength": 2048
          }
        },
        "required": [
          "name"
        ]
      },
      "CreateOrderInput": {
        "type": "object",
        "properties": {
          "customerName": {
            "type": "string",
            "minLength": 1
          },
          "customerEmail": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "customerPhone": {
            "type": "string"
          },
          "customerNote": {
            "type": "string"
          },
          "shippingAddress": {
            "type": "object",
            "properties": {
              "line1": {
                "type": "string",
                "minLength": 1
              },
              "line2": {
                "type": "string"
              },
              "city": {
                "type": "string",
                "minLength": 1
              },
              "state": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "line1",
              "city",
              "country"
            ]
          },
          "items": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string",
                  "minLength": 1
                },
                "variantId": {
                  "type": "string",
                  "minLength": 1
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 9007199254740991
                },
                "options": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "productId",
                "quantity"
              ]
            }
          },
          "shipping": {
            "default": 0,
            "type": "number",
            "minimum": 0
          },
          "tax": {
            "default": 0,
            "type": "number",
            "minimum": 0
          },
          "discount": {
            "default": 0,
            "type": "number",
            "minimum": 0
          },
          "paymentMethod": {
            "type": "string"
          },
          "paymentStatus": {
            "type": "string",
            "enum": [
              "unpaid",
              "paid",
              "refunded",
              "failed"
            ]
          },
          "paymentRef": {
            "type": "string"
          }
        },
        "required": [
          "customerName",
          "customerEmail",
          "items"
        ]
      },
      "UpdateOrderStatusInput": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "enquiry",
              "pending",
              "processing",
              "shipped",
              "delivered",
              "cancelled",
              "refunded"
            ]
          }
        },
        "required": [
          "status"
        ]
      },
      "UpdatePaymentStatusInput": {
        "type": "object",
        "properties": {
          "paymentStatus": {
            "type": "string",
            "enum": [
              "unpaid",
              "paid",
              "refunded",
              "failed"
            ]
          },
          "paymentRef": {
            "type": "string"
          }
        },
        "required": [
          "paymentStatus"
        ]
      },
      "AcknowledgePaymentReviewInput": {
        "type": "object",
        "properties": {
          "note": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          }
        },
        "required": [
          "note"
        ]
      },
      "CreatePaymentIntegrationInput": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string"
          },
          "environment": {
            "type": "string"
          },
          "credentials": {
            "default": {},
            "type": "object",
            "additionalProperties": {}
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "provider"
        ]
      },
      "UpdatePaymentIntegrationInput": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "environment": {
            "type": "string"
          },
          "credentials": {
            "type": "object",
            "additionalProperties": {}
          }
        }
      },
      "RefundRequestInput": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "maxLength": 30,
            "pattern": "^\\d+(\\.\\d{1,6})?$"
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "requestKey": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "confirmed": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "reason",
          "requestKey",
          "confirmed"
        ],
        "additionalProperties": false
      },
      "AssociateRefundInput": {
        "type": "object",
        "properties": {
          "providerRefundId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,200}$"
          },
          "confirmed": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "providerRefundId",
          "confirmed"
        ],
        "additionalProperties": false
      },
      "DiscountInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "code": {
            "nullable": true,
            "type": "string",
            "maxLength": 40,
            "pattern": "^[A-Za-z0-9_-]*$"
          },
          "applicationMode": {
            "type": "string",
            "enum": [
              "CODE",
              "AUTOMATIC"
            ]
          },
          "valueType": {
            "type": "string",
            "enum": [
              "PERCENTAGE",
              "FIXED_AMOUNT"
            ]
          },
          "value": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "scope": {
            "default": "ORDER",
            "type": "string",
            "enum": [
              "ORDER",
              "PRODUCTS",
              "CATEGORIES"
            ]
          },
          "productIds": {
            "default": [],
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "categoryIds": {
            "default": [],
            "maxItems": 200,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "minimumPurchase": {
            "default": 0,
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          },
          "minimumQuantity": {
            "default": 1,
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "maximumDiscount": {
            "default": null,
            "nullable": true,
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          },
          "usageLimit": {
            "default": null,
            "nullable": true,
            "type": "integer",
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 1000000000
          },
          "startsAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "endsAt": {
            "default": null,
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "applicationMode",
          "valueType",
          "value",
          "currency"
        ],
        "additionalProperties": false
      },
      "RetainedDiscountsInput": {
        "type": "object",
        "properties": {
          "ids": {
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "required": [
          "ids"
        ],
        "additionalProperties": false
      },
      "ApplyDiscountInput": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "pattern": "^[A-Za-z0-9_-]+$"
          }
        },
        "required": [
          "code"
        ],
        "additionalProperties": false
      },
      "AddDomainInput": {
        "type": "object",
        "properties": {
          "hostname": {
            "type": "string",
            "minLength": 1,
            "maxLength": 253
          }
        },
        "required": [
          "hostname"
        ]
      },
      "AddCartItemInput": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "variantId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "options": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "maxLength": 200
            }
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 99
          }
        },
        "required": [
          "productId",
          "quantity"
        ],
        "additionalProperties": false
      },
      "UpdateCartItemInput": {
        "type": "object",
        "properties": {
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 99
          }
        },
        "required": [
          "quantity"
        ],
        "additionalProperties": false
      },
      "ImportLegacyCartInput": {
        "type": "object",
        "properties": {
          "items": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "variantId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "options": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 99
                }
              },
              "required": [
                "productId",
                "quantity"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "PublicCheckoutInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "message": {
            "type": "string",
            "maxLength": 5000
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "provider": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 16,
            "maxLength": 200
          },
          "shippingAddress": {
            "type": "object",
            "properties": {
              "line1": {
                "type": "string",
                "minLength": 1
              },
              "line2": {
                "type": "string"
              },
              "city": {
                "type": "string",
                "minLength": 1
              },
              "state": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "line1",
              "city",
              "country"
            ]
          },
          "items": {
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string",
                  "minLength": 1
                },
                "variantId": {
                  "type": "string",
                  "minLength": 1
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 99
                },
                "options": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "productId",
                "quantity"
              ]
            }
          }
        },
        "required": [
          "provider",
          "items"
        ]
      },
      "PublicCartCheckoutInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "message": {
            "type": "string",
            "maxLength": 5000
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "provider": {
            "type": "string"
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 16,
            "maxLength": 200
          },
          "shippingAddress": {
            "type": "object",
            "properties": {
              "line1": {
                "type": "string",
                "minLength": 1
              },
              "line2": {
                "type": "string"
              },
              "city": {
                "type": "string",
                "minLength": 1
              },
              "state": {
                "type": "string"
              },
              "postalCode": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "line1",
              "city",
              "country"
            ]
          }
        },
        "required": [
          "provider",
          "idempotencyKey"
        ]
      },
      "PublicOrderConfirmInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "reference": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "RecoverOrderInput": {
        "type": "object",
        "properties": {
          "orderNumber": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          }
        },
        "required": [
          "orderNumber",
          "email"
        ]
      },
      "EnquireInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          },
          "productId": {
            "type": "string",
            "minLength": 1
          },
          "items": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string",
                  "minLength": 1
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 99
                },
                "options": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "productId",
                "quantity"
              ]
            }
          }
        },
        "required": [
          "name",
          "email",
          "message"
        ]
      },
      "StoreSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "store_example_01"
          },
          "name": {
            "type": "string",
            "example": "Downtown Shop"
          },
          "slug": {
            "type": "string",
            "example": "downtown-shop"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "example": "usd"
          },
          "type": {
            "type": "string",
            "enum": [
              "physical",
              "digital"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProductSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "prod_example_01"
          },
          "storeId": {
            "type": "string",
            "example": "store_example_01"
          },
          "name": {
            "type": "string",
            "example": "Open Tee"
          },
          "slug": {
            "type": "string",
            "example": "open-tee"
          },
          "price": {
            "type": "number",
            "example": 24
          },
          "currency": {
            "type": "string",
            "example": "usd"
          },
          "type": {
            "type": "string",
            "enum": [
              "physical",
              "digital"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "draft",
              "archived"
            ]
          }
        }
      },
      "PublicCartResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "cart_example_01"
          },
          "storeSlug": {
            "type": "string",
            "example": "downtown-shop"
          },
          "status": {
            "type": "string",
            "example": "ACTIVE"
          },
          "currency": {
            "type": "string",
            "example": "usd"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "subtotal": {
            "type": "number",
            "example": 40
          },
          "discount": {
            "type": "number",
            "example": 0
          },
          "total": {
            "type": "number",
            "example": 40
          },
          "canCheckout": {
            "type": "boolean",
            "example": true
          }
        }
      },
      "PublicOrderResponse": {
        "type": "object",
        "properties": {
          "orderNumber": {
            "type": "string",
            "example": "SRV-20261127-0001"
          },
          "status": {
            "type": "string",
            "example": "pending"
          },
          "paymentStatus": {
            "type": "string",
            "enum": [
              "unpaid",
              "paid",
              "refunded",
              "failed"
            ]
          },
          "paymentMethod": {
            "type": "string",
            "example": "cash_on_delivery"
          },
          "payOnDelivery": {
            "type": "boolean",
            "example": true
          },
          "subtotal": {
            "type": "number",
            "example": 24
          },
          "total": {
            "type": "number",
            "example": 24
          },
          "currency": {
            "type": "string",
            "example": "usd"
          }
        }
      }
    }
  },
  "paths": {
    "/widget.js": {
      "get": {
        "tags": [
          "Public Storefront"
        ],
        "summary": "Serve embeddable catalog and cart runtime script",
        "description": "Returns the JavaScript runtime used by <div data-shoprivet=\"store-slug\"> embeds.",
        "responses": {
          "200": {
            "description": "JavaScript widget runtime",
            "content": {
              "application/javascript": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}": {
      "get": {
        "tags": [
          "Public Storefront"
        ],
        "summary": "Get public store details",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Store profile and branding metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreSummary"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/products": {
      "get": {
        "tags": [
          "Public Storefront"
        ],
        "summary": "List active public products",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "default": 1,
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 24,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated active catalog items",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "products": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ProductSummary"
                      }
                    },
                    "total": {
                      "type": "integer",
                      "example": 1
                    },
                    "page": {
                      "type": "integer",
                      "example": 1
                    },
                    "totalPages": {
                      "type": "integer",
                      "example": 1
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/products/{productSlug}": {
      "get": {
        "tags": [
          "Public Storefront"
        ],
        "summary": "Get one public product by slug",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productSlug",
            "in": "path",
            "required": true,
            "description": "Product slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public product record with variants and options",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSummary"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/products-by-id/{id}": {
      "get": {
        "tags": [
          "Public Storefront"
        ],
        "summary": "Get one public product by ID",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public product record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSummary"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/categories": {
      "get": {
        "tags": [
          "Public Storefront"
        ],
        "summary": "List public store categories",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Active categories for the storefront",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/payment-methods": {
      "get": {
        "tags": [
          "Public Storefront"
        ],
        "summary": "List enabled store checkout payment methods",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Store currency and enabled payment providers (Stripe, Paystack, Flutterwave, Razorpay, PayPal, or Cash on delivery)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string",
                      "example": "usd"
                    },
                    "methods": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/carts": {
      "post": {
        "tags": [
          "Public Carts"
        ],
        "summary": "Create a server-side guest cart",
        "description": "Issues a scoped guest cart credential used as Authorization: Bearer on subsequent headless cart requests.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Guest cart created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credential": {
                      "type": "string",
                      "example": "cart_cred_example_token"
                    },
                    "cart": {
                      "$ref": "#/components/schemas/PublicCartResponse"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/carts/current": {
      "get": {
        "tags": [
          "Public Carts"
        ],
        "summary": "Get the current guest cart",
        "security": [
          {
            "bearerCartCredential": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current cart lines and calculated totals",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCartResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Public Carts"
        ],
        "summary": "Revoke the current guest cart session",
        "security": [
          {
            "bearerCartCredential": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Guest cart revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/carts/current/items": {
      "post": {
        "tags": [
          "Public Carts"
        ],
        "summary": "Add an item to the guest cart",
        "security": [
          {
            "bearerCartCredential": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddCartItemInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Updated guest cart",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCartResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Public Carts"
        ],
        "summary": "Clear all items in the guest cart",
        "security": [
          {
            "bearerCartCredential": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Emptied guest cart",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCartResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/carts/current/items/{itemId}": {
      "patch": {
        "tags": [
          "Public Carts"
        ],
        "summary": "Update guest cart item quantity",
        "security": [
          {
            "bearerCartCredential": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "description": "Cart line item ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCartItemInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated guest cart",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCartResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Public Carts"
        ],
        "summary": "Remove one item from the guest cart",
        "security": [
          {
            "bearerCartCredential": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "required": true,
            "description": "Cart line item ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated guest cart",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCartResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/carts/current/discount": {
      "post": {
        "tags": [
          "Public Carts"
        ],
        "summary": "Apply a discount code to the guest cart",
        "security": [
          {
            "bearerCartCredential": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyDiscountInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cart updated with applied discount",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCartResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Public Carts"
        ],
        "summary": "Remove the active discount code from the guest cart",
        "security": [
          {
            "bearerCartCredential": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cart updated after discount removal",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCartResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/carts/current/legacy-import": {
      "post": {
        "tags": [
          "Public Carts"
        ],
        "summary": "Import legacy client-side cart items once",
        "security": [
          {
            "bearerCartCredential": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportLegacyCartInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import result and hydrated cart",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/carts/current/checkout": {
      "post": {
        "tags": [
          "Public Checkout"
        ],
        "summary": "Check out the current guest cart",
        "description": "Creates an order and initializes online payment or records a cash-on-delivery order. Requires a stable idempotencyKey per checkout attempt.",
        "security": [
          {
            "bearerCartCredential": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCartCheckoutInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Order created and payment initialized or completed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "orderNumber": {
                      "type": "string",
                      "example": "SRV-20261127-0001"
                    },
                    "orderAccessToken": {
                      "type": "string",
                      "example": "order_access_example_token"
                    },
                    "authorizationUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "order": {
                      "$ref": "#/components/schemas/PublicOrderResponse"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/checkout": {
      "post": {
        "tags": [
          "Public Checkout"
        ],
        "summary": "Direct item-list checkout without a persisted guest cart",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCheckoutInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Order created and payment initialized or completed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/orders/{orderNumber}": {
      "get": {
        "tags": [
          "Public Checkout"
        ],
        "summary": "Look up a customer order using orderAccessToken",
        "security": [
          {
            "bearerOrderAccess": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "description": "Order number, e.g. SRV-20261127-0001",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order status and digital download links if paid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOrderResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/orders/{orderNumber}/confirm": {
      "post": {
        "tags": [
          "Public Checkout"
        ],
        "summary": "Verify and confirm payment for a customer order",
        "security": [
          {
            "bearerOrderAccess": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "description": "Order number",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicOrderConfirmInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified order status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOrderResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/orders/{orderNumber}/cancel": {
      "post": {
        "tags": [
          "Public Checkout"
        ],
        "summary": "Cancel an unpaid customer order",
        "security": [
          {
            "bearerOrderAccess": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderNumber",
            "in": "path",
            "required": true,
            "description": "Order number",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancellation result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicOrderResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/enquire": {
      "post": {
        "tags": [
          "Public Storefront"
        ],
        "summary": "Submit an enquiry order request",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnquireInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Enquiry created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/stores/{slug}/payments/{provider}/webhook": {
      "post": {
        "tags": [
          "Public Checkout"
        ],
        "summary": "Incoming payment gateway webhook receiver",
        "description": "Endpoint called by supported payment gateways (Stripe, Paystack, Flutterwave, Razorpay, PayPal) to report payment events. Outbound merchant order webhooks are not provided.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "description": "Provider ID: stripe, paystack, flutterwave, razorpay, paypal",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook acknowledged",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/public/downloads/{token}": {
      "get": {
        "tags": [
          "Public Storefront"
        ],
        "summary": "Download a paid digital product file",
        "description": "Streams a digital product file. Tokens expire after 90 days and allow up to 20 downloads.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "Unique per-order download token",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Binary file stream"
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/public/order-status/{slug}/recover": {
      "post": {
        "tags": [
          "Public Checkout"
        ],
        "summary": "Recover order access token by order number and customer email",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecoverOrderInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recovery notification or access response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/public/order-status/{slug}/status": {
      "get": {
        "tags": [
          "Public Checkout"
        ],
        "summary": "Check order financial status and download links",
        "security": [
          {
            "bearerOrderAccess": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Public store slug",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Financial status, order state, and digital downloads when paid",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores": {
      "get": {
        "tags": [
          "Stores"
        ],
        "summary": "List merchant stores",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "default": 1,
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated merchant stores",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Stores"
        ],
        "summary": "Create a store",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateStoreInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created store",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreSummary"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{id}": {
      "get": {
        "tags": [
          "Stores"
        ],
        "summary": "Get one store",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Store details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreSummary"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Stores"
        ],
        "summary": "Update store settings or storefront configuration",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStoreInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated store",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreSummary"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Stores"
        ],
        "summary": "Delete a store",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Store deleted"
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{id}/catalog-widgets": {
      "get": {
        "tags": [
          "Catalog Widgets"
        ],
        "summary": "List saved embeddable catalog widgets for a store",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog widgets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Catalog Widgets"
        ],
        "summary": "Create an embeddable catalog widget preset",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCatalogWidgetInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created widget preset",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{id}/catalog-widgets/{widgetId}": {
      "patch": {
        "tags": [
          "Catalog Widgets"
        ],
        "summary": "Update an embeddable catalog widget preset",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "widgetId",
            "in": "path",
            "required": true,
            "description": "Widget ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCatalogWidgetInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated widget preset",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Catalog Widgets"
        ],
        "summary": "Delete an embeddable catalog widget preset",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "widgetId",
            "in": "path",
            "required": true,
            "description": "Widget ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Widget deleted"
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/products": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "List products in a store",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "categoryId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "default": 1,
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated products",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Create a product",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProductInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSummary"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/products/{id}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Get one product",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSummary"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Products"
        ],
        "summary": "Update a product",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProductInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSummary"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Delete a product",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Product deleted"
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/products/{id}/status": {
      "patch": {
        "tags": [
          "Products"
        ],
        "summary": "Update product publish status",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductStatusInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSummary"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/products/{id}/duplicate": {
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Duplicate a product",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Duplicated product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSummary"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/products/reorder": {
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Reorder products in catalog display order",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderProductsInput"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Catalog order saved"
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/products/upload-image": {
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Upload a product image (multipart/form-data field: file)",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Uploaded image URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/products/upload-file": {
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Upload a digital product file up to 50 MB (multipart/form-data field: file)",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored digital file metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/products/{id}/files": {
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Attach an uploaded file record to a digital product",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddProductFileInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Updated product files",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/products/{id}/files/{fileId}": {
      "delete": {
        "tags": [
          "Products"
        ],
        "summary": "Detach a file from a digital product",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Product ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "description": "File ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Remaining product files",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/products/ai/description": {
      "post": {
        "tags": [
          "Products"
        ],
        "summary": "Generate a product description with AI (counts against plan quota)",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiDescriptionInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Generated description",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "description": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/categories": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "List store categories",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "default": 1,
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated categories",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Categories"
        ],
        "summary": "Create a category",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCategoryInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created category",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/categories/{id}": {
      "patch": {
        "tags": [
          "Categories"
        ],
        "summary": "Update a category",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Category ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCategoryInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated category",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Categories"
        ],
        "summary": "Delete a category",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Category ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Category deleted"
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/orders": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "List store orders",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paymentStatus",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "default": 1,
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "required": false,
            "schema": {}
          },
          {
            "name": "dateTo",
            "in": "query",
            "required": false,
            "schema": {}
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated orders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Create a manual order",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/orders/stats": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Get order statistics for a store",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order totals by status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/orders/{id}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Get one order",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Order ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Orders"
        ],
        "summary": "Delete an order",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Order ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Order deleted"
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/orders/{id}/status": {
      "patch": {
        "tags": [
          "Orders"
        ],
        "summary": "Update order fulfillment status",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Order ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateOrderStatusInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/orders/{id}/payment": {
      "patch": {
        "tags": [
          "Orders"
        ],
        "summary": "Update manual order payment status",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Order ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentStatusInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/orders/{orderId}/financial": {
      "get": {
        "tags": [
          "Payments & Refunds"
        ],
        "summary": "Get payment attempts, refunds, and financial audit summary for an order",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "description": "Order ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Financial summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/orders/{orderId}/financial/{attemptId}/sync": {
      "post": {
        "tags": [
          "Payments & Refunds"
        ],
        "summary": "Synchronize payment attempt status directly with the provider",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "description": "Order ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "description": "Payment attempt ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated financial summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/orders/{orderId}/financial/{attemptId}/refunds": {
      "post": {
        "tags": [
          "Payments & Refunds"
        ],
        "summary": "Request a refund through the connected payment provider",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "description": "Order ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attemptId",
            "in": "path",
            "required": true,
            "description": "Payment attempt ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundRequestInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Refund result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/payments": {
      "get": {
        "tags": [
          "Payments & Refunds"
        ],
        "summary": "List store payment gateway configurations",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Configured gateways with masked secrets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Payments & Refunds"
        ],
        "summary": "Connect a store payment gateway",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePaymentIntegrationInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created payment integration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/payments/{id}": {
      "patch": {
        "tags": [
          "Payments & Refunds"
        ],
        "summary": "Update a store payment gateway configuration",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Payment integration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePaymentIntegrationInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated payment integration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Payments & Refunds"
        ],
        "summary": "Disconnect a store payment gateway",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Payment integration ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Integration removed"
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/discounts": {
      "get": {
        "tags": [
          "Discounts"
        ],
        "summary": "List store discounts and automatic promotions",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Discounts list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Discounts"
        ],
        "summary": "Create a discount code or automatic promotion",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscountInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created discount",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/discounts/{id}": {
      "put": {
        "tags": [
          "Discounts"
        ],
        "summary": "Replace a discount rule",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Discount ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DiscountInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated discount",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Discounts"
        ],
        "summary": "Archive a discount rule",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Discount ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Archived discount",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/discounts/analytics": {
      "get": {
        "tags": [
          "Discounts"
        ],
        "summary": "Get discount redemption analytics",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Discount analytics summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/custom-domains": {
      "get": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "List custom domains attached to a store",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom domains",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Register a custom domain hostname for a hosted store",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddDomainInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created custom domain verification record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/custom-domains/{id}/refresh": {
      "post": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Refresh DNS verification status for a custom domain",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Custom domain ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated verification state",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/custom-domains/{id}": {
      "delete": {
        "tags": [
          "Custom Domains"
        ],
        "summary": "Remove a custom domain from a store",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Custom domain ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/stores/{storeId}/analytics/overview": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Get revenue and order overview metrics for a store",
        "security": [
          {
            "bearerApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "path",
            "required": true,
            "description": "Store ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Store revenue and order metrics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Validation failed or invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid authentication credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient permissions or plan entitlement reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Requested resource was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; inspect Retry-After and X-RateLimit-* headers",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  }
}
