{"openapi":"3.1.0","info":{"title":"JWT Authentication API","description":"This is a sample JWT authentication service.\n\nError bodies come in three documented shapes:\n- `ErrorDto` `{\"message\": \"...\"}` for business, authentication, authorization, unknown-path (404) and\n  unsupported-method (405) errors;\n- `ValidationErrorsDto` `{\"<field>\": \"<message>\"}` for invalid request bodies, one message per field;\n- `{\"error\": \"...\"}` (also a `ValidationErrorsDto`) when a body cannot be read at all or a path or query\n  parameter does not convert.\nTwo endpoints answer 404 with an empty body: deleting an unknown product and reading the traffic of an\nunknown correlation id.","termsOfService":"http://swagger.io/terms/","license":{"name":"Apache 2.0","url":"http://springdoc.org"},"version":"1.0"},"servers":[{"url":"https://awesome.byst.re","description":"Generated server url"}],"tags":[{"name":"Inventory","description":"Administrator inventory management endpoints"},{"name":"ollama","description":"Ollama endpoints"},{"name":"Products","description":"Product management endpoints"},{"name":"local-email-outbox","description":"Helpers for inspecting the local JMS stub"},{"name":"QR","description":"Endpoint for QR code generation"},{"name":"Reviews","description":"Product reviews and ratings"},{"name":"users","description":"User management endpoints"},{"name":"password-reset","description":"Password recovery endpoints"},{"name":"email-events","description":"Authenticated email event visibility"},{"name":"Traffic Monitoring","description":"Endpoints for HTTP traffic monitoring"},{"name":"email","description":"Email sending endpoints"},{"name":"Webhook inboxes","description":"Built-in webhook receivers, so no external server is needed"},{"name":"Coupons","description":"Administrator coupon management"},{"name":"Gift cards","description":"Administrator gift card management"},{"name":"Cart","description":"Shopping cart management endpoints"},{"name":"Wishlist","description":"Saved products and back-in-stock notifications"},{"name":"Currencies","description":"Display currencies with fixed demo exchange rates; prices and orders stay in USD"},{"name":"VAT","description":"VAT rates. Prices are VAT-inclusive; orders show the VAT their total contains."},{"name":"Orders","description":"Order management endpoints"},{"name":"two-factor authentication","description":"TOTP enrollment and two-factor sign-in"},{"name":"Webhooks","description":"Signed HTTP callbacks for your order events, with a delivery log and retries"},{"name":"Gift cards","description":"Gift card balance check"},{"name":"Loyalty","description":"Loyalty points of the signed-in user"}],"paths":{"/api/v1/wishlist/{productId}":{"put":{"tags":["Wishlist"],"summary":"Add or update wishlist product","description":"Adds a product to the wishlist (201) or updates its notification setting (200). The body is optional; notifyWhenAvailable defaults to false. A wishlist holds at most 50 products.","operationId":"upsert","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WishlistUpdateDto"}}}},"responses":{"200":{"description":"Wishlist entry updated","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WishlistItemDto"}}}},"201":{"description":"Wishlist entry created","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WishlistItemDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Wishlist is full","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Wishlist"],"summary":"Remove wishlist product","description":"Removes a product from the caller's wishlist.","operationId":"remove","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"Wishlist entry removed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product is not on the wishlist","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhooks/{id}":{"get":{"tags":["Webhooks"],"summary":"Get webhook subscription","description":"Returns one of the caller's subscriptions.","operationId":"get","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Subscription returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"The subscription belongs to another user","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Subscription not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Webhooks"],"summary":"Update webhook subscription","description":"Replaces url, events and description; active=false pauses deliveries and active=true re-enables an (auto-)disabled subscription and resets its failure counter. The URL is checked again. The secret is unchanged.","operationId":"update","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookUpdateDto"}}},"required":true},"responses":{"200":{"description":"Subscription updated","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionDto"}}}},"400":{"description":"Invalid body, unknown event type or rejected URL","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"The subscription belongs to another user","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Subscription not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Webhooks"],"summary":"Delete webhook subscription","description":"Deletes the subscription and its delivery log.","operationId":"delete","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"Subscription deleted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"The subscription belongs to another user","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Subscription not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/{username}":{"get":{"tags":["users"],"summary":"Get user by username","description":"Returns public account details for the requested username. The email address is masked (j***@example.com) unless the caller is an administrator or the account itself.","operationId":"getByUsername","parameters":[{"name":"username","in":"path","description":"Username","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"User details","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"The user doesn't exist","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["users"],"summary":"Update user","description":"Updates editable profile fields for an existing user. Users may edit themselves; administrators may edit any user.","operationId":"edit","parameters":[{"name":"username","in":"path","description":"Username","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEditDto"}}},"required":true},"responses":{"200":{"description":"User was updated","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseDto"}}}},"400":{"description":"Invalid fields, or the email is already used by another account","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"A non-administrator addressed any username other than their own","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"The user doesn't exist (administrators only)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"A concurrent change claimed the same email","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["users"],"summary":"Delete user","description":"Deletes a user account and user-owned data. Requires an administrator role.","operationId":"delete_1","parameters":[{"name":"username","in":"path","description":"Username","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"User was deleted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"The user doesn't exist","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/tool-system-prompt":{"get":{"tags":["users"],"summary":"Get your tool system prompt","description":"Returns the authenticated user's tool-calling prompt override, or the default prompt when no override is stored.","operationId":"getToolSystemPrompt","responses":{"200":{"description":"Tool system prompt retrieved successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolSystemPromptDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["users"],"summary":"Update your tool system prompt","description":"Stores a new tool-calling prompt override for the authenticated user. Null, an omitted field, or a blank string resets the override. PUT answers with the effective prompt, the same value the next GET returns: the stored override, or the default after a reset.","operationId":"updateToolSystemPrompt","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolSystemPromptDto"}}},"required":true},"responses":{"200":{"description":"Tool system prompt was updated","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolSystemPromptDto"}}}},"400":{"description":"Bad request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/chat-system-prompt":{"get":{"tags":["users"],"summary":"Get your chat system prompt","description":"Returns the authenticated user's chat prompt override, or the default prompt when no override is stored.","operationId":"getChatSystemPrompt","responses":{"200":{"description":"Chat system prompt retrieved successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSystemPromptDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["users"],"summary":"Update your chat system prompt","description":"Stores a new chat prompt override for the authenticated user. Null, an omitted field, or a blank string resets the override. PUT answers with the effective prompt, the same value the next GET returns: the stored override, or the default after a reset.","operationId":"updateChatSystemPrompt","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSystemPromptDto"}}},"required":true},"responses":{"200":{"description":"Chat system prompt was updated","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSystemPromptDto"}}}},"400":{"description":"Bad request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/products/{productId}/reviews/mine":{"get":{"tags":["Reviews"],"summary":"Get my review and eligibility","description":"Returns whether the caller may review the product and the caller's review in any moderation status.","operationId":"mine","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Eligibility returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyReviewDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product or review not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Reviews"],"summary":"Edit my review","description":"Replaces the caller's review content. The review returns to PENDING and its moderation note is cleared.","operationId":"update_1","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewRequestDto"}}},"required":true},"responses":{"200":{"description":"Review updated and awaiting moderation","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewDto"}}}},"400":{"description":"Invalid review","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product or review not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Reviews"],"summary":"Delete my review","description":"Deletes the caller's review for the product.","operationId":"delete_2","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"Review deleted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product or review not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/products/{id}":{"get":{"tags":["Products"],"summary":"Get product by ID","description":"Returns one product by numeric identifier, or 404 when the product does not exist.","operationId":"getProductById","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"If-None-Match","in":"header","description":"Entity tag from a previous response; a match returns 304","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully retrieved product; the ETag header carries the product version","headers":{"ETag":{"description":"Quoted product version","style":"simple","schema":{"type":"string","example":"\"3\""}},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductDto"}}}},"304":{"description":"If-None-Match matches the current version; empty response body","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"description":"Bad request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Products"],"summary":"Update existing product","description":"Updates supplied non-null product fields; omitted or null fields are unchanged. Empty description and imageUrl are allowed. An optional If-Match header with the ETag from GET enables optimistic concurrency: a stale tag returns 412 and nothing changes. Requires an administrator role.","operationId":"updateProduct","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"If-Match","in":"header","description":"Entity tag from GET /api/v1/products/{id}, for example \"3\"","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductUpdateDto"}}},"required":true},"responses":{"200":{"description":"Product updated successfully; the ETag header carries the new version","headers":{"ETag":{"description":"Quoted product version","style":"simple","schema":{"type":"string","example":"\"4\""}},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductDto"}}}},"400":{"description":"Invalid input","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"412":{"description":"If-Match does not match the current product version","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"503":{"description":"Inventory service unavailable: a stockQuantity change could not be recorded; the product is unchanged","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Products"],"summary":"Delete product","description":"Deletes an existing product by identifier. Referenced products return 409 without removing existing data. Requires an administrator role.","operationId":"deleteProduct","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"Product deleted successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"description":"Bad request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product not found; empty response body","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"409":{"description":"Product is referenced by existing data","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/orders/{id}/status":{"put":{"tags":["Orders"],"summary":"Update order status (Admin only)","description":"Sets the supplied status using administrator privileges. Statuses only move forward (PENDING -> PAID -> SHIPPED -> DELIVERED; steps may be skipped) and DELIVERED and CANCELLED are terminal, so an order is never reopened. Setting the current status is a no-op. CANCELLED is allowed only from PENDING or PAID and restores deducted stock.","operationId":"updateOrderStatus","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"string","enum":["PENDING","PAID","SHIPPED","DELIVERED","CANCELLED"]}}},"required":true},"responses":{"200":{"description":"Order status updated successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDto"}}}},"400":{"description":"Invalid status transition, for example \"Cannot change order status from CANCELLED to PAID\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Order not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/cart/loyalty-points":{"put":{"tags":["Cart"],"summary":"Apply loyalty points to cart","description":"Reserves loyalty points for checkout in whole multiples of 100 (100 points = 1.00), replacing any previous amount. Points pay after the coupon discount and the gift card; the cart shows pointsRedeemed, capped at what the remaining total needs, pointsAmount and amountDue. Checkout checks the balance again.","operationId":"apply","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyLoyaltyPointsDto"}}},"required":true},"responses":{"200":{"description":"Points applied; the cart shows the points amount","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartDto"}}}},"400":{"description":"Empty cart, or points below 100 or not a multiple of 100","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Insufficient loyalty points","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Cart"],"summary":"Remove loyalty points from cart","description":"Stops using loyalty points for this cart. Succeeds even when no points are applied.","operationId":"remove_1","responses":{"200":{"description":"Points removed; the updated cart is returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/cart/items/{productId}":{"put":{"tags":["Cart"],"summary":"Update item quantity","description":"Sets the quantity for a product already in the authenticated user's cart. Quantity zero removes the item.","operationId":"updateCartItem","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCartItemDto"}}},"required":true},"responses":{"200":{"description":"Item quantity updated successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartDto"}}}},"400":{"description":"Invalid input","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Cart item not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Requested quantity exceeds available stock, or the cart line was changed concurrently (retry)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Cart"],"summary":"Remove item from cart","description":"Removes a product from the authenticated user's cart and returns the updated cart.","operationId":"removeFromCart","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Item removed successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartDto"}}}},"400":{"description":"Bad request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Cart item not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/cart/gift-card":{"put":{"tags":["Cart"],"summary":"Apply gift card to cart","description":"Validates the gift card and attaches it to the cart, replacing any previous one. The cart then shows giftCardCode, giftCardAmount and amountDue; the card pays after the coupon discount and before loyalty points. Checkout validates the card again.","operationId":"apply_1","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyGiftCardDto"}}},"required":true},"responses":{"200":{"description":"Gift card applied; the cart shows the gift card amount","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartDto"}}}},"400":{"description":"Empty cart, malformed code, disabled or expired gift card","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Gift card not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Gift card has no remaining balance","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Cart"],"summary":"Remove gift card from cart","description":"Detaches the gift card from the cart. Succeeds even when no gift card is applied.","operationId":"remove_2","responses":{"200":{"description":"Gift card removed; the updated cart is returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/cart/coupon":{"put":{"tags":["Cart"],"summary":"Apply coupon to cart","description":"Validates the coupon against the current cart and attaches it, replacing any previous coupon. Checkout validates it again.","operationId":"apply_2","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyCouponDto"}}},"required":true},"responses":{"200":{"description":"Coupon applied; the cart shows the discount","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartDto"}}}},"400":{"description":"Empty cart, inactive, not yet valid or expired coupon, or subtotal below the minimum","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Coupon not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Global or per-user redemption limit reached","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Cart"],"summary":"Remove coupon from cart","description":"Detaches the coupon from the cart. Succeeds even when no coupon is applied.","operationId":"remove_3","responses":{"200":{"description":"Coupon removed; the updated cart is returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/vat-rates/{countryCode}":{"put":{"tags":["VAT"],"summary":"Create or update VAT rate","description":"Sets the VAT rate (0-50, at most 2 decimals) and name of a country. The code is an ISO 3166-1 alpha-2 code, case-insensitive; UK is stored as GB. Existing orders keep the rate they were created with.","operationId":"upsert_1","parameters":[{"name":"countryCode","in":"path","description":"ISO 3166-1 alpha-2 country code","required":true,"schema":{"type":"string"},"example":"PL"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VatRateRequestDto"}}},"required":true},"responses":{"200":{"description":"VAT rate updated","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VatRateDto"}}}},"201":{"description":"VAT rate created","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VatRateDto"}}}},"400":{"description":"Invalid country code or rate definition","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/reviews/{id}/moderation":{"put":{"tags":["Reviews"],"summary":"Moderate review","description":"Approves or rejects a review. Rejection requires a note that the author can see. A review can be moderated again later.","operationId":"moderate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerationRequestDto"}}},"required":true},"responses":{"200":{"description":"Review moderated","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewDto"}}}},"400":{"description":"Invalid decision or missing rejection note","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Review not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/currencies/{code}":{"put":{"tags":["Currencies"],"summary":"Create or update currency","description":"Sets the name, symbol and USD rate (greater than 0, at most 6 decimals) of a currency. The code is a 3-letter ISO 4217 code, case-insensitive. USD is the base currency and its rate must stay 1.","operationId":"upsert_2","parameters":[{"name":"code","in":"path","description":"ISO 4217 currency code","required":true,"schema":{"type":"string"},"example":"EUR"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyRequestDto"}}},"required":true},"responses":{"200":{"description":"Currency updated","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyDto"}}}},"201":{"description":"Currency created","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyDto"}}}},"400":{"description":"Invalid currency code or definition","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/coupons/{id}":{"get":{"tags":["Coupons"],"summary":"Get coupon","description":"Returns one coupon with its redemption count and effective status.","operationId":"get_1","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Coupon returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Coupon not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"put":{"tags":["Coupons"],"summary":"Update coupon","description":"Replaces a coupon definition. The redemption count is preserved.","operationId":"update_2","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponRequestDto"}}},"required":true},"responses":{"200":{"description":"Coupon updated","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponDto"}}}},"400":{"description":"Invalid coupon definition","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Coupon not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Coupon code already exists","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Coupons"],"summary":"Delete coupon","description":"Deletes a coupon that was never redeemed and removes it from carts. Redeemed coupons return 409; deactivate them instead.","operationId":"delete_3","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"Coupon deleted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Coupon not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Coupon has redemptions","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"List my webhook subscriptions","description":"Returns the caller's subscriptions, oldest first. Secrets are never included.","operationId":"list","responses":{"200":{"description":"Subscriptions returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscriptionDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Webhooks"],"summary":"Create webhook subscription","description":"Subscribes a public http(s) URL on port 80 or 443 (or inbox://<token> of one of your inboxes) to your order events. URLs resolving to loopback, private, link-local or other internal addresses are rejected. The response contains the signing secret, which is shown only once. At most 5 subscriptions per user.","operationId":"create","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateDto"}}},"required":true},"responses":{"201":{"description":"Subscription created; secret included once","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionDto"}}}},"400":{"description":"Invalid body, unknown event type or rejected URL","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Subscription limit reached","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send test webhook","description":"Sends a webhook.ping event now (waiting up to 5 seconds for the receiver) and returns the recorded delivery. A failed ping is retried like any other delivery.","operationId":"test","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"201":{"description":"Ping sent; the delivery shows the outcome","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"The subscription belongs to another user","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Subscription not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Subscription is disabled, or webhook delivery is disabled on this backend","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhooks/{id}/rotate-secret":{"post":{"tags":["Webhooks"],"summary":"Rotate webhook secret","description":"Replaces the signing secret and returns the new one once. Later deliveries, including retries of earlier events, are signed with it.","operationId":"rotateSecret","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Secret rotated; new secret included once","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"The subscription belongs to another user","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Subscription not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver":{"post":{"tags":["Webhooks"],"summary":"Redeliver webhook","description":"Sends the event of an earlier delivery again, now, as a new delivery with the same event id and body and a fresh signature. The original delivery is unchanged.","operationId":"redeliver","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"201":{"description":"Redelivery sent; the new delivery shows the outcome","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryDto"}}}},"400":{"description":"Invalid delivery id","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"The subscription belongs to another user","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Subscription or delivery not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Subscription is disabled, or webhook delivery is disabled on this backend","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhook-inboxes":{"get":{"tags":["Webhook inboxes"],"summary":"List my webhook inboxes","description":"Returns the caller's inboxes, oldest first.","operationId":"list_1","responses":{"200":{"description":"Inboxes returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookInboxDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Webhook inboxes"],"summary":"Create webhook inbox","description":"Creates a receiver addressed as inbox://<token>. Use that URL in a subscription; deliveries to it are signed and logged like HTTP deliveries but stored here. At most 3 inboxes per user.","operationId":"create_1","responses":{"201":{"description":"Inbox created","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookInboxDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Inbox limit reached","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/signup":{"post":{"tags":["users"],"summary":"Create a new user account","description":"Registers a local user account with client privileges after validating the signup payload.","operationId":"signup","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegisterDto"}}},"required":true},"responses":{"201":{"description":"User was successfully created","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"description":"Field validation failed, or username/email is already in use","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Invalid or expired Bearer token; omit stale Authorization headers on this public endpoint","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}}}},"/api/v1/users/signin":{"post":{"tags":["users"],"summary":"Authenticate user and return JWT token","description":"Authenticates local credentials. When mfaRequired is false, returns access and refresh tokens with null challenge fields. When true, returns an MFA challenge and expiration with null tokens; complete POST /api/v1/users/signin/2fa to obtain tokens.","operationId":"login","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginDto"}}},"required":true},"responses":{"200":{"description":"Successfully authenticated","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponseDto"}}}},"400":{"description":"Field validation failed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Invalid or expired Bearer token; omit stale Authorization headers on this public endpoint","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"422":{"description":"Invalid username/password supplied","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}}}},"/api/v1/users/signin/2fa":{"post":{"tags":["two-factor authentication"],"summary":"Complete sign-in with a second factor","description":"Consumes a short-lived password challenge and a TOTP or recovery code, then issues tokens.","operationId":"completeSignIn","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaChallengeRequestDto"}}},"required":true},"responses":{"200":{"description":"Sign-in completed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponseDto"}}}},"400":{"description":"Field validation failed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Challenge or second factor is invalid","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many attempts","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}}}},"/api/v1/users/refresh":{"post":{"tags":["users"],"summary":"Refresh JWT token using refresh token","description":"Rotates a valid refresh token and returns a fresh access token plus replacement refresh token.","operationId":"refresh","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshTokenRequestDto"}}},"required":true},"responses":{"200":{"description":"New JWT and refresh tokens","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRefreshResponseDto"}}}},"400":{"description":"Bad request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Invalid refresh token","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}}}},"/api/v1/users/password/reset":{"post":{"tags":["password-reset"],"summary":"Complete password reset with a valid token","description":"Validates a password reset token, updates the user's password, and revokes existing refresh tokens.","operationId":"resetPassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequestDto"}}},"required":true},"responses":{"200":{"description":"Password reset successful","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"description":"Invalid token or payload","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Invalid or expired Bearer token; omit stale Authorization headers on these public endpoints","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}}}},"/api/v1/users/password/forgot":{"post":{"tags":["password-reset"],"summary":"Start password reset flow","description":"Accepts a username or email and queues reset instructions when a matching local account exists.","operationId":"forgotPassword","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequestDto"}}},"required":true},"responses":{"202":{"description":"Request accepted whether or not a matching account exists","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordResponseDto"}}}},"400":{"description":"Invalid payload","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Invalid or expired Bearer token; omit stale Authorization headers on these public endpoints","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}}}},"/api/v1/users/logout":{"post":{"tags":["users"],"summary":"Logout user and revoke refresh token","description":"Revokes all refresh tokens for the authenticated user.","operationId":"logout","responses":{"200":{"description":"Successfully logged out","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/2fa/setup":{"post":{"tags":["two-factor authentication"],"summary":"Start authenticator enrollment","description":"Creates a pending TOTP secret and returns its manual key and QR code.","operationId":"setup","responses":{"200":{"description":"Pending setup created","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaSetupResponseDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Account no longer exists","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"MFA is already enabled or provider-managed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many attempts","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/2fa/recovery-codes":{"post":{"tags":["two-factor authentication"],"summary":"Replace recovery codes","description":"Requires the current password and a fresh TOTP, then invalidates all previous recovery codes.","operationId":"replaceRecoveryCodes","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaProtectedActionRequestDto"}}},"required":true},"responses":{"200":{"description":"Replacement recovery codes created","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaRecoveryCodesResponseDto"}}}},"400":{"description":"Field validation failed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Authenticator code or Bearer token is invalid","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Account no longer exists","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"MFA is not enabled or is provider-managed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"422":{"description":"Current password is invalid","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many attempts","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/2fa/disable":{"post":{"tags":["two-factor authentication"],"summary":"Disable two-factor authentication","description":"Requires the current password and a TOTP or recovery code, then revokes refresh tokens.","operationId":"disable","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaProtectedActionRequestDto"}}},"required":true},"responses":{"200":{"description":"MFA disabled","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"description":"Field validation failed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Second factor or Bearer token is invalid","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Account no longer exists","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"MFA is not enabled or is provider-managed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"422":{"description":"Current password is invalid","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many attempts","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/2fa/confirm":{"post":{"tags":["two-factor authentication"],"summary":"Confirm authenticator enrollment","description":"Verifies the first TOTP, enables MFA, and returns one-time recovery codes.","operationId":"confirm","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaCodeRequestDto"}}},"required":true},"responses":{"200":{"description":"MFA enabled and recovery codes created","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaRecoveryCodesResponseDto"}}}},"400":{"description":"Field validation failed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Authenticator code is invalid","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Account no longer exists","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Setup is missing, MFA is already enabled, or it is provider-managed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"410":{"description":"Pending setup expired","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many attempts","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/qr/create":{"post":{"tags":["QR"],"summary":"Generate QR code","description":"Generates a PNG QR code for the supplied text payload. Non-ASCII text (Polish letters, emoji) is encoded as UTF-8 and decodes to exactly the submitted text. The capacity is counted in UTF-8 bytes: about 2953 bytes, so fewer characters for multi-byte text; longer text answers 400 {\"text\": \"Text is too long for a QR code\"}.","operationId":"createQrCode","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateQrDto"}}},"required":true},"responses":{"200":{"description":"Successfully generated QR code","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid input: blank text, or text too long for a QR code","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"406":{"description":"The Accept header excludes image/png (validation errors are still reported as 400 JSON first)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/products":{"get":{"tags":["Products"],"summary":"Get all products","description":"Returns the complete product catalog visible to authenticated clients.","operationId":"getAllProducts","responses":{"200":{"description":"Successfully retrieved products","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProductDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Products"],"summary":"Create new product","description":"Creates a catalog product from the supplied payload. Requires an administrator role.","operationId":"createProduct","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductCreateDto"}}},"required":true},"responses":{"201":{"description":"Product created successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductDto"}}}},"400":{"description":"Invalid input","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/products/{productId}/reviews":{"get":{"tags":["Reviews"],"summary":"List approved reviews","description":"Lists approved reviews for a product, newest first. Negative page is clamped to zero; size is clamped to 1-50.","operationId":"list_2","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"page","in":"query","description":"Zero-based page index","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Page size, 1-50","required":false,"schema":{"type":"integer","format":"int32","default":10}}],"responses":{"200":{"description":"Reviews returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoReviewDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product or review not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Reviews"],"summary":"Create review","description":"Creates a PENDING review. Only users with a DELIVERED order containing the product may review it, once per product.","operationId":"create_2","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewRequestDto"}}},"required":true},"responses":{"201":{"description":"Review created and awaiting moderation","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewDto"}}}},"400":{"description":"Invalid review","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"The caller has not received this product","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product or review not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"The caller already reviewed this product","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/orders":{"get":{"tags":["Orders"],"summary":"Get user's orders","description":"Returns the authenticated user's orders with optional status filtering and pagination.","operationId":"getUserOrders","parameters":[{"name":"page","in":"query","description":"Zero-based page index","required":false,"schema":{"type":"string","minimum":0}},{"name":"size","in":"query","description":"Page size, at least one","required":false,"schema":{"type":"string","minimum":1}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","PAID","SHIPPED","DELIVERED","CANCELLED"]}}],"responses":{"200":{"description":"Orders retrieved successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoOrderDto"}}}},"400":{"description":"Bad request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Orders"],"summary":"Create a new order from cart","description":"Creates an order for the authenticated user from the current cart and clears the cart after success. A coupon applied to the cart is validated again and redeemed. An optional Idempotency-Key header makes retries safe: repeating the key with the same address within 24 hours returns the original order with Idempotent-Replayed: true, and a different address returns 409.","operationId":"createOrder","parameters":[{"name":"Idempotency-Key","in":"header","description":"Client-generated key, 8-64 letters, digits, hyphens or underscores","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddressDto"}}},"required":true},"responses":{"201":{"description":"Order created successfully, or replayed for a repeated Idempotency-Key","headers":{"Idempotent-Replayed":{"description":"true when the response replays an earlier order","style":"simple","schema":{"type":"string","example":"true"}},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDto"}}}},"400":{"description":"Invalid input or empty cart","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"A cart product no longer exists","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Insufficient stock, coupon no longer valid, or Idempotency-Key reused with a different address","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"503":{"description":"Inventory service unavailable: warehouse-service could not reserve the stock; nothing was ordered and the cart is unchanged","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/orders/{id}/cancel":{"post":{"tags":["Orders"],"summary":"Cancel order","description":"Cancels an order when its current status allows cancellation. Clients may cancel only their own orders. Only PENDING and PAID orders can be cancelled.","operationId":"cancelOrder","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Order cancelled successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDto"}}}},"400":{"description":"Order cannot be cancelled","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Order not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/ollama/generate":{"post":{"tags":["ollama"],"summary":"Generate text using Ollama model","description":"Streams generated text chunks from the configured Ollama backend for a single prompt. Upstream errors before the stream starts preserve their HTTP status and JSON body; failures after streaming begins may terminate the stream.","operationId":"generateText","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StreamedRequestDto"}}},"required":true},"responses":{"200":{"description":"One JSON GenerateResponseDto per SSE data event","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/GenerateResponseDto"}}}},"400":{"description":"Invalid request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/ModelNotFoundDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Model not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelNotFoundDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"500":{"description":"Upstream server failure; JSON body is passed through before streaming starts","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":["object","array","string","number","boolean","null"]}}}},"default":{"description":"Other upstream HTTP failures before streaming starts retain their status and JSON body","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":["object","array","string","number","boolean","null"]}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/ollama/chat":{"post":{"tags":["ollama"],"summary":"Chat with Ollama model (stateless endpoint)","description":"Streams responses and expects the caller to manage the entire conversation history client-side.","operationId":"chat","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequestDto"}}},"required":true},"responses":{"200":{"description":"One JSON ChatResponseDto per SSE data event","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/ChatResponseDto"}}}},"400":{"description":"Invalid request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/ModelNotFoundDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Model not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelNotFoundDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"500":{"description":"Upstream server failure; JSON body is passed through before streaming starts","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":["object","array","string","number","boolean","null"]}}}},"default":{"description":"Other upstream HTTP failures before streaming starts retain their status and JSON body","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":["object","array","string","number","boolean","null"]}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/ollama/chat/tools":{"post":{"tags":["ollama"],"summary":"Chat with Ollama using backend function calling (legacy stateless endpoint)","description":"Available tools: get_product_snapshot, list_products.\nUse GET /api/v1/ollama/chat/tools/definitions for the full JSON schema.\nThis endpoint requires the caller to resend the full conversation on every request.\nThe stream may run several model iterations with tool calls in between; done=true is sent only on the terminal event of the whole orchestration.\nSmall local models stay grounded only when they keep everything in the product lane—always snapshot a SKU first and follow up with list_products if it needs comparisons.","operationId":"chatWithTools","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequestDto"}}},"required":true},"responses":{"200":{"description":"One JSON ChatResponseDto per SSE data event","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/ChatResponseDto"}}}},"400":{"description":"Invalid request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorResponse"},{"$ref":"#/components/schemas/ModelNotFoundDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Upstream model not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelNotFoundDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"500":{"description":"Upstream server failure; JSON body is passed through before streaming starts","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":["object","array","string","number","boolean","null"]}}}},"default":{"description":"Other upstream HTTP failures before streaming starts retain their status and JSON body","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":["object","array","string","number","boolean","null"]}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/email":{"post":{"tags":["email"],"summary":"Send email","description":"Queues an email message for asynchronous delivery through the configured JMS destination. Only administrators may choose a template other than GENERIC; system templates such as PASSWORD_RESET_REQUESTED are sent by the backend itself.","operationId":"sendEmail","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailDto"}}},"required":true},"responses":{"200":{"description":"Email queued; delivery is asynchronous","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"400":{"description":"Invalid email data, or a non-GENERIC template from a non-administrator","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/cart/items":{"post":{"tags":["Cart"],"summary":"Add item to cart","description":"Adds a product to the authenticated user's cart or increases the quantity of an existing cart item.","operationId":"addToCart","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartItemDto"}}},"required":true},"responses":{"200":{"description":"Item added successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartDto"}}}},"400":{"description":"Invalid input","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Requested quantity exceeds available stock, or the cart line was changed concurrently (retry)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/products/import":{"post":{"tags":["Products"],"summary":"Import products from CSV","description":"Creates products for rows without an id and updates products for rows with an existing id. Columns may appear in any order; name, description, price, stockQuantity and category are required. Files are limited to 1 MB and 1000 rows. The import is all-or-nothing: any row error returns 400 with the full report and persists nothing. dryRun=true validates without persisting.","operationId":"importCsv","parameters":[{"name":"dryRun","in":"query","description":"Validate without persisting","required":false,"schema":{"type":"boolean","default":false}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"CSV file"}},"required":["file"]}}}},"responses":{"200":{"description":"Import applied, or dry run succeeded","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportReportDto"}}}},"400":{"description":"Invalid file or rows; the report lists every error when the file could be parsed","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ImportReportDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"413":{"description":"File larger than 1 MB","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"503":{"description":"Inventory service unavailable: a stockQuantity change could not be recorded; nothing was imported","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/orders/{id}/expire-reservation":{"post":{"tags":["Orders"],"summary":"Expire an order's stock reservation now (Admin only)","description":"Time control for tests and the distributed-systems lab: sets the reservation end of a PENDING order to now and expires it at once, exactly as the reservation expiry job would. The order is cancelled, its stock is restored (ORDER_RESTORED, actor system), its coupon, gift card and points are released, and order.cancelled (reason RESERVATION_EXPIRED) and order.reservation-expired are published. Works for orders created without a reservation too.","operationId":"expireReservation","parameters":[{"name":"id","in":"path","description":"Order id","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Reservation expired; the cancelled order is returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Order not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"The order is not PENDING, for example \"Only PENDING orders hold a reservation; order is PAID\"","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/inventory/{productId}/adjustments":{"post":{"tags":["Inventory"],"summary":"Adjust inventory","description":"Applies a nonzero inventory delta. Repeating requestId with the same product, delta and reason returns the original movement with 201; changing delta or reason returns 409.","operationId":"adjust","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryAdjustmentDto"}}},"required":true},"responses":{"201":{"description":"Adjustment recorded","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryMovementDto"}}}},"400":{"description":"Invalid adjustment or product identifier","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Insufficient stock, quantity overflow, or requestId reused with different delta/reason","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"503":{"description":"Inventory service unavailable: warehouse-service, which owns the stock ledger, did not answer","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/gift-cards":{"get":{"tags":["Gift cards"],"summary":"List gift cards","description":"Lists gift cards newest first, optionally only those with the given effective status. Negative page is clamped to zero; size is clamped to 1-100.","operationId":"list_3","parameters":[{"name":"status","in":"query","description":"Effective status filter","required":false,"schema":{"type":"string","enum":["ACTIVE","REDEEMED","EXPIRED","DISABLED"]}},{"name":"page","in":"query","description":"Zero-based page index","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Page size, 1-100","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"Gift cards returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoGiftCardDto"}}}},"400":{"description":"Unknown status","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Gift cards"],"summary":"Issue gift card","description":"Issues a gift card of 1.00-1000.00 with a generated GC-XXXX-XXXX-XXXX code. With recipientUsername the user receives a GIFT_CARD_ISSUED email with the code.","operationId":"issue","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardCreateDto"}}},"required":true},"responses":{"201":{"description":"Gift card issued","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardDto"}}}},"400":{"description":"Amount out of range, expiresAt not in the future, or field too long","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Recipient user not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/gift-cards/{code}/disable":{"post":{"tags":["Gift cards"],"summary":"Disable gift card","description":"Disables a gift card permanently. The balance is kept but can no longer be applied or spent; checkout with a cart that still holds the card fails with 409.","operationId":"disable_1","parameters":[{"name":"code","in":"path","description":"Gift card code","required":true,"schema":{"type":"string"},"example":"GC-7KQ2-M9XD-4HPA"}],"responses":{"200":{"description":"Gift card disabled","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardDto"}}}},"400":{"description":"Malformed code","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Gift card not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Gift card is already disabled","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/coupons":{"get":{"tags":["Coupons"],"summary":"List coupons","description":"Lists coupons newest first with their effective status. Negative page is clamped to zero; size is clamped to 1-100.","operationId":"list_4","parameters":[{"name":"page","in":"query","description":"Zero-based page index","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Page size, 1-100","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"Coupons returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoCouponDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"post":{"tags":["Coupons"],"summary":"Create coupon","description":"Creates a coupon. Codes are case-insensitive and stored upper-case. PERCENTAGE values above 100 and validity windows that end before they start are rejected.","operationId":"create_3","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponRequestDto"}}},"required":true},"responses":{"201":{"description":"Coupon created","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponDto"}}}},"400":{"description":"Invalid coupon definition","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"409":{"description":"Coupon code already exists","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/wishlist":{"get":{"tags":["Wishlist"],"summary":"Get wishlist","description":"Returns the caller's wishlist, most recently added first, with current price and stock.","operationId":"list_5","responses":{"200":{"description":"Wishlist returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WishlistItemDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"List webhook deliveries","description":"Delivery log of a subscription, newest first, optionally filtered by status. Negative page is clamped to zero; size is clamped to 1–100.","operationId":"deliveries","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","DELIVERED","FAILED"]}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"Deliveries returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoWebhookDeliveryDto"}}}},"400":{"description":"Invalid parameter","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"The subscription belongs to another user","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Subscription not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhooks/{id}/deliveries/{deliveryId}":{"get":{"tags":["Webhooks"],"summary":"Get webhook delivery","description":"Returns one delivery with its payload, last status code, error and response snippet.","operationId":"delivery","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Delivery returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryDto"}}}},"400":{"description":"Invalid delivery id","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"The subscription belongs to another user","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Subscription or delivery not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhooks/event-types":{"get":{"tags":["Webhooks"],"summary":"List webhook event types","description":"Event names a subscription can list in events[]; each is also sent as X-Webhook-Event.","operationId":"eventTypes","responses":{"200":{"description":"Event types returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEventTypeDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhook-inboxes/{token}/requests":{"get":{"tags":["Webhook inboxes"],"summary":"List received webhook requests","description":"Requests delivered to the inbox with their headers and body, newest first; the last 50 are kept.","operationId":"requests","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Requests returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookInboxRequestDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Inbox not found (or it belongs to another user)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/vat-rates":{"get":{"tags":["VAT"],"summary":"List VAT rates","description":"Lists the standard VAT rate of every configured country, ordered by country code. A rate of 0 means VAT is not applicable.","operationId":"list_6","responses":{"200":{"description":"VAT rates returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VatRateDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/vat-rates/{country}":{"get":{"tags":["VAT"],"summary":"Get VAT rate","description":"Returns the VAT rate for a country given as an ISO alpha-2 or alpha-3 code or an English name (also common variants such as UK, USA, Polska or Deutschland), ignoring case.","operationId":"get_2","parameters":[{"name":"country","in":"path","description":"Country code or name","required":true,"schema":{"type":"string"},"example":"PL"}],"responses":{"200":{"description":"VAT rate returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VatRateDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Country not recognised or no rate configured","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users":{"get":{"tags":["users"],"summary":"Get all users","description":"Returns all user accounts. Administrators see every email address; other callers see only their own in full and the others masked (j***@example.com).","operationId":"getAll","responses":{"200":{"description":"List of users","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserResponseDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/me":{"get":{"tags":["users"],"summary":"Get current user information","description":"Returns account details for the authenticated user resolved from the JWT token.","operationId":"whoAmI","responses":{"200":{"description":"Current user details","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponseDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/me/email-events":{"get":{"tags":["email-events"],"summary":"Get recent email events for the current user","description":"Returns the latest email events recorded for the authenticated user. Statuses reflect handoff to the Mailhog-backed test sink, not real-world inbox delivery.","operationId":"getMyEmailEvents","responses":{"200":{"description":"Recent email events returned successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EmailEventDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/2fa/status":{"get":{"tags":["two-factor authentication"],"summary":"Get two-factor authentication status","description":"Returns enrollment state and the number of unused recovery codes.","operationId":"status","responses":{"200":{"description":"Status returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MfaStatusResponseDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/traffic/logs":{"get":{"tags":["Traffic Monitoring"],"summary":"Get paginated HTTP traffic logs","description":"Returns the caller's captured HTTP traffic with optional filters for session, method, status, path, text, and time range. Only records the caller made while signed in are returned, plus the anonymous records (such as a sign-in attempt) of a session that belongs to the caller; with X-Client-Session-Id the result is limited to that session. Passwords, tokens, 2FA and gift card codes and credential headers are always masked. With legacy public access an anonymous caller reads the records of the session in X-Client-Session-Id, or every record without the header.","operationId":"getTrafficLogs","parameters":[{"name":"page","in":"query","description":"Zero-based page index","required":false,"schema":{"type":"string","minimum":0}},{"name":"size","in":"query","description":"Page size, clamped to 1 through the configured app.traffic.max-page-size","required":false,"schema":{"type":"integer","format":"int32","default":10}},{"name":"X-Client-Session-Id","in":"header","description":"Session identifier, trimmed before validation: 16–128 ASCII letters, digits, underscores or hyphens. Required unless legacy public access is enabled.","required":false,"schema":{"type":"string"}},{"name":"method","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"pathContains","in":"query","required":false,"schema":{"type":"string"}},{"name":"text","in":"query","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","description":"Inclusive lower timestamp bound as an ISO-8601 instant with offset; blank means no lower bound","required":false,"schema":{"type":"string"}},{"name":"to","in":"query","description":"Inclusive upper timestamp bound as an ISO-8601 instant with offset; blank means no upper bound","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully returned traffic logs","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoTrafficLogEntryDto"}}}},"400":{"description":"Invalid session header, pagination or time filter","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized or invalid Bearer token; authentication is required unless legacy public access is enabled","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[]}},"/api/v1/traffic/logs/{correlationId}":{"get":{"tags":["Traffic Monitoring"],"summary":"Get traffic log by correlation identifier","description":"Returns one captured HTTP traffic log entry using its correlation identifier, under the same visibility rules as the list; a record the caller may not read returns 404.","operationId":"getTrafficLog","parameters":[{"name":"correlationId","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-Client-Session-Id","in":"header","description":"Session identifier, trimmed before validation: 16–128 ASCII letters, digits, underscores or hyphens. Required unless legacy public access is enabled.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully returned traffic log","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrafficLogEntryDto"}}}},"400":{"description":"Invalid session header, pagination or time filter","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized or invalid Bearer token; authentication is required unless legacy public access is enabled","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Traffic log not found; empty response body","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}}},"security":[]}},"/api/v1/traffic/info":{"get":{"tags":["Traffic Monitoring"],"summary":"Get traffic monitoring information","description":"Returns WebSocket connection information. X-Client-Session-Id is required unless legacy public access is enabled; after trimming it must contain 16–128 letters, digits, underscores or hyphens.","operationId":"getTrafficInfo","parameters":[{"name":"X-Client-Session-Id","in":"header","description":"Session identifier, trimmed before validation: 16–128 ASCII letters, digits, underscores or hyphens. Required unless legacy public access is enabled.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully returned info","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrafficInfoDto"}}}},"400":{"description":"Invalid session header, pagination or time filter","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized or invalid Bearer token; authentication is required unless legacy public access is enabled","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[]}},"/api/v1/products/{productId}/reviews/summary":{"get":{"tags":["Reviews"],"summary":"Get rating summary","description":"Returns the average rating, count, and 1-5 distribution over approved reviews only.","operationId":"summary","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Summary returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSummaryDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product or review not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/products/search":{"get":{"tags":["Products"],"summary":"Search products","description":"Searches the catalog with an optional case-insensitive text query over name, category and description (substring match; % and _ are literal characters), category, price, rating and stock filters, sorting and paging. Ratings are averages of approved reviews. Facets cover the products matching every filter except category, so the category facet lists the alternatives to the selected categories; priceRange and inStockCount use the same set. relevance (the default when q is given) ranks name matches above category matches above description matches; without q the default and the relevance fallback is newest. Every invalid parameter is reported in one 400 response keyed by parameter name, including values of the wrong type.","operationId":"search","parameters":[{"name":"q","in":"query","description":"Text to find in name, category or description; trimmed, case-insensitive, at most 100 characters","required":false,"schema":{"type":"string"},"example":"laptop"},{"name":"category","in":"query","description":"Category filter, case-insensitive; repeat the parameter or separate values with commas (at most 20)","required":false,"schema":{"type":"array","items":{"type":"string","example":"Electronics"}}},{"name":"minPrice","in":"query","description":"Lowest price, inclusive, zero or greater","required":false,"schema":{"type":"number","minimum":0},"example":10.0},{"name":"maxPrice","in":"query","description":"Highest price, inclusive, zero or greater and not below minPrice","required":false,"schema":{"type":"number","minimum":0},"example":500.0},{"name":"minRating","in":"query","description":"Lowest average approved-review rating, 1-5; products without approved reviews are excluded","required":false,"schema":{"type":"number","maximum":5,"minimum":1},"example":4},{"name":"inStock","in":"query","description":"true returns only products with stock above zero; false or omitted applies no stock filter","required":false,"schema":{"type":"boolean"}},{"name":"sort","in":"query","description":"relevance (default with q), newest (default without q), price_asc, price_desc, name_asc or rating_desc","required":false,"schema":{"type":"string","enum":["relevance","newest","price_asc","price_desc","name_asc","rating_desc"]}},{"name":"page","in":"query","description":"Zero-based page index","required":false,"schema":{"type":"integer","default":0,"minimum":0}},{"name":"size","in":"query","description":"Page size, 1-100","required":false,"schema":{"type":"integer","default":20,"maximum":100,"minimum":1}}],"responses":{"200":{"description":"Search page with facets","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductSearchResultDto"}}}},"400":{"description":"Invalid search parameters","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorsDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/orders/{id}":{"get":{"tags":["Orders"],"summary":"Get order by ID","description":"Returns a single order. Administrators may access any order; clients may access only their own orders.","operationId":"getOrder","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Order retrieved successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDto"}}}},"400":{"description":"Bad request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Order not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/orders/admin":{"get":{"tags":["Orders"],"summary":"Get all orders (Admin only)","description":"Returns all orders in the system with optional status filtering and pagination. Requires an administrator role.","operationId":"getAllOrders","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","PAID","SHIPPED","DELIVERED","CANCELLED"]}},{"name":"page","in":"query","description":"Zero-based page index","required":false,"schema":{"type":"string","minimum":0}},{"name":"size","in":"query","description":"Page size, at least one","required":false,"schema":{"type":"string","minimum":1}}],"responses":{"200":{"description":"Orders retrieved successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoOrderDto"}}}},"400":{"description":"Bad request","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ValidationErrorsDto"},{"$ref":"#/components/schemas/ErrorDto"}]}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/ollama/chat/tools/definitions":{"get":{"tags":["ollama"],"summary":"List tool definitions supported by /api/v1/ollama/chat/tools","description":"Returns the backend function-calling tool schemas that clients can send to the tool-enabled chat endpoint.","operationId":"getToolDefinitions","responses":{"200":{"description":"Available tool definitions returned successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OllamaToolDefinitionDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/loyalty":{"get":{"tags":["Loyalty"],"summary":"Get loyalty account","description":"Returns the caller's points balance, lifetime points, tier and the value of the balance. Points are earned when an order becomes PAID (1 point per full 1.00 of its total, excluding the part paid with points) and redeemed at 100 points = 1.00. Users who never earned points get a zero balance.","operationId":"account","responses":{"200":{"description":"Loyalty account returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoyaltyAccountDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/loyalty/transactions":{"get":{"tags":["Loyalty"],"summary":"List loyalty transactions","description":"Lists the caller's points ledger newest first: EARNED, REDEEMED, RESTORED and REVOKED with signed points. Negative page is clamped to zero; size is clamped to 1-100.","operationId":"transactions","parameters":[{"name":"page","in":"query","description":"Zero-based page index","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Page size, 1-100","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"Loyalty transactions returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoLoyaltyTransactionDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/gift-cards/{code}":{"get":{"tags":["Gift cards"],"summary":"Check gift card balance","description":"Returns the balance, effective status and expiry of a gift card. Any signed-in user holding the code may check it; the recipient and note are never shown. Lookups share a per-user rate limit with applying gift cards to the cart.","operationId":"lookup","parameters":[{"name":"code","in":"path","description":"Case-insensitive gift card code","required":true,"schema":{"type":"string"},"example":"GC-7KQ2-M9XD-4HPA"}],"responses":{"200":{"description":"Gift card balance returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardBalanceDto"}}}},"400":{"description":"Malformed code","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Gift card not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"429":{"description":"Too many requests","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/currencies":{"get":{"tags":["Currencies"],"summary":"List currencies","description":"Lists the display currencies ordered by code. rateToUsd is the USD value of one unit; USD is the base currency.","operationId":"list_7","responses":{"200":{"description":"Currencies returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CurrencyDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/currencies/convert":{"get":{"tags":["Currencies"],"summary":"Convert amount","description":"Converts an amount (0 or more, at most 2 decimals) between two currencies through their USD rates. converted is rounded half-up to 2 decimals from the exact rate; rate is rounded half-up to 6 decimals. Currency codes are case-insensitive.","operationId":"convert","parameters":[{"name":"amount","in":"query","description":"Amount in the source currency","required":false,"schema":{"type":"string"},"example":100.0},{"name":"from","in":"query","description":"Source currency code; defaults to USD","required":false,"schema":{"type":"string"},"example":"USD"},{"name":"to","in":"query","description":"Target currency code","required":false,"schema":{"type":"string"},"example":"EUR"}],"responses":{"200":{"description":"Amount converted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyConversionDto"}}}},"400":{"description":"Missing or invalid amount or currency code","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Currency not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/cart":{"get":{"tags":["Cart"],"summary":"Get current user's cart","description":"Returns the authenticated user's cart, including item count and calculated total price.","operationId":"getCart","responses":{"200":{"description":"Successfully retrieved cart","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CartDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]},"delete":{"tags":["Cart"],"summary":"Clear cart","description":"Removes all items from the authenticated user's cart.","operationId":"clearCart","responses":{"204":{"description":"Cart cleared successfully","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/cart/tax-preview":{"get":{"tags":["Cart"],"summary":"Preview cart VAT","description":"Returns the VAT contained in the cart total (after any coupon) for a shipping country given as a code or name. The cart itself is unchanged.","operationId":"preview","parameters":[{"name":"country","in":"query","description":"Shipping country code or name","required":false,"schema":{"type":"string"},"example":"PL"}],"responses":{"200":{"description":"VAT preview returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxPreviewDto"}}}},"400":{"description":"Country missing","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Country not recognised or no rate configured","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/webhooks":{"get":{"tags":["Webhooks"],"summary":"List all webhook subscriptions","description":"Administrators list every user's subscriptions by id, optionally for one username. Secrets are never included. Negative page is clamped to zero; size is clamped to 1–100.","operationId":"list_8","parameters":[{"name":"username","in":"query","description":"Only this user's subscriptions","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"Subscriptions returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoWebhookSubscriptionDto"}}}},"400":{"description":"Invalid parameter","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/users/identity-issues":{"get":{"tags":["users"],"summary":"List accounts that break the username and email rules (Admin only)","description":"Accounts created before usernames became case-insensitive with a fixed character set and emails became case-insensitive keep working; this lists them for clean-up: usernames outside 4-255 letters, digits, '.', '_' or '-', case-variant duplicates, a username equal to another account's email, and blank, invalid or non-lower-case emails. Ordered by id.","operationId":"identityIssues","responses":{"200":{"description":"Accounts with at least one issue; empty when all comply","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserIdentityIssueDto"}}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/reviews":{"get":{"tags":["Reviews"],"summary":"List reviews for moderation","description":"Lists reviews oldest first, optionally filtered by status. Negative page is clamped to zero; size is clamped to 1-100.","operationId":"list_9","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","APPROVED","REJECTED"]}},{"name":"page","in":"query","description":"Zero-based page index","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","description":"Page size, 1-100","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"Reviews returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoReviewDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/products/export":{"get":{"tags":["Products"],"summary":"Export products as CSV","description":"Downloads every product as RFC 4180 CSV with header id,name,description,price,stockQuantity,category,imageUrl. Text cells that start with =, +, -, @, tab or carriage return are prefixed with a single quote.","operationId":"export","responses":{"200":{"description":"CSV file","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/inventory":{"get":{"tags":["Inventory"],"summary":"List inventory","description":"Lists inventory with optional stock and catalog filters. Negative page is clamped to zero; size is clamped to 1–100. lowStockThreshold must be at least 1.","operationId":"list_10","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":20}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"category","in":"query","required":false,"schema":{"type":"string"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["IN_STOCK","LOW_STOCK","OUT_OF_STOCK"]}},{"name":"lowStockThreshold","in":"query","description":"Inclusive upper bound for LOW_STOCK; at least one","required":false,"schema":{"type":"string","minimum":1}}],"responses":{"200":{"description":"Inventory returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoInventoryItemDto"}}}},"400":{"description":"Invalid parameter","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/inventory/{productId}":{"get":{"tags":["Inventory"],"summary":"Get inventory item","description":"Returns the available quantity for one product.","operationId":"get_3","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"lowStockThreshold","in":"query","description":"Inclusive upper bound for LOW_STOCK; at least one","required":false,"schema":{"type":"string","minimum":1}}],"responses":{"200":{"description":"Inventory item returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryItemDto"}}}},"400":{"description":"Invalid parameter","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/inventory/{productId}/movements":{"get":{"tags":["Inventory"],"summary":"List inventory movements","description":"Lists an inventory item's movement history newest first. Negative page is clamped to zero; size is clamped to 1–100.","operationId":"movements","parameters":[{"name":"productId","in":"path","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":0}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":20}}],"responses":{"200":{"description":"Movement history returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PageDtoInventoryMovementDto"}}}},"400":{"description":"Invalid parameter","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Product not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"503":{"description":"Inventory service unavailable: the movement history is read from warehouse-service","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/admin/gift-cards/{code}":{"get":{"tags":["Gift cards"],"summary":"Get gift card","description":"Returns one gift card with its recipient, note and ledger (ISSUED, REDEEMED, RESTORED, DISABLED), oldest first. The code is case-insensitive.","operationId":"get_4","parameters":[{"name":"code","in":"path","description":"Gift card code","required":true,"schema":{"type":"string"},"example":"GC-7KQ2-M9XD-4HPA"}],"responses":{"200":{"description":"Gift card returned","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardDto"}}}},"400":{"description":"Malformed code","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Gift card not found","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/webhook-inboxes/{token}":{"delete":{"tags":["Webhook inboxes"],"summary":"Delete webhook inbox","description":"Deletes the inbox and its requests. Subscriptions that target it fail until they are updated.","operationId":"delete_4","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Inbox deleted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"Inbox not found (or it belongs to another user)","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}},"/api/v1/users/{username}/right-to-be-forgotten":{"delete":{"tags":["users"],"summary":"Delete user account and all user-owned data","description":"Deletes the user account together with refresh tokens, reset tokens, email events, cart items, and orders. Open (PENDING or PAID) orders are cancelled first: their stock is restored and card payments are refunded through the event feed. Shipped and delivered orders are deleted as they are.","operationId":"forget","parameters":[{"name":"username","in":"path","description":"Username","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"User account and user-owned data were deleted","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}}},"401":{"description":"Unauthorized","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"403":{"description":"Forbidden","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}},"404":{"description":"The user doesn't exist","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorDto"}}}}},"security":[{"bearerAuth":[]}]}}},"components":{"schemas":{"WishlistUpdateDto":{"type":"object","description":"Wishlist entry settings","properties":{"notifyWhenAvailable":{"type":["boolean","null"],"description":"Email when back in stock; defaults to false","example":true}}},"ErrorDto":{"type":"object","additionalProperties":false,"properties":{"message":{"type":"string","description":"Error message","example":"Error message"}},"required":["message"]},"WishlistItemDto":{"type":"object","description":"Wishlist entry with the product's current price and availability","properties":{"productId":{"type":"integer","format":"int64","description":"Product ID","example":3},"productName":{"type":"string","description":"Product name","example":"iPhone 13 Pro"},"price":{"type":"number","description":"Current product price","example":999.99},"imageUrl":{"type":["string","null"],"description":"Product image URL"},"stockQuantity":{"type":"integer","format":"int32","description":"Current stock quantity","example":0},"stockStatus":{"type":"string","description":"OUT_OF_STOCK when quantity is zero, otherwise IN_STOCK","enum":["IN_STOCK","LOW_STOCK","OUT_OF_STOCK"],"example":"OUT_OF_STOCK"},"notifyWhenAvailable":{"type":"boolean","description":"Email the user when the product is back in stock","example":true},"lastNotifiedAt":{"type":["string","null"],"format":"local-date-time","description":"Last back-in-stock email"},"addedAt":{"type":"string","format":"local-date-time","description":"When the product was added"}}},"WebhookUpdateDto":{"type":"object","description":"Replacement settings of a webhook subscription","properties":{"url":{"type":"string","description":"Public http(s) endpoint on port 80 or 443, or inbox://<token> of one of your inboxes","example":"https://example.com/webhooks/shop","maxLength":2048,"minLength":1,"pattern":"\\S"},"events":{"type":"array","description":"Event types to receive","items":{"type":"string"},"maxItems":20,"minItems":0},"description":{"type":["string","null"],"description":"Free-text label; null clears it","example":"Order sync","maxLength":255,"minLength":0},"active":{"type":["boolean","null"],"description":"Enable or disable deliveries; null keeps the current value. Re-enabling an auto-disabled subscription resets its failure counter.","example":true}},"required":["events","url"]},"ValidationErrorsDto":{"type":"object","additionalProperties":{"type":"string","description":"Validation messages keyed by field name; invalid arguments use the error key","example":{"email":"Email should be valid"}},"description":"Validation messages keyed by field name; invalid arguments use the error key","example":{"email":"Email should be valid"},"properties":{"empty":{"type":"boolean"}}},"WebhookSubscriptionDto":{"type":"object","description":"Webhook subscription","properties":{"id":{"type":"integer","format":"int64","description":"Subscription id","example":1},"username":{"type":"string","description":"Owner","example":"client"},"url":{"type":"string","description":"Target URL","example":"https://example.com/webhooks/shop"},"description":{"type":["string","null"],"description":"Free-text label","example":"Order sync"},"events":{"type":"array","description":"Subscribed event types","example":["order.created"],"items":{"type":"string"}},"active":{"type":"boolean","description":"Whether events are delivered","example":true},"consecutiveFailures":{"type":"integer","format":"int32","description":"Failed attempts since the last successful delivery; 20 disables the subscription","example":0},"disabledReason":{"type":["string","null"],"description":"Why the subscription was disabled automatically","example":"Disabled after 20 consecutive failed deliveries"},"secret":{"type":"string","description":"Signing secret. Returned only by create and rotate-secret; store it, it is never shown again.","example":"whsec_q9nZ2l0aHViLmNvbS93ZWJob29rcy1zZWNyZXQtZXhhbXBsZQ"},"createdAt":{"type":"string","format":"date-time","description":"Creation time (UTC)","example":"2026-11-10T20:40:33Z"},"updatedAt":{"type":"string","format":"date-time","description":"Last change (UTC)","example":"2026-11-10T20:40:33Z"}}},"UserEditDto":{"type":"object","description":"User details","properties":{"email":{"type":"string","format":"email","description":"Email address","example":"john.doe@example.com","minLength":1,"pattern":"\\S"},"firstName":{"type":["string","null"],"description":"First name","example":"John","maxLength":255,"minLength":4,"pattern":"\\S"},"lastName":{"type":["string","null"],"description":"Last name","example":"Boyd","maxLength":255,"minLength":4,"pattern":"\\S"}},"required":["email"]},"UserResponseDto":{"type":"object","properties":{"id":{"type":"integer","format":"int32","description":"User ID","example":1},"username":{"type":"string","description":"Username","example":"johndoe"},"email":{"type":"string","description":"Email address. Shown in full to administrators and for the caller's own account; other accounts' addresses are masked for other callers, keeping the first character and the domain (j***@example.com).","example":"john.doe@example.com"},"roles":{"type":"array","description":"User roles","example":["ROLE_CLIENT"],"items":{"type":"string","enum":["ROLE_ADMIN","ROLE_CLIENT","ROLE_WAREHOUSE"]}},"firstName":{"type":["string","null"],"description":"First name","example":"John"},"lastName":{"type":["string","null"],"description":"Last name","example":"Boyd"}}},"ToolSystemPromptDto":{"type":"object","description":"Tool system prompt","properties":{"toolSystemPrompt":{"type":["string","null"],"description":"Null, omitted, or empty resets the override. Tool-specific system prompt for function calling","example":"Always call get_product_snapshot before answering.","maxLength":5000,"minLength":0}}},"ChatSystemPromptDto":{"type":"object","description":"Chat system prompt","properties":{"chatSystemPrompt":{"type":["string","null"],"description":"Null, omitted, or empty resets the override. General chat system prompt","example":"You are a helpful assistant.","maxLength":5000,"minLength":0}}},"ReviewRequestDto":{"type":"object","description":"Product review content","properties":{"rating":{"type":"integer","format":"int32","description":"Star rating","example":5,"maximum":5,"minimum":1},"title":{"type":"string","description":"Review title","example":"Great phone","maxLength":120,"minLength":3,"pattern":"\\S"},"body":{"type":"string","description":"Review text","example":"Battery lasts two days and the camera is excellent.","maxLength":2000,"minLength":10,"pattern":"\\S"}},"required":["body","rating","title"]},"ReviewDto":{"type":"object","description":"Product review","properties":{"id":{"type":"integer","format":"int64","description":"Review ID","example":1},"productId":{"type":"integer","format":"int64","description":"Product ID","example":3},"productName":{"type":"string","description":"Product name","example":"iPhone 13 Pro"},"username":{"type":"string","description":"Author username","example":"client"},"rating":{"type":"integer","format":"int32","description":"Star rating","example":5},"title":{"type":"string","description":"Review title","example":"Great phone"},"body":{"type":"string","description":"Review text"},"status":{"type":"string","description":"Moderation status","enum":["PENDING","APPROVED","REJECTED"],"example":"APPROVED"},"moderationNote":{"type":["string","null"],"description":"Moderator note, visible to the author and administrators"},"createdAt":{"type":"string","format":"local-date-time","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"local-date-time","description":"Last update timestamp"}}},"ProductUpdateDto":{"type":"object","description":"Update product data transfer object","properties":{"name":{"type":["string","null"],"description":"Product name","example":"iPhone 13","maxLength":100,"minLength":3,"pattern":"\\S"},"description":{"type":["string","null"],"description":"Product description","example":"Latest iPhone model with A15 Bionic chip","maxLength":1000,"minLength":0},"price":{"type":["number","null"],"description":"Product price with at most 8 integer digits and 2 fractional digits","example":999.99,"maximum":99999999.99,"minimum":0.01,"multipleOf":0.01},"stockQuantity":{"type":["integer","null"],"format":"int32","description":"Available stock quantity","example":100,"minimum":0},"category":{"type":["string","null"],"description":"Product category; null or an empty string leaves it unchanged","example":"Electronics","maxLength":255,"minLength":0},"imageUrl":{"type":["string","null"],"description":"Absolute http(s) URL of the product image, or empty for none","example":"https://example.com/iphone13.jpg","maxLength":255,"minLength":0}}},"ProductDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"stockQuantity":{"type":"integer","format":"int32"},"category":{"type":"string"},"imageUrl":{"type":["string","null"]},"createdAt":{"type":"string","format":"local-date-time","description":"Server local date and time without an offset. The server timezone is deployment-dependent; this value does not identify an absolute instant.","example":"2026-09-10T10:30:02.809462"},"updatedAt":{"type":"string","format":"local-date-time","description":"Server local date and time without an offset. The server timezone is deployment-dependent; this value does not identify an absolute instant.","example":"2026-09-10T10:30:02.809462"}}},"AddressDto":{"type":"object","description":"Address data transfer object","properties":{"street":{"type":"string","description":"Street address","example":"123 Main St","maxLength":255,"minLength":1,"pattern":"\\S"},"city":{"type":"string","description":"City","example":"New York","maxLength":255,"minLength":1,"pattern":"\\S"},"state":{"type":"string","description":"State","example":"NY","maxLength":255,"minLength":1,"pattern":"\\S"},"zipCode":{"type":"string","description":"Postal/ZIP code","example":"35-119","maxLength":10,"minLength":1,"pattern":"^(?:[0-9]{2}(?:-[0-9]{3})?|[0-9]{5}(?:-[0-9]{4})?)$"},"country":{"type":"string","description":"Country","example":"Poland","maxLength":255,"minLength":1,"pattern":"\\S"}},"required":["city","country","state","street","zipCode"]},"OrderDto":{"type":"object","description":"Order data transfer object","properties":{"id":{"type":"integer","format":"int64","description":"Order ID","example":1},"username":{"type":"string","description":"Username","example":"john.doe"},"items":{"type":"array","description":"Order items","items":{"$ref":"#/components/schemas/OrderItemDto"}},"totalAmount":{"type":"number","description":"Total amount","example":1999.98},"subtotalAmount":{"type":"number","description":"Sum of item prices before discounts","example":2222.2},"discountAmount":{"type":"number","description":"Coupon discount subtracted from the subtotal","example":222.22},"couponCode":{"type":["string","null"],"description":"Coupon code applied at checkout","example":"WELCOME10"},"status":{"type":"string","description":"Order status","enum":["PENDING","PAID","SHIPPED","DELIVERED","CANCELLED"],"example":"PENDING"},"fulfilmentState":{"type":["string","null"],"description":"Warehouse progress mirrored from warehouse-service; omitted until the order is released to the warehouse","enum":["NONE","AWAITING_PICK","PICKED","PACKED","SHIPPED","DELIVERED","CANCELLED",null],"example":"AWAITING_PICK"},"refundedAmount":{"type":["number","null"],"description":"Amount refunded for returned items; omitted until a refund is booked","example":49.99},"taxCountry":{"type":["string","null"],"description":"ISO country code whose VAT is contained in the total; omitted when no VAT rate applies","example":"PL"},"taxRate":{"type":["number","null"],"description":"VAT rate in percent at checkout; 0 means VAT is not applicable","example":23.0},"taxAmount":{"type":["number","null"],"description":"VAT contained in the VAT-inclusive total","example":373.98},"netAmount":{"type":["number","null"],"description":"Total without VAT (totalAmount - taxAmount)","example":1626.0},"giftCardCode":{"type":["string","null"],"description":"Gift card used at checkout; omitted when none was used","example":"GC-7KQ2-M9XD-4HPA"},"giftCardAmount":{"type":["number","null"],"description":"Part of the total paid with the gift card","example":25.0},"pointsRedeemed":{"type":["integer","null"],"format":"int64","description":"Loyalty points redeemed at checkout","example":500},"pointsAmount":{"type":["number","null"],"description":"Part of the total paid with loyalty points (100 points = 1.00)","example":5.0},"amountDue":{"type":["number","null"],"description":"Total minus the gift card and points parts, which a card payment must cover; only present when a gift card or points were used","example":1969.98},"reservationExpiresAt":{"type":["string","null"],"format":"date-time","description":"When the stock reservation of a PENDING order ends (ISO-8601 UTC, milliseconds); the order is cancelled if it is not paid by then. Omitted for orders created without a reservation","example":"2026-11-14T10:30:00.000Z"},"shippingAddress":{"$ref":"#/components/schemas/AddressDto","description":"Shipping address"},"createdAt":{"type":"string","format":"local-date-time","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"local-date-time","description":"Last update timestamp"}},"required":["shippingAddress"]},"OrderItemDto":{"type":"object","description":"Order item data transfer object","properties":{"id":{"type":"integer","format":"int64","description":"Order item ID","example":1},"productId":{"type":"integer","format":"int64","description":"Product ID","example":1},"quantity":{"type":"integer","format":"int32","description":"Quantity","example":2,"minimum":1},"productName":{"type":"string","description":"Product name","example":"iPhone 13 Pro"},"unitPrice":{"type":"number","description":"Unit price","example":999.99},"totalPrice":{"type":"number","description":"Total price","example":1999.98}},"required":["productId","quantity"]},"ApplyLoyaltyPointsDto":{"type":"object","description":"Loyalty points to redeem at checkout, in whole multiples of 100 (100 points = 1.00)","properties":{"points":{"type":"integer","format":"int64","description":"Points to redeem","example":500,"maximum":100000000,"minimum":100,"multipleOf":100.0}},"required":["points"]},"CartDto":{"type":"object","properties":{"username":{"type":"string","description":"Cart owner","example":"admin"},"items":{"type":"array","items":{"$ref":"#/components/schemas/CartItemDto"}},"totalPrice":{"type":"number","description":"Total Cart price","example":199.56},"totalItems":{"type":"integer","format":"int32","description":"Total number of items","example":7},"couponCode":{"type":["string","null"],"description":"Coupon applied to the cart","example":"WELCOME10"},"couponValid":{"type":["boolean","null"],"description":"Whether the applied coupon currently qualifies; null when no coupon is applied"},"couponMessage":{"type":["string","null"],"description":"Why the applied coupon does not qualify","example":"Order subtotal must be at least 100.00"},"discountAmount":{"type":"number","description":"Discount that checkout would apply","example":19.96},"totalAfterDiscount":{"type":"number","description":"Total price after the discount","example":179.6},"giftCardCode":{"type":["string","null"],"description":"Gift card applied to the cart; omitted when none is applied","example":"GC-7KQ2-M9XD-4HPA"},"giftCardAmount":{"type":["number","null"],"description":"Part of the total checkout would pay with the gift card (zero when the card cannot be used)","example":25.0},"pointsRedeemed":{"type":["integer","null"],"format":"int64","description":"Loyalty points checkout would redeem, capped at what the remaining total needs","example":500},"pointsAmount":{"type":["number","null"],"description":"Value of the redeemed points (100 points = 1.00)","example":5.0},"amountDue":{"type":["number","null"],"description":"What remains to pay after the coupon, gift card and points; only present when a gift card or points are applied","example":149.6}}},"CartItemDto":{"type":"object","properties":{"productId":{"type":"integer","format":"int64","description":"Product id","example":13},"quantity":{"type":"integer","format":"int32","description":"Product quantity","example":1,"minimum":1},"priceChanged":{"type":["boolean","null"],"description":"Present (true) only when the product price changed after the line was last added or updated","example":true,"readOnly":true},"unitPrice":{"type":["number","null"],"description":"Unit price the cart keeps and checkout charges; present only when the price changed","example":10.0,"readOnly":true},"currentPrice":{"type":["number","null"],"description":"Current product price, which adding to or updating the line takes; present only when the price changed","example":12.5,"readOnly":true}},"required":["productId","quantity"]},"UpdateCartItemDto":{"type":"object","properties":{"quantity":{"type":"integer","format":"int32","description":"Product quantity","example":1,"minimum":0}},"required":["quantity"]},"ApplyGiftCardDto":{"type":"object","description":"Gift card code to apply to the cart","properties":{"code":{"type":"string","description":"Case-insensitive code in the format GC-XXXX-XXXX-XXXX","example":"gc-7kq2-m9xd-4hpa","maxLength":32,"minLength":1,"pattern":"\\S"}},"required":["code"]},"ApplyCouponDto":{"type":"object","description":"Coupon code to apply to the cart","properties":{"code":{"type":"string","description":"Case-insensitive coupon code","example":"welcome10","maxLength":64,"minLength":1,"pattern":"\\S"}},"required":["code"]},"VatRateRequestDto":{"type":"object","description":"VAT rate definition. Changes apply to orders created afterwards; existing orders keep their rate.","properties":{"countryName":{"type":"string","description":"Country name","example":"Poland","maxLength":64,"minLength":1,"pattern":"\\S"},"rate":{"type":"number","description":"Rate in percent; 0 means VAT is not applicable","example":23.0,"maximum":50.00,"minimum":0.00,"multipleOf":0.01}},"required":["countryName","rate"]},"VatRateDto":{"type":"object","description":"Standard VAT rate of a country. Prices are VAT-inclusive; a rate of 0 means VAT is not applicable.","properties":{"countryCode":{"type":"string","description":"ISO 3166-1 alpha-2 country code","example":"PL"},"countryName":{"type":"string","description":"Country name","example":"Poland"},"rate":{"type":"number","description":"Rate in percent","example":23.0},"updatedAt":{"type":"string","format":"local-date-time","description":"Last change (server-local)"}}},"ModerationRequestDto":{"type":"object","description":"Moderation decision. REJECTED requires a note.","properties":{"decision":{"type":"string","description":"Decision","enum":["APPROVED","REJECTED"],"example":"APPROVED"},"note":{"type":["string","null"],"description":"Reason shown to the author","example":"Contains a link to another shop","maxLength":500,"minLength":0}},"required":["decision"]},"CurrencyRequestDto":{"type":"object","description":"Currency definition. USD is the base currency and its rate must stay 1.","properties":{"name":{"type":"string","description":"Currency name","example":"Euro","maxLength":64,"minLength":1,"pattern":"\\S"},"symbol":{"type":"string","description":"Display symbol","example":"€","maxLength":8,"minLength":1,"pattern":"\\S"},"rateToUsd":{"type":"number","description":"Value of one unit in USD","example":1.08,"exclusiveMinimum":0,"maximum":999999.999999,"minimum":0.000001,"multipleOf":0.0000010}},"required":["name","rateToUsd","symbol"]},"CurrencyDto":{"type":"object","description":"Display currency with a fixed demo exchange rate. Prices are stored in USD.","properties":{"code":{"type":"string","description":"ISO 4217 code","example":"EUR"},"name":{"type":"string","description":"Currency name","example":"Euro"},"symbol":{"type":"string","description":"Display symbol","example":"€"},"rateToUsd":{"type":"number","description":"Value of one unit in USD","example":1.08},"updatedAt":{"type":"string","format":"local-date-time","description":"Last change (server-local)"}}},"CouponRequestDto":{"type":"object","description":"Coupon definition. PERCENTAGE values must be between 1 and 100; validUntil must be after validFrom.","properties":{"code":{"type":"string","description":"Case-insensitive code, stored upper-case","example":"WELCOME10","maxLength":32,"minLength":3,"pattern":"^[A-Za-z0-9-]{3,32}$"},"description":{"type":["string","null"],"description":"Internal description","example":"Welcome discount","maxLength":255,"minLength":0},"type":{"type":"string","description":"Discount type","enum":["PERCENTAGE","FIXED_AMOUNT"],"example":"PERCENTAGE"},"value":{"type":"number","description":"Percent (1-100) or fixed amount","example":10,"minimum":0.01,"multipleOf":0.01},"minOrderAmount":{"type":["number","null"],"description":"Minimum cart subtotal","example":100.0,"minimum":0.00,"multipleOf":0.01},"validFrom":{"type":["string","null"],"format":"local-date-time","description":"Start of validity (server-local)"},"validUntil":{"type":["string","null"],"format":"local-date-time","description":"End of validity (server-local)"},"maxRedemptions":{"type":["integer","null"],"format":"int32","description":"Global redemption limit; null means unlimited","example":100,"minimum":1},"perUserLimit":{"type":["integer","null"],"format":"int32","description":"Redemptions allowed per user; defaults to 1","example":1,"minimum":1},"active":{"type":["boolean","null"],"description":"Whether the coupon can be used; defaults to true","example":true}},"required":["code","type","value"]},"CouponDto":{"type":"object","description":"Coupon","properties":{"id":{"type":"integer","format":"int64","description":"Coupon ID","example":1},"code":{"type":"string","description":"Upper-case coupon code","example":"WELCOME10"},"description":{"type":["string","null"],"description":"Internal description"},"type":{"type":"string","description":"Discount type","enum":["PERCENTAGE","FIXED_AMOUNT"],"example":"PERCENTAGE"},"value":{"type":"number","description":"Percent or fixed amount","example":10.0},"minOrderAmount":{"type":["number","null"],"description":"Minimum cart subtotal"},"validFrom":{"type":["string","null"],"format":"local-date-time","description":"Start of validity"},"validUntil":{"type":["string","null"],"format":"local-date-time","description":"End of validity"},"maxRedemptions":{"type":["integer","null"],"format":"int32","description":"Global redemption limit"},"perUserLimit":{"type":"integer","format":"int32","description":"Redemptions allowed per user","example":1},"redemptionCount":{"type":"integer","format":"int32","description":"Redemptions currently counted","example":0},"active":{"type":"boolean","description":"Administrator switch","example":true},"status":{"type":"string","description":"Effective status at the time of the request","enum":["ACTIVE","INACTIVE","SCHEDULED","EXPIRED","EXHAUSTED"],"example":"ACTIVE"},"createdAt":{"type":"string","format":"local-date-time","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"local-date-time","description":"Last update timestamp"}}},"WebhookCreateDto":{"type":"object","description":"New webhook subscription","properties":{"url":{"type":"string","description":"Public http(s) endpoint on port 80 or 443, or inbox://<token> of one of your inboxes","example":"https://example.com/webhooks/shop","maxLength":2048,"minLength":1,"pattern":"\\S"},"events":{"type":"array","description":"Event types to receive; see GET /api/v1/webhooks/event-types","items":{"type":"string"},"maxItems":20,"minItems":0},"description":{"type":["string","null"],"description":"Free-text label","example":"Order sync","maxLength":255,"minLength":0}},"required":["events","url"]},"WebhookDeliveryDto":{"type":"object","description":"One event sent to a webhook subscription and the outcome of its last attempt","properties":{"id":{"type":"string","format":"uuid","description":"Delivery id, sent as X-Webhook-Id","example":"0b8f4f0e-3f43-4b8e-9d55-4a3f1c1f6a10"},"subscriptionId":{"type":"integer","format":"int64","description":"Subscription id","example":1},"eventId":{"type":"string","format":"uuid","description":"Event id (the payload's id); shared by redeliveries of the same event","example":"6a1f0f57-0f7c-4bb4-8a43-2f9d8f7e8c11"},"eventType":{"type":"string","description":"Event type, sent as X-Webhook-Event","example":"order.created"},"status":{"type":"string","description":"Delivery status","enum":["PENDING","DELIVERED","FAILED"],"example":"DELIVERED"},"attempts":{"type":"integer","format":"int32","description":"Attempts made so far","example":1},"nextAttemptAt":{"type":["string","null"],"format":"date-time","description":"When the next retry is due (PENDING only)"},"lastStatusCode":{"type":["integer","null"],"format":"int32","description":"HTTP status of the last attempt, if a response arrived","example":200},"lastError":{"type":["string","null"],"description":"Why the last attempt failed","example":"HTTP 500"},"responseSnippet":{"type":["string","null"],"description":"First 500 characters of the last response body","example":"ok"},"durationMs":{"type":["integer","null"],"format":"int64","description":"Duration of the last attempt in milliseconds","example":42},"payload":{"type":"string","description":"The exact JSON body that was signed and sent","example":{"id":"6a1f0f57-0f7c-4bb4-8a43-2f9d8f7e8c11","type":"order.created","createdAt":"2026-11-10T20:40:33.120Z","data":{"orderId":1,"status":"PENDING","totalAmount":40.0}}},"createdAt":{"type":"string","format":"date-time","description":"Creation time (UTC)","example":"2026-11-10T20:40:33Z"},"deliveredAt":{"type":["string","null"],"format":"date-time","description":"When a 2xx response was received"}}},"WebhookInboxDto":{"type":"object","description":"Built-in webhook receiver","properties":{"token":{"type":"string","description":"Inbox token","example":"Q2xhdWRlIGlzIGEgZ29vZCBib3QgOik"},"url":{"type":"string","description":"Webhook URL to subscribe with","example":"inbox://Q2xhdWRlIGlzIGEgZ29vZCBib3QgOik"},"createdAt":{"type":"string","format":"date-time","description":"Creation time (UTC)","example":"2026-11-10T20:40:33Z"}}},"UserRegisterDto":{"type":"object","description":"Signup User","properties":{"username":{"type":"string","description":"Username of letters, digits, dots, underscores and hyphens; unique regardless of letter case","example":"johndoe","maxLength":255,"minLength":4,"pattern":"^[A-Za-z0-9._-]*$"},"email":{"type":"string","format":"email","description":"Email address; stored lower-case and unique regardless of letter case","example":"john.doe@example.com","minLength":1,"pattern":"\\S"},"password":{"type":"string","description":"Password of at least 8 characters and at most 72 bytes in UTF-8 (the BCrypt limit; a character outside ASCII takes 2 to 4 bytes)","example":"password123","maxLength":72,"minLength":8,"pattern":"\\S"},"firstName":{"type":"string","description":"First name","example":"John","maxLength":255,"minLength":4,"pattern":"\\S"},"lastName":{"type":"string","description":"Last name","example":"Boyd","maxLength":255,"minLength":4,"pattern":"\\S"}},"required":["email","firstName","lastName","password","username"]},"LoginDto":{"type":"object","description":"Login details","properties":{"username":{"type":"string","description":"Username","example":"client","maxLength":255,"minLength":4},"password":{"type":"string","description":"Password","example":"client","maxLength":255,"minLength":4}},"required":["password","username"]},"LoginResponseDto":{"type":"object","properties":{"token":{"type":["string","null"],"description":"JWT token","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"refreshToken":{"type":["string","null"],"description":"Refresh token"},"username":{"type":"string","description":"Username","example":"johndoe"},"email":{"type":"string","description":"Email address","example":"john.doe@example.com"},"firstName":{"type":["string","null"],"description":"First name","example":"John"},"lastName":{"type":["string","null"],"description":"Last name","example":"Doe"},"roles":{"type":"array","description":"User roles","example":["ROLE_CLIENT"],"items":{"type":"string","enum":["ROLE_ADMIN","ROLE_CLIENT","ROLE_WAREHOUSE"]}},"mfaRequired":{"type":"boolean","description":"Whether a second factor is required before tokens can be issued"},"challengeToken":{"type":["string","null"],"description":"Short-lived, single-use MFA challenge token"},"challengeExpiresAt":{"type":["string","null"],"format":"date-time","description":"MFA challenge expiration time"}}},"MfaChallengeRequestDto":{"type":"object","properties":{"challengeToken":{"type":"string","description":"Short-lived challenge returned after password verification","maxLength":255,"minLength":1,"pattern":"\\S"},"code":{"type":"string","description":"Six-digit authenticator code or one-time recovery code","maxLength":32,"minLength":6,"pattern":"\\S"}},"required":["challengeToken","code"]},"RefreshTokenRequestDto":{"type":"object","properties":{"refreshToken":{"type":"string","description":"Refresh token obtained during login","minLength":1,"pattern":"\\S"}},"required":["refreshToken"]},"TokenRefreshResponseDto":{"type":"object","properties":{"token":{"type":"string","description":"Fresh JWT access token"},"refreshToken":{"type":"string","description":"Rotated refresh token"}}},"ResetPasswordRequestDto":{"type":"object","properties":{"token":{"type":"string","description":"Password reset token received via email","minLength":1,"pattern":"\\S"},"newPassword":{"type":"string","description":"New password of at least 8 characters and at most 72 bytes in UTF-8 (the BCrypt limit)","example":"password123","maxLength":72,"minLength":8,"pattern":"\\S"},"confirmPassword":{"type":"string","description":"Confirmation of the new password","example":"password123","minLength":1,"pattern":"\\S"}},"required":["confirmPassword","newPassword","token"]},"ForgotPasswordRequestDto":{"type":"object","properties":{"identifier":{"type":"string","description":"Username or email address associated with the account","example":"client","minLength":1,"pattern":"\\S"}},"required":["identifier"]},"ForgotPasswordResponseDto":{"type":"object","properties":{"message":{"type":"string","description":"Human readable status message"},"token":{"type":["string","null"],"description":"Raw password reset token only when password-reset.expose-token-in-response is enabled and an account matches; otherwise null"}}},"MfaSetupResponseDto":{"type":"object","properties":{"secret":{"type":"string","description":"Manual Base32 setup key"},"otpAuthUri":{"type":"string","description":"Standard OTPAuth URI"},"qrCodeDataUri":{"type":"string","description":"PNG QR code encoded as a data URI"},"expiresAt":{"type":"string","format":"date-time","description":"Time at which this unconfirmed setup expires"}}},"MfaProtectedActionRequestDto":{"type":"object","properties":{"password":{"type":"string","description":"Current account password","maxLength":255,"minLength":1,"pattern":"\\S"},"code":{"type":"string","description":"Six-digit authenticator code or one-time recovery code","maxLength":32,"minLength":6,"pattern":"\\S"}},"required":["code","password"]},"MfaRecoveryCodesResponseDto":{"type":"object","properties":{"recoveryCodes":{"type":"array","description":"One-time recovery codes. These are returned only when created.","items":{"type":"string"}}}},"MfaCodeRequestDto":{"type":"object","properties":{"code":{"type":"string","description":"Six-digit code from an authenticator app","example":"123456","minLength":1,"pattern":"\\d{6}"}},"required":["code"]},"CreateQrDto":{"type":"object","description":"QR link","properties":{"text":{"type":"string","description":"Text to use in QR code","example":"https://awesome-testing.com","minLength":1,"pattern":"\\S"}},"required":["text"]},"ProductCreateDto":{"type":"object","description":"Create product data transfer object","properties":{"name":{"type":"string","description":"Product name","example":"iPhone 13","maxLength":100,"minLength":3,"pattern":"\\S"},"description":{"type":"string","description":"Nonblank product description required on creation; updates may use an empty description","example":"Latest iPhone model with A15 Bionic chip","maxLength":1000,"minLength":1,"pattern":"\\S"},"price":{"type":"number","description":"Product price with at most 8 integer digits and 2 fractional digits","example":999.99,"maximum":99999999.99,"minimum":0.01,"multipleOf":0.01},"stockQuantity":{"type":"integer","format":"int32","description":"Available stock quantity","example":100,"minimum":0},"category":{"type":"string","description":"Product category","example":"Electronics","maxLength":255,"minLength":1,"pattern":"\\S"},"imageUrl":{"type":["string","null"],"description":"Absolute http(s) URL of the product image, or empty for none","example":"https://example.com/iphone13.jpg","maxLength":255,"minLength":0}},"required":["category","description","name","price","stockQuantity"]},"StreamedRequestDto":{"type":"object","properties":{"model":{"type":"string","description":"Model to use, needs to be available on the Ollama server.","example":"qwen3.5:2b","minLength":1,"pattern":"\\S"},"prompt":{"type":"string","description":"Prompt","example":"Hello, how are you?","minLength":1,"pattern":"\\S"},"options":{"type":"object","additionalProperties":{},"description":"Options","example":{"temperature":0.5}},"think":{"type":"boolean","description":"Should the model think before responding?","example":false}},"required":["model","prompt"]},"GenerateResponseDto":{"type":"object","properties":{"model":{"type":["string","null"]},"response":{"type":["string","null"]},"thinking":{"type":["string","null"]},"done":{"type":"boolean"},"context":{"type":["array","null"],"items":{"type":"integer","format":"int64"}},"created_at":{"type":["string","null"]},"total_duration":{"type":["integer","null"],"format":"int64"}}},"ErrorResponse":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"message":{"type":"string"},"timestamp":{"type":"string"}}},"ModelNotFoundDto":{"type":"object","properties":{"error":{"type":"string","description":"Missing model error. You need to pull it","example":"model 'X' not found"}}},"ChatMessageDto":{"type":"object","properties":{"role":{"type":"string","minLength":1,"pattern":"^(system|user|assistant|tool)$"},"content":{"type":["string","null"]},"thinking":{"type":["string","null"]},"contentOrThinkingOrToolCallPresent":{"type":"boolean","description":"Computed validation: nonblank content or thinking, or nonempty tool_calls is required","readOnly":true},"toolNamePresentForToolRole":{"type":"boolean","description":"Computed validation: role tool requires a nonblank tool_name","readOnly":true},"tool_calls":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ToolCallDto"}},"tool_name":{"type":["string","null"]}},"required":["role"]},"ChatRequestDto":{"type":"object","properties":{"model":{"type":"string","description":"Model to use. Must be available on the Ollama server. Clients can override it per request.","example":"qwen3.5:2b","minLength":1,"pattern":"\\S"},"messages":{"type":"array","description":"Complete conversation history in chronological order.","example":[{"role":"system","content":"You are a helpful AI assistant. You must use the conversation history to answer questions."},{"role":"user","content":"I love programming in Python."},{"role":"assistant","content":"That's great! Python is a versatile and popular programming language. What do you enjoy most about Python programming?"},{"role":"user","content":"What programming language did I say I love?"}],"items":{"$ref":"#/components/schemas/ChatMessageDto"},"minItems":1},"options":{"type":"object","additionalProperties":{},"description":"Options","example":{"temperature":0.7}},"tools":{"type":"array","description":"Function/tool definitions available to the model.","items":{"$ref":"#/components/schemas/OllamaToolDefinitionDto"}},"think":{"type":"boolean","description":"Should the model think before responding?","example":false}},"required":["messages","model"]},"OllamaToolDefinitionDto":{"type":"object","properties":{"type":{"type":"string","description":"Type of the tool. Only 'function' is supported currently.","example":"function","minLength":1},"function":{"$ref":"#/components/schemas/OllamaToolFunctionDto","description":"Function metadata describing how Ollama should call the backend."}},"required":["function","type"]},"OllamaToolFunctionDto":{"type":"object","properties":{"name":{"type":"string","description":"Function name exposed to the model","example":"get_product_snapshot","minLength":1,"pattern":"\\S"},"description":{"type":"string","description":"Short human-readable description","example":"Return catalog metadata for a product"},"parameters":{"$ref":"#/components/schemas/OllamaToolParametersDto","description":"JSON schema describing the function arguments"}},"required":["name","parameters"]},"OllamaToolParametersDto":{"type":"object","properties":{"type":{"type":"string","description":"JSON schema type. Usually 'object'.","example":"object","minLength":1,"pattern":"\\S"},"properties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/OllamaToolSchemaPropertyDto"},"description":"JSON schema properties describing the arguments.","minProperties":1},"required":{"type":["array","null"],"description":"List of required properties for this schema.","items":{"type":"string"}},"oneOf":{"type":["array","null"],"description":"Optional oneOf blocks to express alternative required sets.","items":{"$ref":"#/components/schemas/OllamaToolParametersRequirementDto"}}},"required":["properties","type"]},"OllamaToolParametersRequirementDto":{"type":"object","properties":{"required":{"type":"array","description":"Required keys under this oneOf branch.","items":{"type":"string"},"minItems":1}},"required":["required"]},"OllamaToolSchemaPropertyDto":{"type":"object","properties":{"type":{"type":"string","description":"Property type","example":"string"},"description":{"type":"string","description":"Human friendly explanation","example":"Numeric id of the product"},"enum":{"type":["array","null"],"description":"Enum values, when applicable","items":{"type":"string"}}}},"ToolCallDto":{"type":"object","properties":{"id":{"type":["string","null"]},"function":{"$ref":"#/components/schemas/ToolCallFunctionDto"}},"required":["function"]},"ToolCallFunctionDto":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"\\S"},"arguments":{"type":"object","additionalProperties":{}}},"required":["name"]},"ChatResponseDto":{"type":"object","properties":{"model":{"type":["string","null"]},"message":{"type":["object","null"],"anyOf":[{"$ref":"#/components/schemas/ChatMessageDto"},{"type":"null"}],"description":"Message chunk; may be null when an upstream event contains no message"},"done":{"type":"boolean"},"created_at":{"type":["string","null"]}}},"EmailDto":{"type":"object","properties":{"to":{"type":"string","format":"email","description":"Email recipient","example":"user@example.com","minLength":1},"subject":{"type":"string","description":"Email subject","example":"Important message","minLength":1,"pattern":"\\S"},"message":{"type":"string","description":"Email content","example":"Please read this message carefully","minLength":1,"pattern":"\\S"},"template":{"type":["string","null"],"description":"Optional template identifier used by downstream consumers; may be null in local outbox payloads","enum":["GENERIC","PASSWORD_RESET_REQUESTED","PASSWORD_RESET_CONFIRMED","BACK_IN_STOCK","ORDER_SHIPPED","ORDER_DELIVERED","RETURN_UPDATED","PAYMENT_RECEIVED","PAYMENT_FAILED","SHIPMENT_OUT_FOR_DELIVERY","SHIPMENT_DELIVERY_FAILED","LOYALTY_POINTS_EARNED","GIFT_CARD_ISSUED",null]},"properties":{"type":"object","additionalProperties":{"type":"string"},"description":"Template properties that help the consumer render the message"}},"required":["message","subject","to"]},"ImportReportDto":{"type":"object","description":"Result of a product CSV import. Nothing is persisted when errors is non-empty or dryRun is true.","properties":{"dryRun":{"type":"boolean","description":"Whether this was a dry run","example":false},"applied":{"type":"boolean","description":"Whether changes were persisted","example":true},"totalRows":{"type":"integer","format":"int32","description":"Number of non-empty data rows","example":3},"created":{"type":"integer","format":"int32","description":"Rows that create a product","example":1},"updated":{"type":"integer","format":"int32","description":"Rows that change an existing product","example":1},"unchanged":{"type":"integer","format":"int32","description":"Rows identical to the existing product","example":1},"errors":{"type":"array","description":"Validation errors; empty when the file is valid","items":{"$ref":"#/components/schemas/ImportRowErrorDto"}}}},"ImportRowErrorDto":{"type":"object","description":"Validation problem in one CSV row","properties":{"row":{"type":"integer","format":"int32","description":"1-based line number in the file; the header is line 1","example":4},"field":{"type":"string","description":"Column name, or 'file' for structural problems","example":"price"},"message":{"type":"string","description":"Problem description","example":"Price must be greater than 0"}}},"InventoryAdjustmentDto":{"type":"object","properties":{"delta":{"type":"integer","format":"int32","description":"Nonzero change in stock; positive adds and negative subtracts","not":{"type":"integer","format":"int32","enum":[0]}},"reason":{"type":"string","maxLength":500,"minLength":1,"pattern":"\\S"},"requestId":{"type":"string","format":"uuid"},"deltaNonZero":{"type":"boolean","description":"Computed validation result; supply a nonzero delta","readOnly":true}},"required":["delta","reason","requestId"]},"InventoryMovementDto":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"productId":{"type":"integer","format":"int64"},"orderId":{"type":["integer","null"],"format":"int64"},"type":{"type":"string","enum":["INITIAL_STOCK","ADMIN_ADJUSTMENT","ORDER_DEDUCTED","ORDER_RESTORED","PURCHASE_RECEIVED","RETURN_RESTOCKED"]},"delta":{"type":"integer","format":"int32"},"quantityAfter":{"type":"integer","format":"int32"},"actor":{"type":"string"},"reason":{"type":"string"},"requestId":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"local-date-time","description":"Server local date and time without an offset; timezone is deployment-dependent, not an absolute instant"}}},"GiftCardCreateDto":{"type":"object","description":"Gift card to issue. The code is generated by the server.","properties":{"amount":{"type":"number","description":"Initial balance","example":50.0,"maximum":1000.00,"minimum":1.00,"multipleOf":0.01},"expiresAt":{"type":["string","null"],"format":"local-date-time","description":"Server-local end of validity; must be in the future. Null means the card never expires"},"recipientUsername":{"type":["string","null"],"description":"Existing user who receives a GIFT_CARD_ISSUED email with the code","example":"client","maxLength":255,"minLength":0},"note":{"type":["string","null"],"description":"Internal note, visible to administrators only","example":"Apology for a late delivery","maxLength":255,"minLength":0}},"required":["amount"]},"GiftCardDto":{"type":"object","description":"Gift card as seen by administrators","properties":{"code":{"type":"string","description":"Generated code","example":"GC-7KQ2-M9XD-4HPA"},"initialAmount":{"type":"number","description":"Amount the card was issued with","example":50.0},"balance":{"type":"number","description":"Remaining balance","example":25.0},"status":{"type":"string","description":"Effective status","enum":["ACTIVE","REDEEMED","EXPIRED","DISABLED"],"example":"ACTIVE"},"expiresAt":{"type":["string","null"],"format":"local-date-time","description":"Server-local end of validity"},"recipientUsername":{"type":["string","null"],"description":"User who was emailed the code","example":"client"},"note":{"type":["string","null"],"description":"Internal note","example":"Apology for a late delivery"},"createdBy":{"type":"string","description":"Administrator who issued the card","example":"admin"},"createdAt":{"type":"string","format":"local-date-time","description":"Creation timestamp"},"updatedAt":{"type":"string","format":"local-date-time","description":"Last update timestamp"},"transactions":{"type":"array","description":"Ledger, oldest first; only in single-card responses","items":{"$ref":"#/components/schemas/GiftCardTransactionDto"}}}},"GiftCardTransactionDto":{"type":"object","description":"Gift card ledger entry","properties":{"type":{"type":"string","description":"Kind of change","enum":["ISSUED","REDEEMED","RESTORED","DISABLED"],"example":"REDEEMED"},"amount":{"type":"number","description":"Signed balance change: positive for ISSUED and RESTORED, negative for REDEEMED, zero for DISABLED","example":-25.0},"balanceAfter":{"type":"number","description":"Balance after the change","example":25.0},"orderId":{"type":["integer","null"],"format":"int64","description":"Order that redeemed or got money back","example":42},"actor":{"type":["string","null"],"description":"Administrator or customer who caused the change","example":"admin"},"createdAt":{"type":"string","format":"local-date-time","description":"When the change happened"}}},"PageDtoWebhookDeliveryDto":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryDto"}},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"}}},"WebhookEventTypeDto":{"type":"object","description":"An event type a webhook can subscribe to","properties":{"name":{"type":"string","description":"Wire name used in events[] and X-Webhook-Event","example":"order.created"},"description":{"type":"string","description":"When it is sent","example":"An order was placed"}}},"WebhookInboxRequestDto":{"type":"object","description":"A webhook request received by an inbox","properties":{"id":{"type":"integer","format":"int64","description":"Request id","example":7},"receivedAt":{"type":"string","format":"date-time","description":"Receive time (UTC)","example":"2026-11-10T20:40:33Z"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Request headers","example":{"X-Webhook-Event":"webhook.ping","X-Webhook-Signature":"t=1794346833,v1=5f2b..."}},"body":{"type":"string","description":"Raw request body (at most 16 KB)","example":{"id":"...","type":"webhook.ping"}}}},"EmailEventDto":{"type":"object","properties":{"type":{"type":"string","description":"Email template or event type","enum":["GENERIC","PASSWORD_RESET_REQUESTED","PASSWORD_RESET_CONFIRMED","BACK_IN_STOCK","ORDER_SHIPPED","ORDER_DELIVERED","RETURN_UPDATED","PAYMENT_RECEIVED","PAYMENT_FAILED","SHIPMENT_OUT_FOR_DELIVERY","SHIPMENT_DELIVERY_FAILED","LOYALTY_POINTS_EARNED","GIFT_CARD_ISSUED"]},"status":{"type":"string","description":"Delivery status recorded by the application for the Mailhog-backed test sink","enum":["QUEUED","SENT_TO_SMTP_SINK","FAILED"]},"recipientMasked":{"type":"string","description":"Masked recipient email address","example":"j***@example.com"},"createdAt":{"type":"string","format":"date-time","description":"When the email event was first recorded"},"updatedAt":{"type":"string","format":"date-time","description":"When the email event status was last updated"},"failureReason":{"type":["string","null"],"description":"Failure detail when the test mail sink handoff did not succeed"}}},"MfaStatusResponseDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether application-owned TOTP is enabled"},"unusedRecoveryCodes":{"type":"integer","format":"int64","description":"Number of unused one-time recovery codes"}}},"PageDtoTrafficLogEntryDto":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/TrafficLogEntryDto"}},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"}}},"TrafficLogEntryDto":{"type":"object","description":"Persisted HTTP traffic log entry","properties":{"correlationId":{"type":"string","description":"Traffic correlation identifier"},"timestamp":{"type":"string","format":"date-time","description":"Request timestamp"},"clientSessionId":{"type":["string","null"],"description":"Client-provided session identifier"},"method":{"type":"string","description":"HTTP method"},"path":{"type":"string","description":"Request path"},"queryString":{"type":["string","null"],"description":"Request query string"},"status":{"type":"integer","format":"int32","description":"Response status code"},"durationMs":{"type":"integer","format":"int64","description":"Request duration in milliseconds"},"requestHeaders":{"additionalProperties":true,"description":"Request headers as a JSON object"},"requestContentType":{"type":["string","null"],"description":"Request content type"},"requestBody":{"type":["object","array","string","number","boolean","null"],"description":"Sanitized request body: parsed JSON of any type, or a text preview for non-JSON/truncated content"},"requestBodyTruncated":{"type":"boolean","description":"Whether the request body was truncated"},"requestBodyOriginalLength":{"type":"integer","format":"int32","description":"Sanitized request body length before truncation"},"requestBodyStoredLength":{"type":"integer","format":"int32","description":"Stored request body length"},"responseHeaders":{"additionalProperties":true,"description":"Response headers as a JSON object"},"responseContentType":{"type":["string","null"],"description":"Response content type"},"responseBody":{"type":["object","array","string","number","boolean","null"],"description":"Sanitized response body: parsed JSON of any type, or a text preview for non-JSON/truncated content"},"responseBodyTruncated":{"type":"boolean","description":"Whether the response body was truncated"},"responseBodyOriginalLength":{"type":"integer","format":"int32","description":"Sanitized response body length before truncation"},"responseBodyStoredLength":{"type":"integer","format":"int32","description":"Stored response body length"}}},"TrafficInfoDto":{"type":"object","description":"Traffic info web websockets connection","properties":{"webSocketEndpoint":{"type":"string","description":"Websocket endpoint","example":"/api/v1/ws-traffic"},"topic":{"type":"string","description":"Websocket topic","example":"/topic/traffic"},"description":{"type":"string","description":"Websocket description","example":"Connect to the WebSocket endpoint and subscribe to the topic to receive real-time HTTP traffic events"}}},"PageDtoReviewDto":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/ReviewDto"}},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"}}},"ReviewSummaryDto":{"type":"object","description":"Rating summary over approved reviews","properties":{"productId":{"type":"integer","format":"int64","description":"Product ID","example":3},"averageRating":{"type":["number","null"],"description":"Average rating rounded half-up to one decimal; null without reviews","example":4.3},"reviewCount":{"type":"integer","format":"int64","description":"Number of approved reviews","example":12},"distribution":{"type":"object","additionalProperties":{"type":"integer","format":"int64"},"description":"Approved review count for each star rating 1-5"}}},"MyReviewDto":{"type":"object","description":"Whether the caller may review a product, and their existing review","properties":{"canReview":{"type":"boolean","description":"True when the caller may create a review now","example":true},"reason":{"type":["string","null"],"description":"Why the caller cannot create a review","example":"Only customers who received this product can review it"},"review":{"$ref":"#/components/schemas/ReviewDto","description":"The caller's review, if any"}}},"CategoryFacetDto":{"type":"object","description":"Number of matching products in one category","properties":{"value":{"type":"string","description":"Category as stored on the products","example":"Electronics"},"count":{"type":"integer","format":"int64","description":"Matching products in this category","example":7}}},"PriceRangeFacetDto":{"type":"object","description":"Lowest and highest price of the products the facets cover; both null when none match","properties":{"min":{"type":["number","null"],"example":9.99},"max":{"type":["number","null"],"example":1299.0}}},"ProductSearchFacetsDto":{"type":"object","description":"Facets over every filter except category, so a client can offer the other categories","properties":{"categories":{"type":"array","description":"Categories with their product counts, largest first, then by value","items":{"$ref":"#/components/schemas/CategoryFacetDto"}},"priceRange":{"$ref":"#/components/schemas/PriceRangeFacetDto"},"inStockCount":{"type":"integer","format":"int64","description":"Products with stock above zero","example":18}}},"ProductSearchItemDto":{"type":"object","description":"Product search hit: the product fields plus its approved-review rating","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"description":{"type":"string"},"price":{"type":"number"},"stockQuantity":{"type":"integer","format":"int32"},"category":{"type":"string"},"imageUrl":{"type":["string","null"]},"createdAt":{"type":"string","format":"local-date-time","description":"Server local date and time without an offset. The server timezone is deployment-dependent; this value does not identify an absolute instant.","example":"2026-09-10T10:30:02.809462"},"updatedAt":{"type":"string","format":"local-date-time","description":"Server local date and time without an offset. The server timezone is deployment-dependent; this value does not identify an absolute instant.","example":"2026-09-10T10:30:02.809462"},"averageRating":{"type":["number","null"],"description":"Average of approved review ratings rounded half-up to one decimal; null without approved reviews","example":4.3},"reviewCount":{"type":"integer","format":"int64","description":"Number of approved reviews","example":12}}},"ProductSearchResultDto":{"type":"object","description":"One page of product search hits with facets","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/ProductSearchItemDto"}},"pageNumber":{"type":"integer","format":"int32","description":"Zero-based page index","example":0},"pageSize":{"type":"integer","format":"int32","description":"Requested page size","example":20},"totalElements":{"type":"integer","format":"int64","description":"Products matching every filter","example":42},"totalPages":{"type":"integer","format":"int32","description":"Number of pages of pageSize","example":3},"facets":{"$ref":"#/components/schemas/ProductSearchFacetsDto"}}},"PageDtoOrderDto":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/OrderDto"}},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"}}},"LoyaltyAccountDto":{"type":"object","description":"Loyalty account of the signed-in user. 1 point is earned per full 1.00 of a paid order; 100 points redeem 1.00.","properties":{"balance":{"type":"integer","format":"int64","description":"Points available to redeem","example":1250},"lifetimeEarned":{"type":"integer","format":"int64","description":"Points earned over the account's lifetime","example":1800},"tier":{"type":"string","description":"Tier from lifetime points: BRONZE, SILVER from 1000, GOLD from 5000","enum":["BRONZE","SILVER","GOLD"],"example":"SILVER"},"valueOfBalance":{"type":"number","description":"What the balance is worth at checkout (100 points = 1.00)","example":12.5}}},"LoyaltyTransactionDto":{"type":"object","description":"Loyalty ledger entry","properties":{"id":{"type":"integer","format":"int64","description":"Entry ID","example":7},"type":{"type":"string","description":"Kind of change","enum":["EARNED","REDEEMED","RESTORED","REVOKED"],"example":"EARNED"},"points":{"type":"integer","format":"int64","description":"Signed change: positive for EARNED and RESTORED, negative for REDEEMED and REVOKED","example":120},"balanceAfter":{"type":"integer","format":"int64","description":"Balance after the change","example":1250},"orderId":{"type":["integer","null"],"format":"int64","description":"Order that caused the change","example":42},"createdAt":{"type":"string","format":"local-date-time","description":"When the change happened"}}},"PageDtoLoyaltyTransactionDto":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/LoyaltyTransactionDto"}},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"}}},"StoredEmail":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"destination":{"type":"string"},"payload":{"$ref":"#/components/schemas/EmailDto"}}},"GiftCardBalanceDto":{"type":"object","description":"Public view of a gift card: balance, status and expiry only","properties":{"code":{"type":"string","description":"Gift card code","example":"GC-7KQ2-M9XD-4HPA"},"balance":{"type":"number","description":"Remaining balance","example":25.0},"status":{"type":"string","description":"Effective status","enum":["ACTIVE","REDEEMED","EXPIRED","DISABLED"],"example":"ACTIVE"},"expiresAt":{"type":["string","null"],"format":"local-date-time","description":"Server-local end of validity"}}},"CurrencyConversionDto":{"type":"object","description":"Amount converted between two currencies through their USD rates","properties":{"amount":{"type":"number","description":"Amount in the source currency","example":100.0},"from":{"type":"string","description":"Source currency code","example":"USD"},"to":{"type":"string","description":"Target currency code","example":"EUR"},"converted":{"type":"number","description":"Converted amount, rounded half-up to 2 decimals from the exact rate","example":92.59},"rate":{"type":"number","description":"Units of the target currency per unit of the source currency, rounded half-up to 6 decimals","example":0.925926}}},"TaxPreviewDto":{"type":"object","description":"VAT contained in the cart total (after any coupon) for a shipping country","properties":{"country":{"type":"string","description":"Resolved ISO 3166-1 alpha-2 country code","example":"PL"},"rate":{"type":"number","description":"VAT rate in percent","example":23.0},"taxAmount":{"type":"number","description":"VAT contained in the total","example":18.7},"netAmount":{"type":"number","description":"Total without VAT","example":81.29},"totalAmount":{"type":"number","description":"VAT-inclusive cart total after any coupon discount","example":99.99}}},"PageDtoWebhookSubscriptionDto":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSubscriptionDto"}},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"}}},"UserIdentityIssueDto":{"type":"object","description":"An account that predates the username and email rules and should be cleaned up","properties":{"id":{"type":"integer","format":"int32","description":"User id","example":42},"username":{"type":"string","description":"Username as stored","example":"Client"},"email":{"type":"string","description":"Email as stored","example":"Alice@Example.com"},"issues":{"type":"array","description":"Rules the account breaks","items":{"type":"string","description":"Why an existing account does not meet the current username and email rules","enum":["USERNAME_FORMAT","USERNAME_CASE_DUPLICATE","USERNAME_IS_ANOTHER_USERS_EMAIL","EMAIL_INVALID","EMAIL_NOT_CANONICAL","EMAIL_CASE_DUPLICATE"]}}},"required":["email","id","issues","username"]},"InventoryItemDto":{"type":"object","properties":{"productId":{"type":"integer","format":"int64"},"name":{"type":"string"},"category":{"type":"string"},"availableQuantity":{"type":"integer","format":"int32"},"stockStatus":{"type":"string","enum":["IN_STOCK","LOW_STOCK","OUT_OF_STOCK"]},"lastChangedAt":{"type":"string","format":"local-date-time","description":"Server local date and time without an offset; timezone is deployment-dependent, not an absolute instant"}}},"PageDtoInventoryItemDto":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/InventoryItemDto"}},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"}}},"PageDtoInventoryMovementDto":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/InventoryMovementDto"}},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"}}},"PageDtoGiftCardDto":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardDto"}},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"}}},"PageDtoCouponDto":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/CouponDto"}},"pageNumber":{"type":"integer","format":"int32"},"pageSize":{"type":"integer","format":"int32"},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"}}}},"headers":{"X-Request-Id":{"description":"Correlation id of the request: the caller's valid X-Request-Id (1-128 characters of A-Z a-z 0-9 . _ -) or a generated UUID. Send it again with a W3C traceparent header to continue a trace; logs, domain events and webhook deliveries caused by the request carry the same id.","schema":{"type":"string","example":"3f2c1a9e-7d4b-4c55-9a0e-2b6f8d1c4e77","maxLength":128,"pattern":"^[A-Za-z0-9._-]{1,128}$"}}},"securitySchemes":{"bearerAuth":{"type":"http","name":"bearerAuth","scheme":"bearer","bearerFormat":"JWT"}}}}