{"openapi":"3.1.0","info":{"title":"NUMU API","version":"0.1.0","description":"The NUMU merchant API, as a third party can use it.\n\n**Authentication.** Mint a personal access token in the merchant hub\n(`POST /api/v1/stores/{store_id}/access-tokens`) and send it as\n`Authorization: Bearer numu_pat_...`. The secret is shown once. A token is\npinned to one store and carries scopes; anything outside them answers 403.\n\n**Scopes.** `{domain}:read` or `{domain}:write`, where domain is one of:\n`catalog`, `media`, `orders`, `customers`, `analytics`, `marketing`, `themes`, `risk`, `settings`. Each operation below lists the\nscope it needs as `x-numu-scope`.\n\n**Limits.** 300 requests/minute per token. Responses are JSON, and errors use\nstandard HTTP status codes.\n\nEndpoints not listed here (admin, staff, billing, internal) are not callable\nwith a token, by design."},"servers":[{"url":"https://numueg.app"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Catalog","description":"Products, variants, inventory, categories, bundles and gift cards."},{"name":"Orders & fulfillment","description":"Orders, shipments, waybills, returns, refunds and abandoned checkouts."},{"name":"Customers","description":"Customer records and their addresses."},{"name":"Marketing","description":"Coupons, promotions, campaigns, WhatsApp and the inbox."},{"name":"Analytics","description":"Store metrics, reports and dashboard figures."},{"name":"Online store","description":"Themes, pages, menus and the editor."},{"name":"Settings & money","description":"Store settings, locations, shipping, payments and invoices."},{"name":"Identity","description":"Who a token belongs to. Reachable with any valid token."}],"paths":{"/api/v1/auth/me":{"get":{"tags":["Identity"],"summary":"Get current user","description":"Get current authenticated user's profile + tenant lifecycle state.","operationId":"get_current_user","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_UserResponse_"}}}}},"x-numu-scope":"any","security":[{"bearerAuth":[]}]}},"/api/v1/auth/api-key/me":{"get":{"tags":["Identity"],"summary":"Identify the calling personal access token","description":"Return the calling PAT's store binding + scopes (PAT auth only).","operationId":"get_api_key_info","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ApiKeyInfoResponse_"}}}}},"x-numu-scope":"any","security":[{"bearerAuth":[]}]}},"/api/v1/oauth/token":{"post":{"tags":["OAuth"],"summary":"Token","description":"The app's server exchanges a code for a ``numu_app_`` token.","operationId":"token_api_v1_oauth_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_TokenResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"client_credentials"}},"/api/v1/oauth/revoke":{"post":{"tags":["OAuth"],"summary":"Revoke","description":"The app revokes one of its tokens. Answers 200 for an unknown token\n(RFC 7009), so the endpoint cannot probe for valid tokens.","operationId":"revoke_api_v1_oauth_revoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"client_credentials"}},"/api/v1/stores/{store_id}/products/":{"post":{"tags":["Catalog"],"summary":"Create new product","description":"Create a new product for the store.","operationId":"create_product","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ProductResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Catalog"],"summary":"List products","description":"List products for a store with optional filtering, search, and sorting.","operationId":"list_products","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Category Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"sku","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by SKU (partial match)","title":"Sku"},"description":"Filter by SKU (partial match)"},{"name":"price_min","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Minimum price in cents","title":"Price Min"},"description":"Minimum price in cents"},{"name":"price_max","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Maximum price in cents","title":"Price Max"},"description":"Maximum price in cents"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sort field: name, price, created_at, updated_at, quantity","title":"Sort By"},"description":"Sort field: name, price, created_at, updated_at, quantity"},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string","description":"Sort direction: asc or desc","default":"asc","title":"Sort Order"},"description":"Sort direction: asc or desc"},{"name":"has_cost","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"true → only products with a cost price set; false → only products missing one (profit-readiness filter)","title":"Has Cost"},"description":"true → only products with a cost price set; false → only products missing one (profit-readiness filter)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaginatedListResponse_ProductResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/products/{product_id}":{"get":{"tags":["Catalog"],"summary":"Get product by ID","description":"Get product details by ID.","operationId":"get_product","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product ID","title":"Product Id"},"description":"Product ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ProductResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Catalog"],"summary":"Update product","description":"Update product details.","operationId":"update_product","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product ID","title":"Product Id"},"description":"Product ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__v1__schemas__tenant__product__UpdateProductRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ProductResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Catalog"],"summary":"Delete product","description":"Delete a product.","operationId":"delete_product","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product ID","title":"Product Id"},"description":"Product ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/products/{product_id}/images":{"post":{"tags":["Catalog"],"summary":"Upload product image","description":"Upload an image for a product.\n\nAccepts JPEG, PNG, WebP, and GIF images.\nMaximum file size: 5 MB.\n\nImages are automatically:\n- Validated and stripped of EXIF metadata\n- Converted to WebP format with 85% quality\n- Resized to 3 variants: thumbnail (150px), medium (600px), large (1200px)\n- Uploaded to Cloudflare R2 storage","operationId":"upload_product_image","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product ID","title":"Product Id"},"description":"Product ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_product_image"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_UploadedImageResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Catalog"],"summary":"Delete product image","description":"Delete a product image.\n\nRemoves the image from storage and from the product's image list.","operationId":"delete_product_image","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product ID","title":"Product Id"},"description":"Product ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteImageRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/products/{product_id}/images/alt":{"patch":{"tags":["Catalog"],"summary":"Set product image alt text","description":"Describe one product image.\n\nAlt is stored in the ``media_urls`` sidecar keyed by image URL, so it\nsurvives the wholesale ``attributes`` replace an update performs and does\nnot change the shape of the ``images`` column.","operationId":"set_product_image_alt","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product ID","title":"Product Id"},"description":"Product ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetImageAltRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/products/template":{"get":{"tags":["Catalog"],"summary":"Download CSV import template","description":"Download an empty CSV template with the correct column headers.","operationId":"download_csv_template","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/products/import":{"post":{"tags":["Catalog"],"summary":"Import products from CSV","description":"Import products from a CSV file.\n\n- Creates new products for rows without a matching SKU in the store.\n- Updates existing products when a matching SKU is found.\n- Returns row-level errors without aborting the entire import.\n- Maximum file size: 5 MB.","operationId":"import_products","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_products"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ImportResultResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/products/export":{"get":{"tags":["Catalog"],"summary":"Export products as CSV","description":"Export all store products as a downloadable CSV file.","operationId":"export_products","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/products/{product_id}/variants":{"get":{"tags":["Catalog"],"summary":"List variants for a product","description":"List all variants for the given product, ordered by position.","operationId":"list_product_variants","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product ID","title":"Product Id"},"description":"Product ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VariantResponse"},"title":"Response List Product Variants"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Catalog"],"summary":"Create a variant","description":"Create a new variant under the given product. Duplicate SKU per\nstore is rejected with a bilingual 409 (checked up-front; the DB's\nuq_variants_store_sku stays as the backstop).","operationId":"create_product_variant","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product ID","title":"Product Id"},"description":"Product ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVariantRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/products/{product_id}/variants/{variant_id}":{"patch":{"tags":["Catalog"],"summary":"Update a variant","description":"Partial update — only fields explicitly present in the body\nare written. Use null to clear nullable fields (sku, barcode,\ncost_price, etc.).","operationId":"update_product_variant","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product ID","title":"Product Id"},"description":"Product ID"},{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Variant ID","title":"Variant Id"},"description":"Variant ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVariantRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Catalog"],"summary":"Delete a variant","description":"Hard delete. Cart/order line items reference variant_id via FK\n— Postgres won't let us delete a variant that's still referenced\nby an active cart line; that surfaces as a 500 today. If we hit\nthat in practice we'll need to either soft-delete (add deleted_at)\nor null-out the cart references first.","operationId":"delete_product_variant","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Product ID","title":"Product Id"},"description":"Product ID"},{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Variant ID","title":"Variant Id"},"description":"Variant ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/payment-proofs":{"get":{"tags":["Orders & fulfillment"],"summary":"List payment proofs for an order","operationId":"merchant_list_payment_proofs","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_PaymentProofResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/payment-proofs/{proof_id}/image":{"get":{"tags":["Settings & money"],"summary":"Stream a payment proof image (merchant-authenticated)","description":"Return the proof image bytes inline.\n\nThis avoids handing the browser a presigned URL whose host the\nbrowser may not be able to reach (MinIO behind a path-rewriting\nproxy) and whose signature can't survive URI rewriting. The\nmerchant is already authenticated via httpOnly cookie; we\nre-validate the proof belongs to this store and stream the bytes.\n\nA short private cache lets the merchant scroll back to a proof\nthey just viewed without a fresh fetch, while keeping the bytes\nout of any shared cache.","operationId":"merchant_stream_payment_proof_image","parameters":[{"name":"proof_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proof Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/payment-proofs/{proof_id}/approve":{"post":{"tags":["Settings & money"],"summary":"Approve a customer-submitted proof","operationId":"merchant_approve_payment_proof","parameters":[{"name":"proof_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proof Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaymentProofResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/payment-proofs/{proof_id}/reject":{"post":{"tags":["Settings & money"],"summary":"Reject a customer-submitted proof","operationId":"merchant_reject_payment_proof","parameters":[{"name":"proof_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proof Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaymentProofResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/payment-proofs/{proof_id}/similar":{"get":{"tags":["Settings & money"],"summary":"Find perceptually similar prior proofs in this store","description":"Surface prior proofs whose pHash is within Hamming distance ≤ 8.\n\nLooser than the dedup gate (≤ 5) — at review time the merchant\nbenefits from seeing \"even loosely similar\" submissions, not just\nnear-exact ones. Populates the \"Possibly related submissions\"\npanel above Approve/Reject so the merchant can spot e.g. the\nsame screenshot resubmitted across two orders.\n\nEmpty result when the proof has no perceptual_hash (predates\nPhase A) or when nothing similar exists in the per-store\n90-day window the repository scans.","operationId":"merchant_list_similar_payment_proofs","parameters":[{"name":"proof_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proof Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_SimilarProof__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/pending-instapay-review":{"get":{"tags":["Orders & fulfillment"],"summary":"List manual-payment orders awaiting merchant review","description":"List manual-rail orders whose latest proof is awaiting merchant review.\n\nCovers InstaPay and Vodafone Cash. Path keeps its historical name so\nthe hub's existing call site is untouched.\n\nPowers the merchant hub's \"Pending verification\" filter chip. We\nself-join payment_proofs to find only the *latest* proof per order\nand filter on its status, so an old rejected proof followed by an\napproved one doesn't get surfaced here. Read-only; doesn't modify\nany state.","operationId":"merchant_list_pending_instapay_orders","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PendingVerificationPage_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/payments":{"post":{"tags":["Orders & fulfillment"],"summary":"Record an out-of-band payment against an order","description":"Attach a receipt and the amount paid; the balance follows.\n\nThe amount is the merchant's, not the image's — nothing reads the\nscreenshot. When the running total reaches the order's collectible\ntotal, the order is marked paid through the same helper the\n\"Mark as paid\" button uses.","operationId":"merchant_record_order_payment","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_merchant_record_order_payment"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RecordedPaymentResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/payments/{proof_id}/void":{"post":{"tags":["Settings & money"],"summary":"Void a payment the merchant recorded by hand","description":"Undo a mistyped amount. The balance goes back up by that amount.\n\nRefused on a paid order: un-marking the payment is a separate,\ndeliberate action with its own commission and invoice reversal, so the\nmerchant does that first and then voids. That one rule keeps this\nendpoint free of any cascade logic.","operationId":"merchant_void_recorded_payment","parameters":[{"name":"proof_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proof Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidPaymentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RecordedPaymentResult_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/":{"post":{"tags":["Orders & fulfillment"],"summary":"Create new order","description":"Create a new order for the store.","operationId":"create_order","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Orders & fulfillment"],"summary":"List orders","description":"List orders for a store with optional filtering and pagination.\n\nFor the specific case of \"orders with an InstaPay proof awaiting\nmerchant review\", use the dedicated endpoint\n``GET /stores/{store_id}/orders/pending-instapay-review`` instead\nof a query param on this route. It runs a self-join on\n``payment_proofs`` so the server returns only rows where the\n*latest* proof is ``awaiting_review`` — a condition this list\nendpoint's repository layer can't express today.","operationId":"list_orders","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"payment_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by payment status","title":"Payment Status"},"description":"Filter by payment status"},{"name":"fulfillment_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by fulfillment status","title":"Fulfillment Status"},"description":"Filter by fulfillment status"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter orders from this date (ISO 8601)","title":"Date From"},"description":"Filter orders from this date (ISO 8601)"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter orders until this date (ISO 8601)","title":"Date To"},"description":"Filter orders until this date (ISO 8601)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by customer ID","title":"Customer Id"},"description":"Filter by customer ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaginatedListResponse_OrderListItemResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/drafts":{"post":{"tags":["Orders & fulfillment"],"summary":"Create a draft order","description":"Save an order as a draft (status=DRAFT).\n\nDrafts:\n- Skip the COD trust network check (no shipping commitment yet).\n- Suppress the OrderCreatedEvent — no notifications, no shipment\n  auto-create, no webhooks, no analytics rollup.\n- Use the same record shape as a real order so 'Convert' is a single\n  status transition rather than a re-write.","operationId":"create_draft_order","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/convert":{"post":{"tags":["Orders & fulfillment"],"summary":"Convert draft order to a real order","description":"Convert a draft order to a live PENDING order.\n\nDrives the usual `UpdateOrderStatusUseCase` so all the existing\nside-effects (webhooks, notifications, OrderActivity rows) fire as if\nthe order had just been created.","operationId":"convert_draft_order","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Draft order ID","title":"Order Id"},"description":"Draft order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/autopilot-exceptions":{"get":{"tags":["Orders & fulfillment"],"summary":"List COD Autopilot exception orders","description":"Orders flagged by COD Autopilot: customer tapped Refused, exhausted\ndelivery checks, or a late tap contradicting a recorded closure.\nResolve them with existing order actions (mark returned / delivered /\ncancel) or dismiss the flag.","operationId":"list_autopilot_exceptions","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AutopilotExceptionListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/autopilot-exceptions/{order_id}/resolve":{"post":{"tags":["Orders & fulfillment"],"summary":"Resolve (dismiss) a COD Autopilot exception","description":"Dismiss the exception flag without changing the order. Status\nchanges themselves go through the existing order endpoints, which\nclear pending Autopilot automation as a side effect (FR-018).","operationId":"resolve_autopilot_exception","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveAutopilotExceptionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ResolveAutopilotExceptionResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/counts":{"get":{"tags":["Orders & fulfillment"],"summary":"Per-status order counts (list tab badges)","description":"Counts per order status, honouring the same date/search filters as\nthe list endpoint so each tab badge matches the rows that tab shows.\nDrafts are excluded, as they are from the main list.","operationId":"get_order_status_counts","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date To"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_ref}":{"get":{"tags":["Orders & fulfillment"],"summary":"Get order by ID or order number","description":"Get order details by ID or by the store's order number.\n\nThe merchant hub puts the order NUMBER in its URLs — it's what merchants\nread and share — so a pasted or refreshed `/orders/ORD-767567` resolves\nhere. A UUID works exactly as before. Numbers are unique per store, and\nthe lookup is store-scoped, so one store can never reach another's order.","operationId":"get_order","parameters":[{"name":"order_ref","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Order ID (UUID) or order number (e.g. ORD-767567)","title":"Order Ref"},"description":"Order ID (UUID) or order number (e.g. ORD-767567)"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}":{"patch":{"tags":["Orders & fulfillment"],"summary":"Update order","description":"Update order details.","operationId":"update_order","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOrderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Orders & fulfillment"],"summary":"Cancel order","description":"Cancel an order.","operationId":"cancel_order","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"reason","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cancellation reason","title":"Reason"},"description":"Cancellation reason"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/status":{"patch":{"tags":["Orders & fulfillment"],"summary":"Update order status","description":"Update order status.","operationId":"update_order_status","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__v1__schemas__tenant__order__UpdateOrderStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/mark-paid":{"post":{"tags":["Orders & fulfillment"],"summary":"Mark order as paid","description":"Manually mark an order's payment as paid (e.g. COD collected).","operationId":"mark_order_paid","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/unmark-paid":{"post":{"tags":["Orders & fulfillment"],"summary":"Undo a manual mark-paid (payment back to pending)","description":"Reverse a payment that was recorded by hand (COD / manual rails).\n\nRefused when real money moved: a successful gateway transaction or a\ncompleted refund exists — those need a Refund, not an un-mark.\nReverses the wallet commission, cancels the ETA invoice and logs the\naction (see ``OrderPaymentReversedEvent`` handlers).","operationId":"unmark_order_paid","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnmarkPaidRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/partial-acceptance":{"post":{"tags":["Orders & fulfillment"],"summary":"Customer kept part of the order at the door","description":"Record a partial acceptance (e.g. 2 of 3 pieces kept, 1 returned).\n\nThe order ends DELIVERED (a delivery signal, not an RTO — the customer\ndid pay for what they kept); ``collected_total`` becomes the cash to\nexpect; the returned pieces are restocked line by line; COD orders\nauto-mark paid for the collected amount, prepaid orders report the\nrefund due.","operationId":"record_partial_acceptance","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PartialAcceptanceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PartialAcceptanceResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/timeline":{"get":{"tags":["Orders & fulfillment"],"summary":"Get order timeline","description":"Get the timeline of status changes for an order.","operationId":"get_order_timeline","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderTimelineResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/activities":{"get":{"tags":["Orders & fulfillment"],"summary":"List order activity stream (staff comments + system events)","description":"Return the persisted activity stream for an order, newest first.","operationId":"list_order_activities","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderActivitiesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/comments":{"post":{"tags":["Orders & fulfillment"],"summary":"Add a staff comment to an order","description":"Post a staff comment on an order. Visible only to merchant staff.","operationId":"create_order_comment","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderCommentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderActivityResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/bulk-status":{"post":{"tags":["Orders & fulfillment"],"summary":"Bulk update order statuses","description":"Update the status of multiple orders at once.","operationId":"bulk_update_order_status","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateOrderStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_BulkUpdateOrderStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/resend-email":{"post":{"tags":["Orders & fulfillment"],"summary":"Resend order status email","description":"Resend the status email for an order's current status.","operationId":"resend_order_email","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/email-preview":{"get":{"tags":["Orders & fulfillment"],"summary":"Preview order status email","description":"Preview the email HTML that would be sent for an order status.\n\nUseful for merchants to review notification content before sending.","operationId":"preview_order_email","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Preview a specific status (defaults to current)","title":"Status"},"description":"Preview a specific status (defaults to current)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/whatsapp":{"get":{"tags":["Orders & fulfillment"],"summary":"WhatsApp sends for an order","description":"Delivery status of every WhatsApp message sent for this order.\n\nA `failed` row carries Meta's numeric `error_code` — the only place a\nmerchant can see why a confirmation never arrived.","operationId":"get_order_whatsapp_sends","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/resend-whatsapp":{"post":{"tags":["Orders & fulfillment"],"summary":"Resend the WhatsApp order confirmation","description":"Replay the order-created WhatsApp send for this order.\n\nRoutes exactly like the original: COD orders on stores with\n\"confirm order in WhatsApp\" get the tap-to-confirm request, everything\nelse gets the passive confirmation. Every guard still applies (opt-out,\ntemplate approval, merchant toggle) — only the send-once idempotency\ncheck is bypassed, which is the whole point of a resend.","operationId":"resend_order_whatsapp","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/abandoned-checkouts/summary":{"get":{"tags":["Orders & fulfillment"],"summary":"Abandoned vs recovered carts — counts, value, payback","operationId":"get_abandoned_checkout_summary","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AbandonedCheckoutSummaryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/abandoned-checkouts/":{"get":{"tags":["Orders & fulfillment"],"summary":"List abandoned checkouts for a store","description":"Return the paginated abandoned-checkout feed for the store.","operationId":"list_abandoned_checkouts","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"include_recovered","in":"query","required":false,"schema":{"type":"boolean","description":"Include carts that have already been recovered.","default":false,"title":"Include Recovered"},"description":"Include carts that have already been recovered."},{"name":"only_recovered","in":"query","required":false,"schema":{"type":"boolean","description":"Show only recovered carts (e.g. for analytics views).","default":false,"title":"Only Recovered"},"description":"Show only recovered carts (e.g. for analytics views)."},{"name":"abandonment_threshold_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":2880,"minimum":5,"description":"Carts inactive for this many minutes are eligible to be flipped to `abandoned`. Lazily applied on each list-page load.","default":60,"title":"Abandonment Threshold Minutes"},"description":"Carts inactive for this many minutes are eligible to be flipped to `abandoned`. Lazily applied on each list-page load."},{"name":"has_contact","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"True = only carts with email or phone (recoverable, Shopify semantics). False = only carts with no contact info. Omit for everything.","title":"Has Contact"},"description":"True = only carts with email or phone (recoverable, Shopify semantics). False = only carts with no contact info. Omit for everything."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AbandonedCheckoutListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/abandoned-checkouts/{checkout_id}":{"get":{"tags":["Orders & fulfillment"],"summary":"Get an abandoned checkout","operationId":"get_abandoned_checkout","parameters":[{"name":"checkout_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Abandoned-checkout ID","title":"Checkout Id"},"description":"Abandoned-checkout ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AbandonedCheckoutResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/abandoned-checkouts/{checkout_id}/send-recovery-email":{"post":{"tags":["Orders & fulfillment"],"summary":"Send a recovery email to the abandoned-checkout's customer","description":"Send a recovery email and stamp `recovery_email_sent_at`.\n\nThe email subject + body are rendered from a future template; for now\nwe fall back to the existing Resend service with a minimal HTML body.\nIdempotent — calling twice simply overwrites the timestamp.","operationId":"send_recovery_email","parameters":[{"name":"checkout_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Abandoned-checkout ID","title":"Checkout Id"},"description":"Abandoned-checkout ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SendRecoveryEmailResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/abandoned-checkouts/{checkout_id}/mark-recovered":{"post":{"tags":["Orders & fulfillment"],"summary":"Manually mark an abandoned checkout as recovered","description":"Manually flag a cart as recovered. Used for off-channel conversions\n(merchant called the customer and they ordered via WhatsApp instead).","operationId":"mark_abandoned_checkout_recovered","parameters":[{"name":"checkout_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Abandoned-checkout ID","title":"Checkout Id"},"description":"Abandoned-checkout ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Order ID the checkout was recovered into, if known.","title":"Order Id"},"description":"Order ID the checkout was recovered into, if known."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AbandonedCheckoutResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/abandoned-checkouts/{checkout_id}/convert":{"post":{"tags":["Orders & fulfillment"],"summary":"Turn an abandoned checkout into a real COD order","description":"Create the order the shopper confirmed off-channel, then link it.\n\n\"Mark recovered\" alone only flips ``recovered_at``: the hub shows the cart\nas Recovered while no order exists, so nothing reaches Orders, shipping or\nanalytics (Vionne, 2026-09-18). This builds a COD order from the cart's own\nlines, address and totals through the normal merchant create-order path\n(same COD trust check and OrderCreatedEvent), then records the order id.\n\nOffers and shipping are re-priced with the storefront checkout's engines:\nthe cart row never stores the automatic offer discount, and its shipping\nis whatever the shopper had on screen (often 0 before a governorate).","operationId":"convert_abandoned_checkout","parameters":[{"name":"checkout_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Abandoned-checkout ID","title":"Checkout Id"},"description":"Abandoned-checkout ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AbandonedCheckoutResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/abandoned-checkouts/{checkout_id}/notify-whatsapp":{"post":{"tags":["Orders & fulfillment"],"summary":"Send a WhatsApp abandoned-cart recovery nudge","description":"Merchant-initiated WhatsApp nudge for one abandoned checkout.\n\nThis is the per-row \"Notify via WhatsApp\" action. Because the merchant\nexplicitly chose to message this customer, it BYPASSES the marketing\nopt-in requirement (and per product decision, opt-out too) — it still\nrespects store credentials and the ``abandoned_cart_v2`` template's\nAPPROVED status so we never ship a malformed send to Meta.","operationId":"notify_abandoned_checkout_whatsapp","parameters":[{"name":"checkout_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Abandoned-checkout ID","title":"Checkout Id"},"description":"Abandoned-checkout ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyWhatsAppResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/import/preview":{"post":{"tags":["Orders & fulfillment"],"summary":"Preview a CSV order import (parses headers + suggests mapping)","description":"Return column list, first sample rows, and a suggested column→field map.","operationId":"preview_order_import","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_preview_order_import"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/import/execute":{"post":{"tags":["Orders & fulfillment"],"summary":"Execute a CSV order import with a confirmed mapping","description":"Run the import. Partial-success: returns per-row errors without rollback.","operationId":"execute_order_import","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_execute_order_import"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/import/target-fields":{"get":{"tags":["Orders & fulfillment"],"summary":"List the target fields the importer understands","operationId":"list_order_import_target_fields","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/dashboard/stats":{"get":{"tags":["Analytics"],"summary":"Get dashboard statistics","description":"Get dashboard statistics for the store.","operationId":"get_dashboard_stats","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_DashboardStatsResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/dashboard/revenue":{"get":{"tags":["Analytics"],"summary":"Get revenue chart data","description":"Get revenue data for chart visualization.","operationId":"get_revenue_chart","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_RevenueDataPointResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/dashboard/top-products":{"get":{"tags":["Analytics"],"summary":"Get top selling products (dashboard)","description":"Get top selling products for the store.","operationId":"get_dashboard_top_products","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"description":"Number of products to return","default":5,"title":"Limit"},"description":"Number of products to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_DashboardTopProductResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/dashboard/streak":{"get":{"tags":["Analytics"],"summary":"Get daily order streak","description":"Get the store's consecutive-days-with-orders streak.","operationId":"get_order_streak","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrderStreakResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/customers/import/preview":{"post":{"tags":["Customers"],"summary":"Preview a CSV customer import (parses headers + suggests mapping)","description":"Return column list, first sample rows, and a suggested column→field map.","operationId":"preview_customer_import","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_preview_customer_import"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/customers/import/execute":{"post":{"tags":["Customers"],"summary":"Execute a CSV customer import with a confirmed mapping","description":"Run the import. Partial-success: returns per-row errors without rollback.","operationId":"execute_customer_import","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_execute_customer_import"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/customers/import/target-fields":{"get":{"tags":["Customers"],"summary":"List the target fields the customer importer understands","operationId":"list_customer_import_target_fields","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/customers/":{"get":{"tags":["Customers"],"summary":"List store customers","description":"List all customers for a store with pagination and search.","operationId":"list_store_customers","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"query","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name or email","title":"Query"},"description":"Search by name or email"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaginatedListResponse_CustomerResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Customers"],"summary":"Create a customer manually","description":"Create a customer on behalf of the merchant (no login credentials).\n\nMirrors Shopify's admin \"Add customer\": the record exists for orders,\nmarketing, and segmentation. If the person later registers on the\nstorefront with the same email, that flow sets their password on a\nseparate row check — this endpoint rejects duplicate emails outright.","operationId":"create_store_customer","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantCreateCustomerRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CustomerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/customers/{customer_id}":{"get":{"tags":["Customers"],"summary":"Get customer by ID","description":"Get a specific customer by ID.","operationId":"get_store_customer","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Customer ID","title":"Customer Id"},"description":"Customer ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CustomerResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/customers/{customer_id}/trust-stats":{"get":{"tags":["Customers"],"summary":"Get customer COD trust network stats","description":"Return cross-merchant trust network stats for this customer.\n\nStats are keyed on the customer's hashed phone number, so they reflect\nbehavior across the entire NUMU merchant network — not just this store.","operationId":"get_customer_trust_stats","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Customer ID","title":"Customer Id"},"description":"Customer ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CustomerTrustStatsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/customers/{customer_id}/analytics":{"delete":{"tags":["Customers"],"summary":"Erase a customer's analytics footprint (DSAR)","description":"Delete every funnel event linked to ``customer_id`` for this store.\n\nCompanion to the existing customer DSAR flows. Only removes events\nwhere ``customer_id`` is set on the funnel row — anonymous events\nkeyed only on ``session_fingerprint`` aren't tied to a person and\nfall under the analytics retention policy instead. Page views are\nalready anonymized at write-time (truncated IP, no customer_id).\n\nIdempotent — re-running on a customer with no events returns 0.","operationId":"erase_customer_analytics","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Customer ID","title":"Customer Id"},"description":"Customer ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AnalyticsEraseResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/customers/{customer_id}/journey":{"get":{"tags":["Customers"],"summary":"Get a customer's full touchpoint journey","description":"Return every UTM-tagged inbound visit this customer made.\n\nSourced from ``customer_touches`` — populated incrementally by the\n/track endpoint for known customers, and backfilled at checkout\nfor anonymous sessions that converted (linking the pre-auth\nhistory into the profile).\n\nOrder: most recent first. The merchant hub renders this as a\nreverse-chrono timeline; ``is_first_touch`` is preserved on each\nrow so the very first touch can be highlighted regardless of\nwhere it falls in the result set.","operationId":"get_customer_journey","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Customer ID","title":"Customer Id"},"description":"Customer ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Maximum touches to return (most recent first)","default":100,"title":"Limit"},"description":"Maximum touches to return (most recent first)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_JourneyResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/customers/{customer_id}/social-profiles":{"get":{"tags":["Customers"],"summary":"Conversations linked to this customer","operationId":"get_customer_social_profiles","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SocialProfilesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/customers/{customer_id}/avatar":{"post":{"tags":["Customers"],"summary":"Adopt a linked conversation's profile picture as the customer photo","operationId":"set_customer_avatar_from_thread","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetAvatarRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SetAvatarResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"customers:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/send-payment-link":{"post":{"tags":["Orders & fulfillment"],"summary":"Send the order's payment link into a linked conversation","operationId":"send_order_payment_link","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendPaymentLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SendPaymentLinkResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/invoices/":{"post":{"tags":["Settings & money"],"summary":"Create new invoice","description":"Create a new invoice for the store.\n\nThe invoice is created in DRAFT status. Line items are automatically\ncalculated with 14% VAT. After review, submit to ETA using the\nsubmit endpoint.","operationId":"create_invoice","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InvoiceResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"List store invoices","description":"List all invoices for the store with optional filtering.","operationId":"list_invoices","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/InvoiceStatus"},{"type":"null"}],"title":"Status"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaginatedListResponse_InvoiceListResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/invoices/{invoice_id}":{"get":{"tags":["Settings & money"],"summary":"Get invoice details","description":"Get detailed invoice information including line items and ETA status.","operationId":"get_invoice","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Invoice ID","title":"Invoice Id"},"description":"Invoice ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InvoiceResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Settings & money"],"summary":"Update draft invoice","description":"Update a draft invoice. Only draft invoices can be modified.","operationId":"update_invoice","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Invoice ID","title":"Invoice Id"},"description":"Invoice ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InvoiceResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Delete draft invoice","description":"Delete a draft invoice. Only draft invoices can be deleted.","operationId":"delete_invoice","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Invoice ID","title":"Invoice Id"},"description":"Invoice ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/invoices/{invoice_id}/submit":{"post":{"tags":["Settings & money"],"summary":"Submit invoice to ETA","description":"Submit invoice to Egyptian Tax Authority (ETA).\n\nThe invoice must be in DRAFT status. After submission:\n- If accepted: status becomes ACCEPTED, ETA UUID is assigned\n- If rejected: status becomes REJECTED with error message","operationId":"submit_invoice_to_eta","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Invoice ID","title":"Invoice Id"},"description":"Invoice ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SubmitInvoiceResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/invoices/{invoice_id}/pdf":{"get":{"tags":["Settings & money"],"summary":"Download invoice PDF","description":"Download invoice as PDF.\n\nGenerates a bilingual Arabic/English PDF using the invoice_ar template.\nThe PDF is cached in Cloudflare R2 for subsequent downloads.\nPass ``?regenerate=true`` to force re-generation after the invoice or\nits underlying order's payment_status changes.","operationId":"download_invoice_pdf","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Invoice ID","title":"Invoice Id"},"description":"Invoice ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"regenerate","in":"query","required":false,"schema":{"type":"boolean","description":"Force PDF regeneration","default":false,"title":"Regenerate"},"description":"Force PDF regeneration"}],"responses":{"200":{"description":"Invoice PDF file","content":{"application/json":{"schema":{}},"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/invoices/by-order/{order_id}":{"get":{"tags":["Settings & money"],"summary":"Get (or create) the invoice for an order","description":"Return the invoice tied to ``order_id`` for the store.\n\nFlow:\n    1. Look up the order; 404 if not found or not in this store.\n    2. Look up an existing invoice via ``get_by_order_id``.\n    3. If missing AND ``create_if_missing``, issue + persist one.\n\nThis used to refuse unpaid orders with a 409. That left every\ncash-on-delivery merchant without an invoice to pack with the parcel —\nthe one moment they need it — because a COD order is by definition\nunpaid until the courier collects.","operationId":"get_invoice_for_order","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"create_if_missing","in":"query","required":false,"schema":{"type":"boolean","description":"When true (default), issues the invoice on the spot if the order has none yet — paid or not.","default":true,"title":"Create If Missing"},"description":"When true (default), issues the invoice on the spot if the order has none yet — paid or not."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InvoiceResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/invoices/by-order/{order_id}/pdf":{"get":{"tags":["Settings & money"],"summary":"Print the invoice for an order, paid or not","description":"Issue (if needed) and render the order's invoice for printing.\n\nOne call for the merchant's \"Print invoice\" button, whatever the order's\npayment state: a cash-on-delivery order prints as due on delivery with\nthe amount the courier collects; a paid one prints as paid. Rendered\nfresh every time — never from the R2 cache — because the payment stamp\nchanges when the order is paid and a stale \"due\" on a paid order is\nexactly the wrong paper to hand a customer.\n\nServed inline so the browser opens its PDF viewer, where printing is one\nclick; the store's own logo, not the platform's, heads the page.","operationId":"print_invoice_for_order","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Invoice PDF, rendered fresh","content":{"application/json":{"schema":{}},"application/pdf":{}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/gift-cards":{"get":{"tags":["Catalog"],"summary":"List gift cards","operationId":"list_gift_cards","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/GiftCardStatus"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_GiftCardResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Catalog"],"summary":"Issue a new gift card","operationId":"issue_gift_card","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueGiftCardRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_IssuedGiftCardResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/gift-cards/{gift_card_id}":{"get":{"tags":["Catalog"],"summary":"Get gift card","operationId":"get_gift_card","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"gift_card_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Gift Card Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_GiftCardResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/gift-cards/{gift_card_id}/transactions":{"get":{"tags":["Catalog"],"summary":"List gift card transactions","operationId":"list_gift_card_transactions","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"gift_card_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Gift Card Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_GiftCardTransactionResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/gift-cards/{gift_card_id}/void":{"post":{"tags":["Catalog"],"summary":"Void a gift card (zero remaining balance)","operationId":"void_gift_card","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"gift_card_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Gift Card Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_GiftCardResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/":{"get":{"tags":["Catalog"],"summary":"Get inventory list","description":"Get inventory list for the store.","operationId":"get_inventory","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"filter","in":"query","required":false,"schema":{"type":"string","description":"Filter: all, low_stock, out_of_stock","default":"all","title":"Filter"},"description":"Filter: all, low_stock, out_of_stock"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_InventoryItemResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/stats":{"get":{"tags":["Catalog"],"summary":"Get inventory statistics","description":"Get inventory statistics for the store.","operationId":"get_inventory_stats","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InventoryStatsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/adjust":{"post":{"tags":["Catalog"],"summary":"Adjust stock level","description":"Adjust stock level for a product.","operationId":"adjust_stock","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockAdjustmentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StockAdjustmentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/bulk-adjust":{"post":{"tags":["Catalog"],"summary":"Bulk adjust stock levels","description":"Bulk adjust stock levels for multiple products.","operationId":"bulk_adjust_stock","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StockAdjustmentRequest"},"title":"Adjustments"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_StockAdjustmentResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/levels":{"get":{"tags":["Catalog"],"summary":"List all inventory levels for a store","operationId":"list_store_inventory_levels","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_InventoryLevelResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/levels/variant/{variant_id}":{"get":{"tags":["Catalog"],"summary":"List inventory levels for a variant","operationId":"list_variant_inventory_levels","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Variant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_InventoryLevelResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/levels/location/{location_id}":{"get":{"tags":["Catalog"],"summary":"List inventory levels at a location","operationId":"list_location_inventory_levels","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_InventoryLevelResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/levels/{variant_id}/{location_id}":{"put":{"tags":["Catalog"],"summary":"Set inventory level at a location","operationId":"set_inventory_level","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Variant Id"}},{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetLevelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InventoryLevelResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/transfers":{"get":{"tags":["Catalog"],"summary":"List inventory transfers","operationId":"list_inventory_transfers","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/TransferStatus"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_TransferResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Catalog"],"summary":"Create a draft transfer","operationId":"create_inventory_transfer","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTransferRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TransferResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/transfers/{transfer_id}":{"get":{"tags":["Catalog"],"summary":"Get transfer","operationId":"get_inventory_transfer","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Transfer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TransferResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/transfers/{transfer_id}/lines":{"put":{"tags":["Catalog"],"summary":"Replace lines (DRAFT only)","operationId":"update_transfer_lines","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Transfer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLinesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TransferResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/inventory/transfers/{transfer_id}/transitions":{"post":{"tags":["Catalog"],"summary":"Move transfer through its state machine","operationId":"transition_inventory_transfer","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Transfer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransitionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TransferResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/locations":{"get":{"tags":["Settings & money"],"summary":"List locations","operationId":"list_locations","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_LocationResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Settings & money"],"summary":"Create location","operationId":"create_location","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationPayload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_LocationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/locations/{location_id}":{"get":{"tags":["Settings & money"],"summary":"Get location","operationId":"get_location","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_LocationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"put":{"tags":["Settings & money"],"summary":"Update location","operationId":"update_location","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_LocationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Delete location","description":"Hard-delete the row. Prefer `PUT { is_active: false }` when\nhistorical orders may still reference this location — the\nstorefront hides inactive locations from pickers but historical\nrows can dereference the FK without nulling out.","operationId":"delete_location","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"location_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Location Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_str__str__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/overview":{"get":{"tags":["Analytics"],"summary":"Get sales overview","description":"Get sales overview for the store.\n\nRollup-backed for completed days, live for today. See\n``_daily_revenue_series`` for why today can never be served from the\nrollup table.","operationId":"get_sales_overview","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SalesOverviewResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/sales-chart":{"get":{"tags":["Analytics"],"summary":"Get sales chart data","description":"Get sales data for chart visualization.\n\nBucket size follows ``window.granularity``: the rollup table is\nday-grained, so ``week``/``month`` group on the fly, and ``hour``\naggregates raw orders directly.","operationId":"get_sales_chart","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"compare","in":"query","required":false,"schema":{"anyOf":[{"enum":["previous_period","previous_year"],"type":"string"},{"type":"null"}],"description":"Attach an aligned comparison series to each point: previous_period = same length ending the day before the window starts; previous_year = same dates one year earlier. Ignored for granularity=hour.","title":"Compare"},"description":"Attach an aligned comparison series to each point: previous_period = same length ending the day before the window starts; previous_year = same dates one year earlier. Ignored for granularity=hour."},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_SalesDataPointResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/top-products":{"get":{"tags":["Analytics"],"summary":"Get top selling products (analytics)","description":"Get top selling products.\n\nMerges ``top_products_json`` across daily rollup rows for COMPLETED\ndays (cheap — at most ``days`` rows × ~20 products each) and adds a\nlive SQL aggregation for today plus any day the nightly task missed.\n\nToday is never read from the rollup: the task writes that row at\n03:30 and it would otherwise stay frozen for the rest of the day.\nBefore this, today had no row at all, so the day's sales contributed\nnothing to the product ranking until the following morning.","operationId":"get_analytics_top_products","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"default":5,"title":"Limit"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_AnalyticsTopProductResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/sales-by-location":{"get":{"tags":["Analytics"],"summary":"Get sales by location","description":"Get sales breakdown by location/governorate.\n\nSQL ``GROUP BY LOWER(TRIM(shipping_address->>'city'))`` so the\ndashboard no longer shows ``Cairo`` and ``cairo`` as two separate\nrows. Falls back to ``state`` when ``city`` is missing.","operationId":"get_sales_by_location","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_SalesByLocationResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/customers":{"get":{"tags":["Analytics"],"summary":"Get customer analytics","description":"Get customer analytics for the store.\n\n\"New vs returning\" comes from a CTE that joins active-in-window\ncustomers against their first-order timestamp across all time, so a\ncustomer whose first order pre-dates the window is \"returning\" even\nif their only window order was today.","operationId":"get_customer_analytics","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CustomerAnalyticsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/conversion":{"get":{"tags":["Analytics"],"summary":"Get conversion statistics","description":"Get conversion statistics for the store.","operationId":"get_conversion_stats","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ConversionStatsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/traffic-sources":{"get":{"tags":["Analytics"],"summary":"Get orders by traffic source","description":"Get order attribution by UTM source.\n\nSQL ``GROUP BY LOWER(TRIM(utm_source))`` so casing collisions are\ncollapsed; missing utm falls into a ``direct`` bucket. No row cap —\nthe database does the aggregation, so big stores don't silently\ntruncate at the old ``limit=5000`` boundary.","operationId":"get_traffic_sources","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_TrafficSourceResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/cod-rejections":{"get":{"tags":["Analytics"],"summary":"Get COD rejection statistics","description":"Get COD rejection rate and breakdown by location.\n\nSourced from the ``orders`` table directly. Earlier this endpoint\nqueried ``shipments``, which is only populated for stores that\nintegrate a courier (Bosta / MyLerz / J&T) — manual-fulfilment\nstores read zeros across the board. ``orders`` is the canonical\nsource: courier webhooks already flip ``orders.status`` on\ndelivered/returned, and manual merchants flip it via the merchant\nUI.","operationId":"get_cod_rejection_stats","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CodRejectionStatsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/health-score":{"get":{"tags":["Analytics"],"summary":"Get merchant health score","description":"Get the merchant health score (cached daily or live calculation).\n\nOn first call (no cache), calculates live and caches the result in Redis\nso subsequent calls are instant. Celery refreshes it daily.\nRecommendations are regenerated per-request so they always match the\nuser's current language.","operationId":"get_health_score","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"live","in":"query","required":false,"schema":{"type":"boolean","description":"Calculate live instead of using cached score","default":false,"title":"Live"},"description":"Calculate live instead of using cached score"},{"name":"lang","in":"query","required":false,"schema":{"type":"string","description":"Language for recommendations: ar or en","default":"ar","title":"Lang"},"description":"Language for recommendations: ar or en"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_HealthScoreResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/orders-breakdown":{"get":{"tags":["Analytics"],"summary":"Get orders breakdown analytics","description":"Get orders breakdown by status, payment method, time distribution.\n\nFive SQL aggregations replace the previous loop-over-5000-orders\npattern. Day-of-week and hour-of-day come from ``EXTRACT(dow ...)``\n/ ``EXTRACT(hour ...)``; fulfillment percentiles use\n``percentile_cont`` so we don't sort a Python list of timedeltas.","operationId":"get_orders_breakdown","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OrdersBreakdownResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/revenue-breakdown":{"get":{"tags":["Analytics"],"summary":"Get revenue breakdown analytics","description":"Get revenue breakdown: gross, discounts, shipping, refunds, net.\n\nTwo SQL aggregates (totals + coupon usage) replace the previous\ntruncated 5000-order Python loop. Every figure — including refunds —\nis measured over the same live instant window, so this screen and\n/overview cannot report different totals for the same range.\n\n``gross_revenue`` is deliberately SUM(subtotal): this endpoint\nDECOMPOSES revenue, listing shipping and tax as their own lines.\n/overview's ``collected_revenue`` uses SUM(total) because it is a\nsingle headline figure that must be comparable with ``total_sales``.","operationId":"get_revenue_breakdown","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RevenueBreakdownResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/customer-segments":{"get":{"tags":["Analytics"],"summary":"Get customer RFM segmentation","description":"Get customer segmentation using RFM analysis, cohort retention, and CLV.\n\nThree SQL aggregations replace the previous 10000-order in-memory\nscan: per-customer aggregates over the window, all-time first-order\nper active customer (drives cohort assignment), and the customer ×\norder-month matrix (drives retention). The Python side then loops\nover a customer-sized set, not an order-sized one.","operationId":"get_customer_segments","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CustomerSegmentsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/inventory-analytics":{"get":{"tags":["Analytics"],"summary":"Get inventory analytics (sell-through, ABC, dead stock)","description":"Inventory health beyond restock suggestions — what to reorder\n(A), what to watch (B), and what to discount or retire (dead C).","operationId":"get_inventory_analytics","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InventoryAnalyticsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/product-performance":{"get":{"tags":["Analytics"],"summary":"Get product performance analytics","description":"Get product-level performance, category breakdown, and inventory health.\n\nThree SQL aggregations replace the previous 5000-order in-memory\nloop: ``top_products`` (line_items unnest + GROUP BY), the optional\n7-day daily trend per top product, and inventory bucket counts.\nCatalog metadata (cost_price, category) is joined via a single\nproduct fetch limited to the active SKUs.","operationId":"get_product_performance","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","description":"Sort by: revenue, quantity, name","default":"revenue","title":"Sort By"},"description":"Sort by: revenue, quantity, name"},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ProductPerformanceResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/search-terms":{"get":{"tags":["Analytics"],"summary":"Get top storefront search terms","description":"Top search terms, volumes, and search→purchase session conversion.","operationId":"get_search_terms","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SearchTermsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/customer-health":{"get":{"tags":["Analytics"],"summary":"Customer health scores + states","description":"0–100 health per customer + lifecycle state (VIP … churned),\ncomputed live over 365d of orders. Recency decays on the STORE's own\nrepurchase rhythm, and the monetary quintile finally participates\n(the legacy RFM segmenter ignored it — D14).","operationId":"get_customer_health","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"State"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CustomerHealthResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/predictions":{"get":{"tags":["Analytics"],"summary":"Statistical predictions (stockouts, bands, repeat, COD)","description":"Predictions v1 — all statistical, all self-hosted (AI-5).\n\nStock depletion windows (EWMA velocity + Poisson band), month-end\nrevenue and today's-orders bands (the forecast service's\nHolt-Winters), empirical repeat-purchase probability, and COD\nrejection risk with Wilson intervals + per-governorate shrinkage.\nEvery block carries a confidence tier; blocks without enough data\nreturn null rather than a confident-looking guess.","operationId":"get_predictions","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PredictionsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/signals":{"get":{"tags":["Analytics"],"summary":"Get active advisor signals","description":"Active advice/opportunities for this store, ranked by expected\nEGP impact. Copy is rendered from the rule templates at read time.","operationId":"get_signals","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"lang","in":"query","required":false,"schema":{"enum":["en","ar"],"type":"string","default":"en","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SignalsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/signals/{signal_id}/dismiss":{"post":{"tags":["Analytics"],"summary":"Dismiss an advisor signal","description":"Hide a signal the merchant doesn't want to act on. It won't\nre-notify while its cooldown holds; a later re-fire creates a fresh\nsignal if the condition persists.","operationId":"dismiss_signal","parameters":[{"name":"signal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Signal Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/signals/refresh":{"post":{"tags":["Analytics"],"summary":"Re-run the advisor rules for this store now","description":"On-demand rule evaluation (the nightly sweep does this\nautomatically). Synchronous — a store's rule pass is ~10 queries.","operationId":"refresh_signals","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/executive":{"get":{"tags":["Analytics"],"summary":"Executive dashboard — what should I do today?","description":"Composed entirely from outputs other layers already produce\n(AI-6): signals ranked by EGP impact, prediction bands, and six\n0–100 health gauges. No new computation — only ranking and\npresentation; every drill-down leads to a classic analytics tab.","operationId":"get_executive_dashboard","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"lang","in":"query","required":false,"schema":{"enum":["en","ar"],"type":"string","default":"en","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ExecutiveResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/benchmarks":{"get":{"tags":["Analytics"],"summary":"Anonymous peer benchmarks (k-anonymity gated)","description":"Your KPIs vs anonymous peer percentiles (AI-7).\n\nReciprocity: you see benchmarks only if your store contributes\n(``settings.benchmarks_opt_in``). Cells are published only when\nthey aggregate ≥10 stores — with fewer, the response says so\nhonestly instead of showing numbers that could deanonymize peers.","operationId":"get_benchmarks","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_BenchmarksResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/report-builder":{"get":{"tags":["Analytics"],"summary":"Custom report: metrics grouped by a chosen dimension","description":"Group revenue / orders / AOV (and units, for products) by any\nsupported dimension — the merchant-facing custom report builder.\nMetric selection happens client-side from the columns returned here,\nso switching metric doesn't re-query.","operationId":"get_report_builder","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"dimension","in":"query","required":false,"schema":{"enum":["day","week","month","payment_method","governorate","channel","coupon","product"],"type":"string","default":"day","title":"Dimension"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ReportBuilderResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/digest/settings":{"get":{"tags":["Analytics"],"summary":"Get weekly-digest preferences","description":"The store's weekly-digest opt-in (defaults off, email channel).","operationId":"get_digest_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_DigestSettings_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]},"put":{"tags":["Analytics"],"summary":"Set weekly-digest preferences","description":"Enable/disable the weekly digest and pick channels.","operationId":"put_digest_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutDigestSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_DigestSettings_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/digest/preview":{"get":{"tags":["Analytics"],"summary":"Preview the weekly analytics digest","description":"The exact recap the merchant would receive by email/WhatsApp — so\nthey can see it before enabling scheduled sends.","operationId":"get_digest_preview","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"lang","in":"query","required":false,"schema":{"enum":["en","ar"],"type":"string","default":"en","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_DigestContent_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/annotations":{"get":{"tags":["Analytics"],"summary":"Get store-event annotations for charts","description":"Store events (product/coupon/campaign/theme) in the window, as\nchart markers — the merchant sees WHAT caused a spike or dip. Dates\nare labeled to match the sales chart's day buckets on the store's\nwall clock.","operationId":"get_annotations","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AnnotationsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/targets":{"get":{"tags":["Analytics"],"summary":"Get metric targets with live pace","description":"Each stored goal + actual-to-date, elapsed pace, and a linear\nrun-rate projection — the Shopify-style target gauge, computed on\nthe store's wall clock so \"this month\" means the merchant's month.","operationId":"get_metric_targets","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MetricTargetsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]},"put":{"tags":["Analytics"],"summary":"Set metric targets","description":"Upsert goals; a target_value of 0 removes that goal.","operationId":"put_metric_targets","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutMetricTargetsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/funnel":{"get":{"tags":["Analytics"],"summary":"Get conversion funnel","description":"Get conversion funnel step counts with drop-off percentages.","operationId":"get_funnel","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_FunnelResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/marketing-attribution":{"get":{"tags":["Analytics"],"summary":"Get marketing attribution analytics","description":"Get marketing channel attribution from order UTM data and page views.\n\nChannel classification (Direct / Paid / Social / Email / Referral /\nOrganic) is encoded as a SQL ``CASE`` over ``utm_source`` /\n``utm_medium`` so we don't iterate orders. Campaigns come from a\nsecond aggregation with normalized (lower/trim) casing.","operationId":"get_marketing_attribution","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MarketingAttributionResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/ltv-by-channel":{"get":{"tags":["Analytics"],"summary":"Get customer LTV by first-touch acquisition channel","description":"LTV by acquisition channel — customer cohorts joined to lifetime orders.\n\nThe ``date_from``/``date_to`` window from the standard date-range\ndependency is applied to ``customers.first_touch_at`` (cohort\nselection), **not** to orders. The point of LTV-by-channel is to\nsee how much revenue each acquisition cohort eventually produces\nover their entire history, so we don't crop the order side.\n\nChannels are read from ``customers.first_touch_attribution`` —\ncustomers without that field (no UTMs on first touch) fall into a\n``\"direct\"`` bucket so they aren't dropped from the rollup.\n\n``group_by`` accepts ``source`` (default), ``medium``, or\n``campaign``. Invalid values 422 at the route layer before any\nDB work runs.","operationId":"get_ltv_by_channel","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"group_by","in":"query","required":false,"schema":{"type":"string","description":"Acquisition dimension to bucket by: source, medium, or campaign. Sourced from customers.first_touch_attribution JSONB.","default":"source","title":"Group By"},"description":"Acquisition dimension to bucket by: source, medium, or campaign. Sourced from customers.first_touch_attribution JSONB."},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_LtvByChannelResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/insights":{"get":{"tags":["Analytics"],"summary":"Get AI-powered store insights","description":"Get AI-powered insights with anomaly detection and LLM narratives.\n\nUses cached insights from store.settings when available (refreshed daily\nby Celery task). Falls back to live calculation if no cache exists.\nSame rollup-vs-orders fallback as ``/forecast``: brand-new stores\nhave no rollup rows yet, so we aggregate from ``orders`` directly.","operationId":"get_insights","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","description":"Language: ar or en","default":"ar","title":"Lang"},"description":"Language: ar or en"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InsightsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/forecast":{"get":{"tags":["Analytics"],"summary":"Get sales forecast","description":"Get sales revenue forecast using Holt-Winters exponential smoothing.\n\nPreferred source: the nightly ``analytics_daily_rollup`` table.\nFallback: aggregate ``orders`` directly when the rollup hasn't\ncaught up to this store yet (brand-new merchants, or the daily\ncron hasn't fired since signup). The forecast service consumes a\nsequence of rollup-shaped objects, so we just wrap the raw daily\nrows in a tiny adapter when we use the fallback path.","operationId":"get_forecast","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"horizon","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":7,"description":"Forecast horizon in days","default":30,"title":"Horizon"},"description":"Forecast horizon in days"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ForecastResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/sessions":{"get":{"tags":["Analytics"],"summary":"Get customer sessions list","description":"Get session list with duration, pages, funnel reached, and device type.\n\nSpan is clamped by the shared date-range dependency. The legacy\ncap was 30 days; with ``granularity=hour`` (the default in the\npicker for ≤48 h spans) the cap is 7 days.","operationId":"get_sessions","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"has_order","in":"query","required":false,"schema":{"type":"boolean","description":"Filter to sessions with orders","default":false,"title":"Has Order"},"description":"Filter to sessions with orders"},{"name":"min_pages","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Minimum page count","default":1,"title":"Min Pages"},"description":"Minimum page count"},{"name":"device","in":"query","required":false,"schema":{"type":"string","description":"Filter by device: mobile, desktop, tablet","default":"","title":"Device"},"description":"Filter by device: mobile, desktop, tablet"},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SessionsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/sessions/{fingerprint}":{"get":{"tags":["Analytics"],"summary":"Get session detail timeline","description":"Get full timeline for a specific session.","operationId":"get_session_detail","parameters":[{"name":"fingerprint","in":"path","required":true,"schema":{"type":"string","title":"Fingerprint"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SessionDetailResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/multi-touch":{"get":{"tags":["Analytics"],"summary":"Multi-touch attribution per channel + campaign","description":"Distribute order revenue across acquisition touches per the selected model.\n\nReads ``orders`` × ``customer_touches`` in the date window and\nruns one of five attribution models:\n\n* ``last_touch`` — 100% to the last touch (legacy)\n* ``first_touch`` — 100% to the first touch\n* ``linear`` — equal split across all touches\n* ``time_decay`` — exponential decay, 7-day half-life (Google\n  Ads default)\n* ``position_based`` — Shopify-style U-shape, 40/20/40\n\nReturns per-channel credit AND per-campaign credit (only for\ntouches that resolved to a known marketing_campaigns row). 400\nwhen the window contains too many orders to attribute on demand\n(5000-order cap — narrow the date range and retry).","operationId":"get_multi_touch_attribution","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"model","in":"query","required":false,"schema":{"type":"string","description":"Attribution model: last_touch, first_touch, linear, time_decay, position_based","default":"linear","title":"Model"},"description":"Attribution model: last_touch, first_touch, linear, time_decay, position_based"},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3650,"minimum":1},{"type":"null"}],"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present.","title":"Days"},"description":"Legacy: number of days back from now. Use start_date+end_date instead. Ignored when those are present."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window start (ISO datetime). Required together with end_date.","title":"Start Date"},"description":"Window start (ISO datetime). Required together with end_date."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Window end (ISO datetime). Required together with start_date.","title":"End Date"},"description":"Window end (ISO datetime). Required together with start_date."},{"name":"granularity","in":"query","required":false,"schema":{"enum":["hour","day","week","month","quarter","year"],"type":"string","description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter.","default":"day","title":"Granularity"},"description":"Bucket size for timeseries endpoints. Non-timeseries endpoints ignore this parameter."},{"name":"tz","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo.","title":"Tz"},"description":"IANA timezone for calendar-day bucketing (e.g. Africa/Cairo). Send the store's timezone. Invalid or missing values fall back to Africa/Cairo."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MultiTouchAttributionResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/realtime/snapshot":{"get":{"tags":["Analytics"],"summary":"Get real-time analytics snapshot","description":"One-time fetch of real-time analytics counters.","operationId":"get_realtime_snapshot","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RealtimeSnapshotResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/realtime/geo":{"get":{"tags":["Analytics"],"summary":"Today's orders by location (governorate)","description":"Where TODAY's orders are coming from, by governorate — the geo\nlayer for Live View. Sourced from order shipping addresses (real,\nmerchant-entered) on the store's wall-clock day, not IP geolocation\n(page-view IPs are /24-anonymized and carry no location).","operationId":"get_realtime_geo","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RealtimeGeoResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/analytics/realtime/stream":{"get":{"tags":["Analytics"],"summary":"SSE stream for real-time analytics","description":"Server-Sent Events stream pushing analytics every 5 seconds.","operationId":"get_realtime_stream","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"analytics:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/categories/":{"post":{"tags":["Catalog"],"summary":"Create new category","description":"Create a new category for the store.","operationId":"create_category","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCategoryRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CategoryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Catalog"],"summary":"List categories","description":"List categories for a store.","operationId":"list_categories","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_CategoryResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/categories/{category_id}":{"get":{"tags":["Catalog"],"summary":"Get category by ID","description":"Get category details by ID.","operationId":"get_category","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Category ID","title":"Category Id"},"description":"Category ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CategoryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Catalog"],"summary":"Update category","description":"Update category details.","operationId":"update_category","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Category ID","title":"Category Id"},"description":"Category ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCategoryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CategoryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Catalog"],"summary":"Delete category","description":"Delete a category.","operationId":"delete_category","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Category ID","title":"Category Id"},"description":"Category ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/categories/{category_id}/image":{"post":{"tags":["Catalog"],"summary":"Upload category image","description":"Upload an image for a category.\n\nAccepts JPEG, PNG, WebP images. Maximum file size: 5 MB.\nThe image is processed and the category's image_url is updated.","operationId":"upload_category_image","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Category ID","title":"Category Id"},"description":"Category ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_category_image"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CategoryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/coupons/":{"post":{"tags":["Marketing"],"summary":"Create new coupon","description":"Create a new coupon for the store.","operationId":"create_coupon","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCouponRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CouponResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Marketing"],"summary":"List coupons","description":"List coupons for a store.","operationId":"list_coupons","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaginatedListResponse_CouponResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/coupons/{coupon_id}":{"get":{"tags":["Marketing"],"summary":"Get coupon by ID","description":"Get coupon details by ID.","operationId":"get_coupon","parameters":[{"name":"coupon_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Coupon ID","title":"Coupon Id"},"description":"Coupon ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CouponResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Marketing"],"summary":"Update coupon","description":"Update coupon details.","operationId":"update_coupon","parameters":[{"name":"coupon_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Coupon ID","title":"Coupon Id"},"description":"Coupon ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCouponRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CouponResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Marketing"],"summary":"Delete coupon","description":"Delete a coupon.","operationId":"delete_coupon","parameters":[{"name":"coupon_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Coupon ID","title":"Coupon Id"},"description":"Coupon ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/menus/":{"get":{"tags":["Online store"],"summary":"List menus","description":"List all navigation menus for the store.","operationId":"list_menus","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_MenuResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Online store"],"summary":"Create menu","description":"Create a new navigation menu for the store.","operationId":"create_menu","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMenuRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MenuResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/menus/{handle}":{"get":{"tags":["Online store"],"summary":"Get menu by handle","description":"Get a single menu by handle.","operationId":"get_menu","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string","description":"Menu handle","title":"Handle"},"description":"Menu handle"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MenuResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]},"put":{"tags":["Online store"],"summary":"Update (or create) a menu by handle","description":"Update a menu. If no menu with this handle exists, it is created.","operationId":"update_menu","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string","description":"Menu handle","title":"Handle"},"description":"Menu handle"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMenuRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MenuResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Online store"],"summary":"Delete menu","description":"Delete a menu by handle.","operationId":"delete_menu","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string","description":"Menu handle","title":"Handle"},"description":"Menu handle"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/pages/":{"get":{"tags":["Online store"],"summary":"List pages","description":"List all content pages for the store.","operationId":"list_pages","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"include_unpublished","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Unpublished"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_PageResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Online store"],"summary":"Create page","description":"Create a new content page for the store.","operationId":"create_page","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePageRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PageResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/pages/{handle}":{"get":{"tags":["Online store"],"summary":"Get page by handle","description":"Get a single page by handle.","operationId":"get_page","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string","description":"Page handle","title":"Handle"},"description":"Page handle"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PageResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]},"put":{"tags":["Online store"],"summary":"Update (or create) a page by handle","description":"Update a page. If no page with this handle exists, it is created.","operationId":"update_page","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string","description":"Page handle","title":"Handle"},"description":"Page handle"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PageResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Online store"],"summary":"Delete page","description":"Delete a page by handle.","operationId":"delete_page","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string","description":"Page handle","title":"Handle"},"description":"Page handle"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/promotions/reorder":{"patch":{"tags":["Marketing"],"summary":"Bulk-update promotion priorities (drag-to-reorder)","description":"Apply new priority values for a batch of promotions in one go.\n\nThe drag-to-reorder UI sends the full reordered list each time the\nuser drops a row; the server doesn't try to compute deltas, just\noverwrites the priority on every id provided. Promotions belonging\nto a different store are silently skipped — defensive against a\nforged payload from a malicious tab.","operationId":"reorder_promotions","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderPromotionsRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/promotions/preview-token":{"post":{"tags":["Marketing"],"summary":"Issue a short-lived preview token for the builder iframe","description":"Mint a 5-minute preview token scoped to this store.\n\nNo request body — the auth + path-scoping (`verify_store_ownership`)\nalready establish that the caller is the owner of `store_id`. Token\nis signed with the same JWT key as access / refresh tokens, so it\ninherits the platform's existing rotation story.","operationId":"issue_promotion_preview_token","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_PreviewTokenResponse___1"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/promotions":{"get":{"tags":["Marketing"],"summary":"List promotions for a store","operationId":"list_promotions","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/PromotionStatus"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"surface","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/PromotionSurface"},{"type":"null"}],"description":"Filter by surface","title":"Surface"},"description":"Filter by surface"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PromotionListOutput_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Marketing"],"summary":"Create a new promotion","operationId":"create_promotion","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePromotionInput"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PromotionOutput_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/promotions/{promotion_id}":{"get":{"tags":["Marketing"],"summary":"Get a single promotion by id","operationId":"get_promotion","parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Promotion Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PromotionOutput_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Marketing"],"summary":"Update a promotion (optimistic lock via `version`)","operationId":"update_promotion","parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Promotion Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePromotionInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PromotionOutput_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Marketing"],"summary":"Soft-delete (archive) a promotion","operationId":"delete_promotion","parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Promotion Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/promotions/{promotion_id}/duplicate":{"post":{"tags":["Marketing"],"summary":"Duplicate a promotion as a new draft","operationId":"duplicate_promotion","parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Promotion Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PromotionOutput_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/promotions/{promotion_id}/activate":{"post":{"tags":["Marketing"],"summary":"Move a promotion to ACTIVE","operationId":"activate_promotion","parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Promotion Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PromotionOutput_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/promotions/{promotion_id}/pause":{"post":{"tags":["Marketing"],"summary":"Move a promotion to PAUSED","operationId":"pause_promotion","parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Promotion Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PromotionOutput_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/promotions/{promotion_id}/archive":{"post":{"tags":["Marketing"],"summary":"Move a promotion to ARCHIVED","operationId":"archive_promotion","parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Promotion Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PromotionOutput_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/promotions/{promotion_id}/analytics":{"get":{"tags":["Marketing"],"summary":"Aggregate analytics for one promotion within a date range","operationId":"get_promotion_analytics","parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Promotion Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"range_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Range Start"}},{"name":"range_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Range End"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PromotionAnalyticsOutput_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/":{"get":{"tags":["Settings & money"],"summary":"Get all store settings","description":"Get all settings for the store.","operationId":"get_all_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StoreSettingsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/payment":{"get":{"tags":["Settings & money"],"summary":"Get payment settings","description":"Get payment settings for the store.","operationId":"get_payment_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaymentSettingsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Settings & money"],"summary":"Update payment settings","description":"Update payment settings for the store.","operationId":"update_payment_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaymentSettingsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/cod-trust":{"get":{"tags":["Settings & money"],"summary":"Get COD trust network protection settings","description":"Get the COD trust network protection settings for the store.","operationId":"get_cod_trust_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CodTrustResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Settings & money"],"summary":"Update COD trust network protection settings","description":"Update the COD trust network protection settings for the store.","operationId":"update_cod_trust_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCodTrustRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CodTrustResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/cod-autopilot":{"get":{"tags":["Settings & money"],"summary":"Get COD Autopilot settings","description":"COD Autopilot (WhatsApp ship digest + delivery checks + assumed-\ndelivered fallback) settings for the store. Defaults apply when the\nsection is absent.","operationId":"get_cod_autopilot_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CodAutopilotResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Settings & money"],"summary":"Update COD Autopilot settings","description":"Update COD Autopilot settings. Disabling takes effect immediately\n(FR-023) — the beat sweeps re-read settings every run and skip\ndisabled stores; no order state is altered.","operationId":"update_cod_autopilot_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCodAutopilotRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CodAutopilotResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/storefront-password":{"get":{"tags":["Settings & money"],"summary":"Get storefront password-protection status","description":"Return whether the storefront is password-protected (never the hash).\n\nAlso reports the platform billing lock, which gates the storefront while\nthe tenant sits in ``read_only``. That one is state rather than a switch:\nonly a top-up or a paid subscription clears it.","operationId":"get_storefront_password","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StorefrontPasswordResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"put":{"tags":["Settings & money"],"summary":"Enable/disable storefront password & set the password","description":"Set the storefront's pre-launch password gate.\n\nHashes the password (SHA-256) server-side and stores it under\n``settings.password_protected``. Disabling keeps the hash so the merchant\ncan re-enable without retyping. Refuses to enable without a password.","operationId":"update_storefront_password","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStorefrontPasswordRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StorefrontPasswordResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/product-labels":{"get":{"tags":["Settings & money"],"summary":"Get the store's custom product-label definitions","description":"Custom labels only — built-in presets (new/sale/bestseller/limited)\nlive in the hub, not in settings.","operationId":"get_product_labels","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ProductLabelsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"put":{"tags":["Settings & money"],"summary":"Replace the store's custom product-label definitions","description":"Full-replace of ``settings.product_labels`` (the hub always sends the\ncomplete list). Read-merge-write on the settings dict — only this key is\ntouched, everything else (payment config!) is preserved. Duplicate keys\nare collapsed keeping the last occurrence.\n\nDefinition changes fan out to labeled products so the denormalized\n``attributes.label`` text never goes stale:\n  - renamed definition → text rewritten on every product carrying the key\n  - deleted definition → label stripped (products fall back to no label)\nBuilt-in presets never live in settings, so they can't be renamed or\ndeleted here.","operationId":"update_product_labels","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductLabelsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ProductLabelsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/payment/paymob/credentials":{"put":{"tags":["Settings & money"],"summary":"Save Paymob credentials","description":"Save or update Paymob payment gateway credentials for the store.\n\nCredentials are encrypted at rest using AES-128 (Fernet).","operationId":"save_paymob_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavePaymobCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaymobCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"Get Paymob credentials status","description":"Get masked Paymob credential status for the store.","operationId":"get_paymob_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaymobCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Remove Paymob credentials","description":"Remove Paymob credentials and disable Paymob payments.","operationId":"delete_paymob_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaymobCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/payment/kashier/credentials":{"put":{"tags":["Settings & money"],"summary":"Save Kashier credentials","description":"Save or update Kashier payment gateway credentials for the store.","operationId":"save_kashier_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveKashierCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_KashierCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"Get Kashier credentials status","description":"Get masked Kashier credential status for the store.","operationId":"get_kashier_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_KashierCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Remove Kashier credentials","description":"Remove Kashier credentials and disable Kashier payments.","operationId":"delete_kashier_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_KashierCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/payment/fawaterak/credentials":{"put":{"tags":["Settings & money"],"summary":"Save Fawaterak credentials","description":"Save or update Fawaterak payment gateway credentials for the store.","operationId":"save_fawaterak_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveFawaterakCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_FawaterakCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"Get Fawaterak credentials status","description":"Get masked Fawaterak credential status for the store.","operationId":"get_fawaterak_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_FawaterakCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Remove Fawaterak credentials","description":"Remove Fawaterak credentials and disable Fawaterak payments.","operationId":"delete_fawaterak_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_FawaterakCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/payment/moyasar/credentials":{"put":{"tags":["Settings & money"],"summary":"Save Moyasar credentials","description":"Save or update Moyasar payment gateway credentials for the store.","operationId":"save_moyasar_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveMoyasarCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MoyasarCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"Get Moyasar credentials status","description":"Get masked Moyasar credential status for the store.","operationId":"get_moyasar_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MoyasarCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Remove Moyasar credentials","description":"Remove Moyasar credentials and disable Moyasar payments.","operationId":"delete_moyasar_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MoyasarCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/shipping":{"get":{"tags":["Settings & money"],"summary":"Get shipping settings","description":"Get shipping settings for the store.","operationId":"get_shipping_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShippingSettingsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Settings & money"],"summary":"Update shipping settings","description":"Update shipping settings for the store.","operationId":"update_shipping_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateShippingSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShippingSettingsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/shipping/zones":{"post":{"tags":["Settings & money"],"summary":"Add shipping zone","description":"Add a new shipping zone.","operationId":"add_shipping_zone","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShippingZoneRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShippingZone_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/shipping/zones/{zone_id}":{"patch":{"tags":["Settings & money"],"summary":"Update shipping zone","description":"Update a shipping zone.","operationId":"update_shipping_zone","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","title":"Zone Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateShippingZoneRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShippingZone_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Delete shipping zone","description":"Delete a shipping zone.","operationId":"delete_shipping_zone","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","title":"Zone Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/shipping/bosta/credentials":{"put":{"tags":["Settings & money"],"summary":"Save Bosta credentials","description":"Save or update Bosta shipping credentials for the store.\n\nCredentials are encrypted at rest using AES-128 (Fernet).\n\n**Superseded by** ``PUT /shipments/carriers/{slug}/credentials``, which\nworks for every registered carrier. Kept because existing clients call\nthis path, but it now runs the same shared logic so both routes behave\nidentically.\n\nTwo behaviours changed here, deliberately:\n\n* It used to set ``is_configured: True`` **without ever calling\n  Bosta**, so a typo'd API key showed a green \"Live\" badge. It now\n  verifies and persists the result.\n* It used to set ``enabled: True``, silently switching the carrier on\n  as a side effect of saving a key. Enabling is an explicit action in\n  shipping settings; a carrier whose credentials Bosta rejects must\n  not be enabled at all.","operationId":"save_bosta_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveBostaCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_BostaCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"Get Bosta credentials status","description":"Get masked Bosta credential status for the store.","operationId":"get_bosta_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_BostaCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Remove Bosta credentials","description":"Remove Bosta credentials and disable Bosta shipping.\n\nSuperseded by ``DELETE /shipments/carriers/{slug}/credentials``; shares\nits implementation so the two paths cannot drift.","operationId":"delete_bosta_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_BostaCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/invoice":{"get":{"tags":["Settings & money"],"summary":"Get invoice/tax settings","description":"Get invoice and tax settings (ETA seller info).","operationId":"get_invoice_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InvoiceSettingsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Settings & money"],"summary":"Update invoice/tax settings","description":"Update invoice and tax settings (ETA seller info).","operationId":"update_invoice_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InvoiceSettingsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/whatsapp":{"get":{"tags":["Settings & money"],"summary":"Get WhatsApp settings","description":"Get WhatsApp settings for the store.","operationId":"get_whatsapp_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_WhatsAppSettingsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Settings & money"],"summary":"Update WhatsApp settings","description":"Update WhatsApp settings for the store.","operationId":"update_whatsapp_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWhatsAppSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_WhatsAppSettingsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/customization":{"get":{"tags":["Settings & money"],"summary":"Get storefront customization settings","description":"Get storefront customization settings for the store.","operationId":"get_customization","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CustomizationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Settings & money"],"summary":"Update storefront customization (save draft)","description":"Save storefront customization as draft. Does not publish to live store.","operationId":"update_customization","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomizationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CustomizationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/customization/publish":{"post":{"tags":["Settings & money"],"summary":"Publish storefront customization to live store","description":"Publish the current customization draft to the live storefront.","operationId":"publish_customization","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CustomizationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/customization/reset":{"post":{"tags":["Settings & money"],"summary":"Reset storefront customization to theme defaults","description":"Restore the merchant's customization to the fresh-store defaults.\n\nWipes every customization section (identity, theme, header, hero,\nproducts, footer, navigation, labels, layout) plus the v2 section-\nengine templates. The currently selected ``theme.base_theme`` is\npreserved so the reset feels like \"reset this theme\" rather than\n\"reset the store\".\n\nPublished customization (``store.theme_settings``) is untouched —\nmerchants must click Publish to push the reset live.","operationId":"reset_customization","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CustomizationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/customization/assets":{"post":{"tags":["Settings & money"],"summary":"Upload a customization asset (logo, favicon, hero image)","description":"Upload an asset for storefront customization.\n\nAccepts logo, favicon, hero_image, section_image, profile_picture,\nor social_image (Open Graph) uploads, or `generic_file` for theme\nfile_upload settings (PDFs, fonts, video, audio).\nReturns the URL of the uploaded asset.","operationId":"upload_customization_asset","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_customization_asset"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"List customization assets","description":"List all uploaded theme/customization assets for this store.\n\nEach asset is enriched with the merchant-authored ``alt`` text and\nfriendly ``name`` from ``store.settings.asset_meta`` (keyed by object\nkey) so the Media manager can render and edit them.","operationId":"list_customization_assets","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Settings & money"],"summary":"Update an asset's alt text / display name","description":"Persist library metadata (alt text + friendly name) for one asset.\n\nStored in ``store.settings.asset_meta[key]``. The object key / URL is\nnever changed — only the metadata. Existing image settings that read\nthe URL keep working; the alt here seeds the default alt for the\nimage picker.","operationId":"update_customization_asset_meta","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAssetMetaRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Delete a customization asset","description":"Delete an uploaded asset from storage and drop its metadata.\n\nThe merchant is responsible for ensuring the asset isn't still\nreferenced by a published section (Shopify behaves the same way — it\nwarns but allows). We only verify the key is this store's.","operationId":"delete_customization_asset","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAssetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/checkout-fields":{"get":{"tags":["Settings & money"],"summary":"Get checkout fields config","description":"Return the merchant's checkout-fields config (with defaults merged).","operationId":"get_checkout_fields","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"put":{"tags":["Settings & money"],"summary":"Update checkout fields config","description":"Persist the merchant's checkout-fields config under ``settings.checkout_fields``.","operationId":"update_checkout_fields","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutFieldsConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/payment/instapay/credentials":{"put":{"tags":["Settings & money"],"summary":"Save InstaPay credentials","description":"Save InstaPay configuration for the store.\n\nThe IPA + fallback phone are encrypted at rest; the auto-approval\nthresholds sit alongside the encrypted blob in plaintext because\nthey're policy knobs the merchant sees in the dashboard, not\nsecrets.\n\n`request.ipa` and `request.fallback_phone` are both optional — when\nomitted, the existing encrypted blob is decrypted and those values\ncarry forward. This lets the merchant edit display name, thresholds,\nor toggle enabled without re-typing the IPA (the UI shows it masked;\nit can never unmask to its true form). First-time saves must include\n`ipa`, and it is now format-checked (`name@bank`) — a typo'd IPA\nsilently misroutes a customer's money.","operationId":"save_instapay_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveInstapayCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InstapayCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"Get InstaPay credentials status","description":"Get masked InstaPay config status for the store.","operationId":"get_instapay_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InstapayCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Remove InstaPay credentials","description":"Remove the stored InstaPay IPA and disable InstaPay at checkout.","operationId":"delete_instapay_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InstapayCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/payment/vodafone-cash/credentials":{"put":{"tags":["Settings & money"],"summary":"Save Vodafone Cash credentials","description":"Save Vodafone Cash configuration for the store.\n\nThe wallet number is normalized to ``010XXXXXXXX`` (accepting\n``+20``/``0020`` prefixes, separators, and Arabic-Indic digits — all\nof which merchants paste out of the Ana Vodafone app) and rejected\nif it isn't a Vodafone Egypt mobile number. Storing it normalized\nmatters downstream: the OCR match rule compares against this exact\nstring, and the checkout panel offers it as a tap-to-copy value that\nhas to be dialable as-is.\n\n`wallet_number` is optional on updates and carries forward from the\nencrypted blob; first-time saves must include it.","operationId":"save_vodafone_cash_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveVodafoneCashCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VodafoneCashCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"Get Vodafone Cash credentials status","description":"Get masked Vodafone Cash config status for the store.","operationId":"get_vodafone_cash_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VodafoneCashCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Remove Vodafone Cash credentials","description":"Remove the stored wallet number and disable Vodafone Cash.","operationId":"delete_vodafone_cash_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VodafoneCashCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/payment/we-pay/credentials":{"put":{"tags":["Settings & money"],"summary":"Save WE Pay credentials","description":"Save WE Pay configuration for the store.\n\nThe wallet number is normalized and checked against this network's own\nprefix, so an Orange number cannot be published under WE Pay.","operationId":"save_we_pay_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveVodafoneCashCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VodafoneCashCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"Get WE Pay credentials status","description":"Get the masked WE Pay config status for the store.","operationId":"get_we_pay_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VodafoneCashCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Remove WE Pay credentials","description":"Remove the stored wallet number and disable WE Pay.","operationId":"delete_we_pay_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VodafoneCashCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/payment/orange-cash/credentials":{"put":{"tags":["Settings & money"],"summary":"Save Orange Cash credentials","description":"Save Orange Cash configuration for the store.\n\nThe wallet number is normalized and checked against this network's own\nprefix, so an Orange number cannot be published under WE Pay.","operationId":"save_orange_cash_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveVodafoneCashCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VodafoneCashCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"Get Orange Cash credentials status","description":"Get the masked Orange Cash config status for the store.","operationId":"get_orange_cash_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VodafoneCashCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Remove Orange Cash credentials","description":"Remove the stored wallet number and disable Orange Cash.","operationId":"delete_orange_cash_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VodafoneCashCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/payment/instapay/qr-image":{"post":{"tags":["Settings & money"],"summary":"Upload merchant-generated InstaPay QR image","description":"Persist a merchant-supplied InstaPay QR image.\n\nStored in the same `STORES` bucket the customization assets use\nand the resulting URL is written into ``store.settings.payment.\ninstapay.qr_image_url`` so checkout + the InstaPay payment page\ncan render it.","operationId":"upload_instapay_qr_image","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_instapay_qr_image"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InstapayCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Remove the uploaded InstaPay QR image","description":"Clear the uploaded QR image URL.\n\nDoesn't try to delete the underlying object — storage cleanup is\nbest-effort and orphaned QRs cost ~10 KB. The field is what the\nstorefront looks at; nulling it suppresses the QR section.","operationId":"delete_instapay_qr_image","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_InstapayCredentialsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking":{"get":{"tags":["Settings & money"],"summary":"Get all tracking settings","description":"Return the per-channel tracking config — Meta + TikTok.","operationId":"get_tracking_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TrackingSettingsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/validation-contract":{"get":{"tags":["Settings & money"],"summary":"Get the tracking-credential validation contract","description":"Serve the pixel-ID / token / test-code rules the API enforces.\n\nThe merchant hub drives its client-side validation from this instead of\nretyping the regexes. That is the whole point: the same rules used to\nlive as literals in three repos and they drifted — a real 17-digit Meta\nPixel ID was rejected by a ``^\\d{15,16}$`` whitelist in the hub AND\nhere, while the storefront accepted it. With the API as the authority a\nrule can be loosened without a frontend deploy, and the hub can never be\nstricter than the endpoint it posts to.\n\nStore-scoped only for auth symmetry with the rest of the tracking panel;\nthe payload is platform-wide and contains no store data. Patterns use\nsyntax that means the same thing in Python ``re`` and ECMAScript, so the\nhub can hand them to ``new RegExp`` unchanged.","operationId":"get_tracking_validation_contract","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/meta":{"put":{"tags":["Settings & money"],"summary":"Save Meta Pixel + CAPI settings","description":"Upsert the per-store Meta tracking config and (optional) CAPI token.\n\n422 if ``capi_enabled = true`` and no token is on file AND none is\nsupplied in the body — see plan §13.2.","operationId":"save_meta_tracking","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveMetaTrackingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MetaTrackingResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Disconnect Meta tracking","description":"Disconnect: revoke server-side on Meta + soft-delete locally + audit.\n\nFlow:\n  1. Decrypt the merchant's CAPI token (if one is on file).\n  2. Best-effort call to Meta's ``DELETE /me/permissions`` so the\n     merchant's Meta Business Settings → Apps page also shows the\n     NUMU app as removed — keeps the two surfaces in sync.\n  3. Turn off ``pixel_enabled`` + ``capi_enabled`` on the store\n     settings JSONB.\n  4. Soft-delete the ``service_credentials`` row (``is_active=False``)\n     so the audit trail of \"this token existed once\" survives.\n  5. Audit log under ``ADMIN_CONFIG_CHANGE`` so a later dispute\n     (\"who turned off our Meta integration?\") has a trail.\n\nThe Meta-side revoke is best-effort: if Meta is down or the token\nis already invalid, the local cleanup still proceeds. Once the\nmerchant clicks Disconnect they expect NUMU to stop using their\ndata regardless of what Meta's API does.\n\nThe ``meta_event_log`` rows are intentionally retained — they're\naudit data that the merchant might still need to debug a past\ncampaign or chase a fbtrace_id with Meta support.","operationId":"delete_meta_tracking","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MetaTrackingResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/meta/test-event":{"post":{"tags":["Settings & money"],"summary":"Send a synthetic Purchase test event to Meta","description":"Fire a synthetic Purchase via the Celery fan-out task.\n\nRejects with 422 when the resolved mode is ``off`` or ``pixel_only``\n(no CAPI to test). This is intentional — the test-event flow only\nmakes sense for modes that have a CAPI fan-out path.","operationId":"send_meta_test_event","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMetaTestEventRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SendMetaTestEventResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/meta/events":{"get":{"tags":["Settings & money"],"summary":"Get recent Meta CAPI events","description":"Return last N ``meta_event_log`` rows, redacted.\n\nThe ``request_payload.user_data`` sub-object is dropped entirely;\nonly boolean indicators (\"had_email\": true) survive.","operationId":"get_meta_events","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_MetaEventLogEntry__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/meta/verify":{"post":{"tags":["Settings & money"],"summary":"Verify the Meta Pixel against Meta","description":"Ask Meta whether this store's Pixel ID actually exists and is writable.\n\n``GET /{version}/{pixel_id}?fields=name,is_active`` with the merchant's own\nCAPI token. A 200 proves three things at once that no local check can: the\ndataset exists, the token has access to it, and the token is still valid.\n\nNever raises for a \"no\" answer — a failed verification is a 200 with\n``verified: false`` and Meta's own message, because the merchant needs to\nread that message. Only a missing store/config is a client error.","operationId":"verify_meta_tracking_connection","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VerifyConnectionResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/meta/match-quality":{"get":{"tags":["Settings & money"],"summary":"Get Meta Event Match Quality","description":"Latest EMQ snapshot per event, from Meta's Dataset Quality API.\n\nReads cached rows written by the ``meta_match_quality_poll`` beat task —\nnever calls Meta inline, because the Marketing API rate-limits per app and\na dashboard must not fail when a third party is slow.\n\nEmpty ``events`` means no poll has landed yet (the store may have just\nconnected, or its token may lack the ``ads_read`` scope the Dataset\nQuality API requires — which is a different problem from having no data).","operationId":"get_meta_match_quality","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MetaMatchQualityResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/meta/replay":{"post":{"tags":["Settings & money"],"summary":"Re-send failed Meta Conversions API deliveries","description":"Re-queue failed and dead-lettered deliveries, e.g. after reconnecting.\n\nRows are re-sent from their stored payload with the same ``event_id``, so\nMeta merges a replay into the original event. Safe to call twice.","operationId":"replay_meta_failed_events","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TikTokReplayResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/meta/status":{"get":{"tags":["Settings & money"],"summary":"Get Meta tracking status","description":"Live status badge data — see plan §7.5.","operationId":"get_meta_tracking_status","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MetaTrackingStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/tiktok":{"put":{"tags":["Settings & money"],"summary":"Save TikTok Pixel + Events API settings","description":"Upsert the per-store TikTok tracking config and (optional) API token.\n\n422 if ``api_enabled = true`` and no token is on file AND none is\nsupplied in the body.","operationId":"save_tiktok_tracking","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveTikTokTrackingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TikTokTrackingResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Disconnect TikTok tracking","description":"Disconnect: turn off flags locally + soft-delete credential + audit.\n\nUnlike Meta there is no server-side OAuth revoke yet (TikTok OAuth is a\nlater phase — the token here is a merchant-pasted Events API token).\nThe ``tiktok_event_log`` rows are retained as audit data.","operationId":"delete_tiktok_tracking","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TikTokTrackingResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/tiktok/test-event":{"post":{"tags":["Settings & money"],"summary":"Send a synthetic Purchase test event to TikTok","description":"Fire a synthetic Purchase via the Celery fan-out task.\n\nRejects with 422 when the resolved mode is ``off`` or ``pixel_only``\n(no Events API to test).","operationId":"send_tiktok_test_event","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTikTokTestEventRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SendTikTokTestEventResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/tiktok/events":{"get":{"tags":["Settings & money"],"summary":"Get recent TikTok Events API events","description":"Return last N ``tiktok_event_log`` rows, redacted.\n\nThe ``request_payload.user`` sub-object is dropped; only boolean\npresence indicators survive.","operationId":"get_tiktok_events","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_TikTokEventLogEntry__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/tiktok/failed-events":{"get":{"tags":["Settings & money"],"summary":"Get TikTok Events API deliveries that failed","description":"Rows TikTok never accepted, newest first — the dead-letter view.\n\n\"Failed\" is the same predicate as the ``idx_tiktok_event_log_failed``\npartial index: no response recorded, an HTTP 4xx/5xx, or a non-zero\nbusiness code. Redaction matches ``get_tiktok_events`` — the hashed\n``user`` object never leaves the API, only presence booleans.","operationId":"get_tiktok_failed_events","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Hours"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_TikTokEventLogEntry__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/tiktok/replay":{"post":{"tags":["Settings & money"],"summary":"Re-send failed TikTok Events API deliveries","description":"Queue a re-send of every failed delivery in the window.\n\nEach row is replayed from its STORED payload, so no PII is re-hashed and\nthe ``event_id`` is unchanged — TikTok collapses a replay into the\noriginal event rather than counting a second conversion. Rows that already\nsucceeded are skipped by the task itself, so calling this twice is safe.\n\nRejects when the Events API is not actually on: replaying into a\ndisconnected integration would just re-fail every row and reset their\nattempt counts.","operationId":"replay_tiktok_failed_events","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Hours"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TikTokReplayResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/tiktok/verify":{"post":{"tags":["Settings & money"],"summary":"Verify the TikTok Pixel against TikTok","description":"Ask TikTok whether this store's Pixel Code exists on its advertiser.\n\n``GET /open_api/v1.3/pixel/list/?advertiser_id=…`` with the merchant's\nEvents API token, then look for the configured code in the response.\n\nTikTok's quirk: HTTP 200 does NOT mean success — the real status is the\n``code`` field in the body, where 0 means OK. The Events API fanout already\ntreats ``code == 0`` as the success signal, and this follows the same rule\nrather than trusting the HTTP status.\n\nRequires ``advertiser_id``: unlike Meta, TikTok has no endpoint that reads\na pixel by code alone. Without it we say so instead of guessing.","operationId":"verify_tiktok_tracking_connection","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VerifyConnectionResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/tiktok/status":{"get":{"tags":["Settings & money"],"summary":"Get TikTok tracking status","description":"Live status badge data for the TikTok panel.","operationId":"get_tiktok_tracking_status","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TikTokTrackingStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/tracking/tiktok/report":{"get":{"tags":["Settings & money"],"summary":"Get TikTok Marketing ad-performance report","description":"Aggregated advertiser-level spend/impressions/conversions for the panel.\n\nReturns ``connected=false`` when the store has no ``advertiser_id`` on file\n(or no token) — the merchant only gets this after the OAuth flow, since a\nhand-pasted Events API token lacks reporting scope. Reporting failures\n(e.g. missing scope) come back as ``connected=true`` with an ``error``\nstring rather than misleading zeros.","operationId":"get_tiktok_report","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TikTokReportResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/settings/channels/tiktok-shop":{"put":{"tags":["Settings & money"],"summary":"Connect TikTok Shop (persist token + shop)","description":"Persist the OAuth token bundle (encrypted) + shop metadata.\n\nCalled by the hub after the OAuth callback returns the token + chosen shop.","operationId":"connect_tiktok_shop","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectTikTokShopRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TikTokShopStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Settings & money"],"summary":"TikTok Shop connection status","operationId":"get_tiktok_shop_status","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TikTokShopStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Disconnect TikTok Shop","description":"Soft-delete the credential + clear the channel settings.","operationId":"disconnect_tiktok_shop","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TikTokShopStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/onboarding":{"get":{"tags":["Settings & money"],"summary":"Get onboarding progress","description":"Get onboarding progress for a store.\n\nReturns the current onboarding state including all steps,\ncompletion percentage, and current step. Lazily initializes\nonboarding on first access with create_store already completed.\n\nAlso reconciles steps whose completion can be derived from other\ntables (e.g. FIRST_ORDER ← orders table) — historically these\nsteps were only ever flipped by the manual order endpoint, so\nstores whose first order came in via the storefront checkout were\nstuck at 5/6 forever.","operationId":"get_onboarding","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OnboardingResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/onboarding/complete/{step}":{"post":{"tags":["Settings & money"],"summary":"Complete an onboarding step","description":"Mark an onboarding step as completed.\n\nIdempotent: completing an already-completed step is a no-op.\nWhen all steps are completed or skipped, the overall onboarding\nis automatically marked as complete.","operationId":"complete_step","parameters":[{"name":"step","in":"path","required":true,"schema":{"type":"string","description":"Step key to complete","title":"Step"},"description":"Step key to complete"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OnboardingResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/onboarding/skip/{step}":{"post":{"tags":["Settings & money"],"summary":"Skip an onboarding step","description":"Skip an onboarding step.\n\nSkipped steps count toward completion percentage. Some steps\n(like create_store) cannot be skipped. Returns 422 for\nnon-skippable steps.","operationId":"skip_step","parameters":[{"name":"step","in":"path","required":true,"schema":{"type":"string","description":"Step key to skip","title":"Step"},"description":"Step key to skip"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OnboardingResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/onboarding/dismiss":{"post":{"tags":["Settings & money"],"summary":"Dismiss onboarding","description":"Dismiss the onboarding entirely.\n\nThe merchant can always revisit onboarding later. Dismissing\ndoes not complete any pending steps.","operationId":"dismiss_onboarding","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OnboardingResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/onboarding/undismiss":{"post":{"tags":["Settings & money"],"summary":"Restore dismissed onboarding","description":"Restore a previously dismissed onboarding so it shows again.","operationId":"undismiss_onboarding","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_OnboardingResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/onboarding/configure":{"post":{"tags":["Settings & money"],"summary":"Auto-configure store from wizard answers","description":"Auto-configure store based on onboarding wizard answers.\n\nSets currency, payment methods, shipping zones, language,\nand theme based on the merchant's business type and location, and\nrecords the qualification answers on the merchant lead.","operationId":"configure_from_wizard","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WizardConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_WizardConfigResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/refunds":{"post":{"tags":["Orders & fulfillment"],"summary":"Request a refund for an order","description":"Create a refund request for an order.","operationId":"create_refund","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Store ID","title":"Store Id"},"description":"Store ID"},{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRefundRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RefundResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Orders & fulfillment"],"summary":"List refunds for an order","description":"List all refunds for a specific order.","operationId":"list_order_refunds","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Store ID","title":"Store Id"},"description":"Store ID"},{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":20,"title":"Page Size"},"description":"Items per page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaginatedListResponse_RefundListItemResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/refunds/{refund_id}":{"get":{"tags":["Orders & fulfillment"],"summary":"Get refund details","description":"Get details of a specific refund.","operationId":"get_refund","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Store ID","title":"Store Id"},"description":"Store ID"},{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"refund_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Refund ID","title":"Refund Id"},"description":"Refund ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RefundResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/refunds/{refund_id}/approve":{"post":{"tags":["Orders & fulfillment"],"summary":"Approve a refund request","description":"Approve a pending refund request.","operationId":"approve_refund","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Store ID","title":"Store Id"},"description":"Store ID"},{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"refund_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Refund ID","title":"Refund Id"},"description":"Refund ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RefundResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/refunds/{refund_id}/reject":{"post":{"tags":["Orders & fulfillment"],"summary":"Reject a refund request","description":"Reject a pending refund request.","operationId":"reject_refund","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Store ID","title":"Store Id"},"description":"Store ID"},{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"refund_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Refund ID","title":"Refund Id"},"description":"Refund ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectRefundRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RefundResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/orders/{order_id}/refunds/{refund_id}/process":{"post":{"tags":["Orders & fulfillment"],"summary":"Process a refund through payment provider","description":"Process an approved refund through the payment provider.","operationId":"process_refund","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Store ID","title":"Store Id"},"description":"Store ID"},{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Order ID","title":"Order Id"},"description":"Order ID"},{"name":"refund_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Refund ID","title":"Refund Id"},"description":"Refund ID"},{"name":"restock_items","in":"query","required":false,"schema":{"type":"boolean","description":"Shopify-style 'restock items': when true and the refund completes, the order's checkout debit manifest is replayed (ALL lines, once — idempotent). Default false: refunds do not auto-restock (money back ≠ goods back).","default":false,"title":"Restock Items"},"description":"Shopify-style 'restock items': when true and the refund completes, the order's checkout debit manifest is replayed (ALL lines, once — idempotent). Default false: refunds do not auto-restock (money back ≠ goods back)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RefundResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/refunds":{"get":{"tags":["Orders & fulfillment"],"summary":"List all refunds for a store","description":"List all refunds for a store with optional status filter.","operationId":"list_store_refunds","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Store ID","title":"Store Id"},"description":"Store ID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by refund status","title":"Status"},"description":"Filter by refund status"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Items per page","default":20,"title":"Page Size"},"description":"Items per page"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaginatedListResponse_RefundListItemResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/returns":{"get":{"tags":["Orders & fulfillment"],"summary":"List returns for the store","description":"Hub list view — newest first.","operationId":"merchant_list_returns","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ReturnStatus"},{"type":"null"}],"description":"Filter by status (e.g. requested, approved, received).","title":"Status"},"description":"Filter by status (e.g. requested, approved, received)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_ReturnResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/returns/{return_id}":{"get":{"tags":["Orders & fulfillment"],"summary":"Get one return","operationId":"merchant_get_return","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"return_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Return ID","title":"Return Id"},"description":"Return ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ReturnResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/returns/{return_id}/approve":{"post":{"tags":["Orders & fulfillment"],"summary":"Approve a pending return","operationId":"merchant_approve_return","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"return_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Return ID","title":"Return Id"},"description":"Return ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveReturnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ReturnResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/returns/{return_id}/reject":{"post":{"tags":["Orders & fulfillment"],"summary":"Reject a return","operationId":"merchant_reject_return","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"return_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Return ID","title":"Return Id"},"description":"Return ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectReturnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ReturnResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/returns/{return_id}/mark-received":{"post":{"tags":["Orders & fulfillment"],"summary":"Mark a return as physically received","description":"Set status from `approved` → `received`. Required before\nissuing the refund — receiving is the merchant's signal that the\npackage physically arrived in acceptable condition.","operationId":"merchant_mark_return_received","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"return_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Return ID","title":"Return Id"},"description":"Return ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkReceivedRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ReturnResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/returns/{return_id}/refund":{"post":{"tags":["Orders & fulfillment"],"summary":"Issue refund for a received return","description":"Mint a Refund row linked to this return + transition the return.\n\nBridges into the existing Refund state machine rather than\nre-implementing payment-provider integration. The refund row's\nmetadata.return_id field links the two; once the refund completes\nvia its own pipeline, a future webhook will transition the return\nto `completed`. For this endpoint we just mint + link.\n\nWhy we don't kick off provider processing synchronously:\n    Provider refund APIs (Paymob, Fawry, Stripe) are slow, flaky,\n    and asymmetric — some return immediately, some require polling.\n    The existing Refund use cases handle the dispatch + retry\n    pipeline. We just hand off here.","operationId":"merchant_issue_return_refund","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"return_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Return ID","title":"Return Id"},"description":"Return ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueRefundRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ReturnResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/reconciliation/runs":{"get":{"tags":["Settings & money"],"summary":"List reconciliation runs","description":"List reconciliation runs scoped to this store.","operationId":"store_list_reconciliation_runs","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":60,"minimum":1,"default":30,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_ReconciliationRunSummary__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/reconciliation/runs/{run_id}/mismatches":{"get":{"tags":["Settings & money"],"summary":"Get mismatches for a reconciliation run","description":"Get mismatches for a specific reconciliation run scoped to this store.","operationId":"store_list_run_mismatches","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"resolved","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Resolved"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_MismatchSummary__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/reconciliation/mismatches/{mismatch_id}":{"patch":{"tags":["Settings & money"],"summary":"Resolve or reopen a reconciliation mismatch","description":"Mark a mismatch resolved (or reopen it).\n\n`resolved` was readable and filterable from day one but nothing could\never set it, so every mismatch sat at \"Open\" forever and the list only\ngrew. Ownership is checked through the parent run — the same lesson as\nthe CL-1 cross-owner fix on the listing endpoint above.","operationId":"store_resolve_reconciliation_mismatch","parameters":[{"name":"mismatch_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Mismatch Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ResolveMismatchRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MismatchSummary_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/reconciliation/runs/trigger":{"post":{"tags":["Settings & money"],"summary":"Trigger reconciliation for a date","description":"Trigger a reconciliation run for a given date (defaults to yesterday).\n\nOnly the store owner may invoke this endpoint.","operationId":"store_trigger_reconciliation","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/src__api__v1__routes__stores__reconciliation__TriggerReconciliationRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TriggerReconciliationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/reconciliation/gateway-breakdown":{"get":{"tags":["Settings & money"],"summary":"Payment volume broken down by gateway","description":"Aggregate ``payment_transactions`` by gateway for a date range.\n\nReturns one row per (gateway, status, currency) triple — so a\nmerchant can see at a glance how much arrived via InstaPay vs.\nPaymob vs. COD, and how many of each failed. Read-only; does not\ntrigger a reconciliation run.","operationId":"store_reconciliation_gateway_breakdown","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive start date (UTC). Defaults to 7 days ago.","title":"Date From"},"description":"Inclusive start date (UTC). Defaults to 7 days ago."},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive end date (UTC). Defaults to today.","title":"Date To"},"description":"Inclusive end date (UTC). Defaults to today."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_GatewayBreakdownResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/carriers":{"get":{"tags":["Orders & fulfillment"],"summary":"Carrier catalog with this store's connection state","description":"Every selectable carrier, its capabilities, and this store's state.\n\nOne call gives the hub everything it needs to render the carrier list\nand generate connect-forms — names in both languages, brand colour,\ntier, declared capabilities, credential field descriptors, and whether\nthis store has connected and verified each one.\n\nThe catalog half answers from the registry alone (no credentials, no\nnetwork), so this works for a store that has connected nothing.","operationId":"list_store_carriers","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/carriers/{slug}/credentials":{"put":{"tags":["Orders & fulfillment"],"summary":"Save credentials for a carrier","description":"Encrypt and store a carrier's credentials, then verify them.\n\nVerification runs inline and its result is persisted, so the response\nalready tells the merchant whether the keys actually work. Saving no\nlonger implies \"connected\" — that was the bug behind the green badge\nfor a typo'd key.\n\nA carrier is **not** auto-enabled on save. Enabling stays an explicit\naction in shipping settings.","operationId":"save_carrier_credentials","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","description":"Carrier slug","title":"Slug"},"description":"Carrier slug"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveCarrierCredentialsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Orders & fulfillment"],"summary":"Disconnect a carrier","description":"Remove a carrier's credentials and disable it.\n\nDisabling is part of disconnecting on purpose — a carrier left enabled\nwith no credentials shows a live badge for something that cannot\nauthenticate.","operationId":"delete_carrier_credentials","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","description":"Carrier slug","title":"Slug"},"description":"Carrier slug"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/carriers/{slug}/verify":{"post":{"tags":["Orders & fulfillment"],"summary":"Verify a carrier's stored credentials","description":"Re-check stored credentials against the carrier and persist the result.\n\nThis replaces the hub's per-browser ``localStorage`` probe: the answer\nis stored with the credentials, so every browser, teammate and support\nagent sees the same state.\n\nReturns 200 with ``verified: null`` for a carrier that declares no\nverification call — an honest \"unknown\" rather than a green badge.","operationId":"verify_carrier_credentials","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","description":"Carrier slug","title":"Slug"},"description":"Carrier slug"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/carriers/{slug}":{"patch":{"tags":["Orders & fulfillment"],"summary":"Change a connected carrier's settings","description":"Switch auto-create on or off without re-entering credentials.","operationId":"update_carrier_settings","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","description":"Carrier slug","title":"Slug"},"description":"Carrier slug"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCarrierSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/couriers/seeds":{"get":{"tags":["Orders & fulfillment"],"summary":"Known Egyptian couriers to start from","description":"Couriers a merchant can pick instead of typing one from scratch.\n\nEach carries ``data_verified``. An unverified seed ships with full\ngovernorate coverage and the hub must show it as unconfirmed — it is\na starting point, not a claim about how that courier operates.","operationId":"list_courier_seeds","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/couriers":{"get":{"tags":["Orders & fulfillment"],"summary":"This store's courier profiles","operationId":"list_courier_profiles","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Orders & fulfillment"],"summary":"Add a courier","description":"Create a courier, optionally pre-filled from a seed.","operationId":"create_courier_profile","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfilePayload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/couriers/{profile_id}":{"patch":{"tags":["Orders & fulfillment"],"summary":"Update a courier","operationId":"update_courier_profile","parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfilePayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Orders & fulfillment"],"summary":"Remove a courier","description":"Remove a courier.\n\nShipments already in transit keep their own carrier field, so this\nnever orphans a parcel that is already out.","operationId":"delete_courier_profile","parameters":[{"name":"profile_id","in":"path","required":true,"schema":{"type":"string","title":"Profile Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/waybills":{"post":{"tags":["Orders & fulfillment"],"summary":"Print waybills for a batch of shipments","description":"One PDF for the day's parcels.\n\n``roll`` prints each label 1:1 on a thermal roll; ``sheet`` tiles the\nsame label four-up on A4 for a merchant with an office printer. Same\nlayout either way.","operationId":"print_waybills","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"html","in":"query","required":false,"schema":{"type":"boolean","description":"Return the printable HTML instead of a PDF.","default":false,"title":"Html"},"description":"Return the printable HTML instead of a PDF."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaybillRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/{shipment_id}/waybill":{"get":{"tags":["Orders & fulfillment"],"summary":"Print one waybill","operationId":"print_waybill","parameters":[{"name":"shipment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Shipment Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"html","in":"query","required":false,"schema":{"type":"boolean","description":"Return the printable HTML instead of a PDF.","default":false,"title":"Html"},"description":"Return the printable HTML instead of a PDF."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/manifest":{"get":{"tags":["Orders & fulfillment"],"summary":"Export the pickup manifest as CSV","description":"The sheet the merchant hands the courier.\n\n``courier`` is what makes this usable with more than one company. A\nmerchant running Barashout and Waselha at once must not hand either\nof them a sheet listing the other's parcels, so the filter uses the\nsame rule the label does — see :func:`_courier_of`.\n\nWritten UTF-8 **with a BOM** so Excel opens Arabic correctly — the\nopposite of the rule for source files, and deliberate.","operationId":"export_shipment_manifest","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","description":"Shipment status to include","default":"created","title":"Status"},"description":"Shipment status to include"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"default":500,"title":"Limit"}},{"name":"courier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Courier profile id. Returns only that courier's parcels — omit for every parcel in the status.","title":"Courier"},"description":"Courier profile id. Returns only that courier's parcels — omit for every parcel in the status."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/status-import":{"post":{"tags":["Orders & fulfillment"],"summary":"Preview a courier's status sheet","description":"Parse a courier's sheet and report what *would* change.\n\n**Applies nothing.** Every row comes back, including the ones that\nfailed, with a reason and the line number Excel shows — a silent row\ncount is how a merchant loses ten parcels without noticing.","operationId":"preview_status_import","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_preview_status_import"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/status-import/apply":{"post":{"tags":["Orders & fulfillment"],"summary":"Apply reviewed status rows","description":"Apply the rows the merchant confirmed.\n\nRows are re-resolved against this store's shipments rather than\ntrusted from the request: the preview is advisory, and a tracking\nnumber that isn't ours must not move anything.","operationId":"apply_status_import","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/":{"post":{"tags":["Orders & fulfillment"],"summary":"Create shipment","description":"Create a shipment for an order via the selected carrier.","operationId":"create_shipment","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShipmentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShipmentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Orders & fulfillment"],"summary":"List shipments","description":"List shipments for the store with optional filters.","operationId":"list_shipments","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"carrier","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Carrier"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date To"}},{"name":"has_cod","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Cod"}},{"name":"order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by order ID","title":"Order Id"},"description":"Filter by order ID"},{"name":"has_label","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by whether AWB / shipping label exists","title":"Has Label"},"description":"Filter by whether AWB / shipping label exists"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_ShipmentListItemResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/bulk":{"post":{"tags":["Orders & fulfillment"],"summary":"Bulk create shipments","description":"Create shipments for multiple orders. Partial failures don't block success.","operationId":"bulk_create_shipments","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCreateShipmentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_BulkShipmentResultResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/stats":{"get":{"tags":["Orders & fulfillment"],"summary":"Shipment dashboard stats","description":"Get aggregated shipment statistics for the dashboard.","operationId":"get_shipment_stats","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShipmentStatsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/cod/summary":{"get":{"tags":["Orders & fulfillment"],"summary":"COD reconciliation summary","description":"Get COD collection summary for reconciliation.","operationId":"get_cod_summary","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CodSummaryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/pickups":{"get":{"tags":["Orders & fulfillment"],"summary":"List pickups","description":"List all scheduled pickups for a carrier.","operationId":"list_pickups","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"carrier","in":"query","required":false,"schema":{"type":"string","description":"Carrier slug","default":"bosta","title":"Carrier"},"description":"Carrier slug"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Orders & fulfillment"],"summary":"Schedule a pickup","description":"Schedule a courier pickup from a business location.","operationId":"create_pickup","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"business_location_id","in":"query","required":true,"schema":{"type":"string","title":"Business Location Id"}},{"name":"scheduled_date","in":"query","required":true,"schema":{"type":"string","title":"Scheduled Date"}},{"name":"scheduled_time_slot","in":"query","required":true,"schema":{"type":"string","title":"Scheduled Time Slot"}},{"name":"contact_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"}},{"name":"contact_phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"}},{"name":"contact_email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"}},{"name":"notes","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},{"name":"carrier","in":"query","required":false,"schema":{"type":"string","description":"Carrier slug","default":"bosta","title":"Carrier"},"description":"Carrier slug"}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/{shipment_id}":{"get":{"tags":["Orders & fulfillment"],"summary":"Get shipment detail","description":"Get full shipment details including status history.","operationId":"get_shipment","parameters":[{"name":"shipment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Shipment Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShipmentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Orders & fulfillment"],"summary":"Update shipment on Bosta","description":"Update a delivery with the owning carrier (receiver info, COD, notes).","operationId":"update_shipment","parameters":[{"name":"shipment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Shipment Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"notes","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},{"name":"cod_amount","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cod Amount"}},{"name":"receiver_phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receiver Phone"}},{"name":"receiver_first_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receiver First Name"}},{"name":"receiver_last_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receiver Last Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShipmentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/{shipment_id}/cancel":{"post":{"tags":["Orders & fulfillment"],"summary":"Cancel shipment","description":"Cancel a shipment with the carrier that owns it.","operationId":"cancel_shipment","parameters":[{"name":"shipment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Shipment Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShipmentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/{shipment_id}/return":{"post":{"tags":["Orders & fulfillment"],"summary":"Request return shipment","description":"Request a return shipment, creating a child shipment.","operationId":"request_return_shipment","parameters":[{"name":"shipment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Shipment Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"reason","in":"query","required":false,"schema":{"type":"string","default":"Customer return","title":"Reason"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShipmentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/{shipment_id}/track":{"get":{"tags":["Orders & fulfillment"],"summary":"Track shipment","description":"Get real-time tracking from the carrier that owns this shipment.","operationId":"track_shipment_detail","parameters":[{"name":"shipment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Shipment Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/{shipment_id}/awb":{"get":{"tags":["Orders & fulfillment"],"summary":"Print AWB (Air Waybill)","description":"Get the Air Waybill PDF for printing.","operationId":"print_shipment_awb","parameters":[{"name":"shipment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Shipment Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/{shipment_id}/bosta-details":{"get":{"tags":["Orders & fulfillment"],"summary":"Get delivery details from Bosta","description":"Fetch full delivery details from the carrier that owns this shipment.\n\nPath stays ``/bosta-details`` for hub back-compat, but it now resolves\nthe shipment's real carrier — asking Bosta about a Mylerz waybill\nreturned nothing useful. Carriers without ``get_delivery`` return 501.\nP1/P3 rename this to a carrier-neutral path.","operationId":"get_bosta_delivery_details","parameters":[{"name":"shipment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Shipment Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/pickups/locations":{"get":{"tags":["Orders & fulfillment"],"summary":"Get business pickup locations","description":"Get pickup locations configured in the carrier's dashboard.\n\nPickup routes are store-scoped, so they take an explicit ``carrier``\nrather than inferring one. Default stays \"bosta\" for back-compat;\ncarriers without pickup support return 501 instead of silently\nquerying Bosta.","operationId":"get_pickup_locations","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"carrier","in":"query","required":false,"schema":{"type":"string","description":"Carrier slug","default":"bosta","title":"Carrier"},"description":"Carrier slug"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/pickups/{pickup_id}":{"get":{"tags":["Orders & fulfillment"],"summary":"Get pickup details","description":"Get details of a specific pickup.","operationId":"get_pickup","parameters":[{"name":"pickup_id","in":"path","required":true,"schema":{"type":"string","title":"Pickup Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"carrier","in":"query","required":false,"schema":{"type":"string","description":"Carrier slug","default":"bosta","title":"Carrier"},"description":"Carrier slug"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Orders & fulfillment"],"summary":"Update pickup","description":"Update a scheduled pickup.","operationId":"update_pickup","parameters":[{"name":"pickup_id","in":"path","required":true,"schema":{"type":"string","title":"Pickup Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"scheduled_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled Date"}},{"name":"scheduled_time_slot","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scheduled Time Slot"}},{"name":"contact_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"}},{"name":"contact_phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"}},{"name":"notes","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},{"name":"carrier","in":"query","required":false,"schema":{"type":"string","description":"Carrier slug","default":"bosta","title":"Carrier"},"description":"Carrier slug"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Orders & fulfillment"],"summary":"Cancel pickup","description":"Cancel/delete a scheduled pickup.","operationId":"delete_pickup","parameters":[{"name":"pickup_id","in":"path","required":true,"schema":{"type":"string","title":"Pickup Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"carrier","in":"query","required":false,"schema":{"type":"string","description":"Carrier slug","default":"bosta","title":"Carrier"},"description":"Carrier slug"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/bosta/cities":{"get":{"tags":["Orders & fulfillment"],"summary":"Get Bosta cities","description":"Get all cities available for Bosta delivery.\n\nBosta-namespaced by URL contract — the hub's connection probe calls\n``getBostaCities``. The carrier is passed explicitly rather than\nbeing an accidental default. P1/P3 generalise this to\n``/carriers/{slug}/cities``.","operationId":"get_bosta_cities","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipments/bosta/cities/{city_id}/zones":{"get":{"tags":["Orders & fulfillment"],"summary":"Get zones in a city","description":"Get delivery zones within a specific Bosta city.\n\nBosta-namespaced by URL contract; see get_bosta_cities.","operationId":"get_bosta_city_zones","parameters":[{"name":"city_id","in":"path","required":true,"schema":{"type":"string","title":"City Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"orders:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipping/zones":{"get":{"tags":["Settings & money"],"summary":"List shipping zones","operationId":"list_shipping_zones","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_ZoneResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Settings & money"],"summary":"Create a shipping zone","operationId":"create_shipping_zone","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateZoneRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ZoneResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipping/zones/{zone_id}":{"get":{"tags":["Settings & money"],"summary":"Get a shipping zone","operationId":"get_shipping_zone","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Zone Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ZoneResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Settings & money"],"summary":"Update a shipping zone","operationId":"update_shipping_zone","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Zone Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateZoneRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ZoneResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Deactivate (soft-delete) a shipping zone","operationId":"delete_shipping_zone","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Zone Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipping/zones/{zone_id}/rates":{"post":{"tags":["Settings & money"],"summary":"Create a rate on a zone","operationId":"create_shipping_rate","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Zone Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipping/zones/{zone_id}/rates/{rate_id}":{"patch":{"tags":["Settings & money"],"summary":"Update a rate","operationId":"update_shipping_rate","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Zone Id"}},{"name":"rate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rate Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_RateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Deactivate a rate","operationId":"delete_shipping_rate","parameters":[{"name":"zone_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Zone Id"}},{"name":"rate_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rate Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipping/coverage":{"get":{"tags":["Settings & money"],"summary":"Return covered/uncovered governorates for the store","operationId":"get_shipping_coverage","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CoverageResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipping/preset/egypt-4-zone":{"post":{"tags":["Settings & money"],"summary":"Apply the Quick Start: Egypt 4-zone preset","description":"Create 4 zones with default rates covering all 27 governorates.\n\nRejects if the store already has any active zones — merchants who\nwant to re-apply the preset should first deactivate existing zones\n(or use the dashboard's \"start over\" action, which wires through\nthe same endpoint after a bulk soft-delete).","operationId":"apply_egypt_4_zone_preset","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PresetResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/shipping/calculate":{"post":{"tags":["Settings & money"],"summary":"Preview rates for a cart (merchant calculator tool)","description":"Same shape as storefront /shipping/options — shares the resolver.","operationId":"calculate_shipping_preview","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateCalculatorRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ShippingOptionsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/payments/balances":{"get":{"tags":["Settings & money"],"summary":"Get Balances","description":"Return aggregated wallet and store payment balances.","operationId":"get_balances_api_v1_stores__store_id__payments_balances_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_BalancesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/payments/transactions":{"get":{"tags":["Settings & money"],"summary":"List Transactions","description":"List payment transactions for the store, newest first.","operationId":"list_transactions_api_v1_stores__store_id__payments_transactions_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_TransactionResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/payments/invoices":{"get":{"tags":["Settings & money"],"summary":"List Invoices","description":"List invoices for the store, newest first.","operationId":"list_invoices_api_v1_stores__store_id__payments_invoices_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_list_InvoiceResponse____1"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/upsells":{"post":{"tags":["Catalog"],"summary":"Create upsell rule","description":"Create a new upsell rule for the store.","operationId":"create_upsell_rule","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUpsellRuleRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_UpsellRuleResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Catalog"],"summary":"List upsell rules","description":"List upsell rules for a store.","operationId":"list_upsell_rules","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"Filter to active rules only","default":false,"title":"Active Only"},"description":"Filter to active rules only"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_UpsellRuleResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/upsells/{rule_id}":{"get":{"tags":["Catalog"],"summary":"Get upsell rule","description":"Get upsell rule details by ID.","operationId":"get_upsell_rule","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Upsell rule ID","title":"Rule Id"},"description":"Upsell rule ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_UpsellRuleResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Catalog"],"summary":"Update upsell rule","description":"Update upsell rule details.","operationId":"update_upsell_rule","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Upsell rule ID","title":"Rule Id"},"description":"Upsell rule ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateUpsellRuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_UpsellRuleResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Catalog"],"summary":"Delete upsell rule","description":"Delete an upsell rule.","operationId":"delete_upsell_rule","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Upsell rule ID","title":"Rule Id"},"description":"Upsell rule ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/bundles":{"post":{"tags":["Catalog"],"summary":"Create product bundle","description":"Create a new bundle association for a product.","operationId":"create_product_bundle","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBundleRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_BundleResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Catalog"],"summary":"List bundles for a store or product","description":"List bundles, optionally filtered by primary product.","operationId":"list_product_bundles","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"primary_product_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by primary product ID","title":"Primary Product Id"},"description":"Filter by primary product ID"},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only return active bundles","default":false,"title":"Active Only"},"description":"Only return active bundles"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_BundleResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/bundles/set":{"put":{"tags":["Catalog"],"summary":"Set bundles for a product (replace all)","description":"Replace all bundles for a primary product (atomic set operation).\n\nThis is the preferred endpoint for the dashboard — it sends the\ncomplete desired state and the backend reconciles.","operationId":"set_product_bundles","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkSetBundlesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_BundleResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/bundles/{bundle_id}":{"get":{"tags":["Catalog"],"summary":"Get bundle details","description":"Get a single bundle by ID.","operationId":"get_product_bundle","parameters":[{"name":"bundle_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Bundle ID","title":"Bundle Id"},"description":"Bundle ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_BundleResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Catalog"],"summary":"Update bundle","description":"Update a bundle's discount, position, or active state.","operationId":"update_product_bundle","parameters":[{"name":"bundle_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Bundle ID","title":"Bundle Id"},"description":"Bundle ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBundleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_BundleResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Catalog"],"summary":"Delete bundle","description":"Delete a single bundle association.","operationId":"delete_product_bundle","parameters":[{"name":"bundle_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Bundle ID","title":"Bundle Id"},"description":"Bundle ID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/bundles/reorder":{"post":{"tags":["Catalog"],"summary":"Reorder bundles","description":"Reorder bundles for a primary product (drag & drop support).","operationId":"reorder_product_bundles","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderBundlesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"catalog:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/social/connections":{"get":{"tags":["Marketing"],"summary":"List social connections","description":"List all active social connections for this store.","operationId":"list_social_connections","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_SocialConnectionResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Marketing"],"summary":"Connect social account","description":"Initiate or complete an OAuth connection.\n\nIf `oauth_code` is omitted, returns an `auth_url` for the frontend to redirect to.\nIf `oauth_code` is provided, completes the connection and returns the connection object.","operationId":"connect_social_account","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectSocialRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/social/connections/{connection_id}":{"delete":{"tags":["Marketing"],"summary":"Disconnect social account","description":"Disconnect a social account and revoke the stored token.","operationId":"disconnect_social_account","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Connection UUID","title":"Connection Id"},"description":"Connection UUID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/social/connections/{connection_id}/posts":{"get":{"tags":["Marketing"],"summary":"Fetch posts from connected account","description":"Fetch recent posts from the connected social account.","operationId":"fetch_social_posts","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Connection UUID","title":"Connection Id"},"description":"Connection UUID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SocialPostsListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/social/connections/{connection_id}/import":{"post":{"tags":["Marketing"],"summary":"Import social posts as draft products","description":"Import one or more social posts as draft NUMU products.","operationId":"import_social_posts","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Connection UUID","title":"Connection Id"},"description":"Connection UUID"},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPostsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ImportPostsResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/social/import-url":{"post":{"tags":["Marketing"],"summary":"Import products from Instagram/Facebook post URLs","description":"Import products by pasting Instagram or Facebook post URLs.\n\nNo OAuth connection required — scrapes public post data (image, caption, price)\nfrom Open Graph meta tags and creates draft products.\n\nMax 20 URLs per request.","operationId":"import_from_social_url","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportFromUrlRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ImportFromUrlResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes":{"get":{"tags":["Online store"],"summary":"List all themes available to a store (built-in + external)","description":"List all themes available to this store.\n\nIncludes:\n- All built-in themes (modern, empire, kick-game, etc.)\n- The store's external (BYOT) theme, if any","operationId":"list_store_themes_api_v1_stores__store_id__themes_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StoreThemesListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/external":{"post":{"tags":["Online store"],"summary":"Submit External Theme","description":"Submit an external theme from a GitHub repository for building.\n\nThe build process:\n1. Validates the GitHub URL\n2. Queues a background build task\n3. Returns a build_id for status polling\n\nThe build task will:\n- Clone the repo (shallow)\n- Validate the theme contract (theme.json, settings_schema.json, etc.)\n- Run `npm install && numu-theme build`\n- Upload the output to CDN (R2/S3)\n- Update the store's theme_settings with the CDN URLs","operationId":"submit_external_theme_api_v1_stores__store_id__themes_external_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitExternalThemeRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ThemeBuildResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Online store"],"summary":"Get External Theme Info","description":"Get the current external theme info for a store.","operationId":"get_external_theme_info_api_v1_stores__store_id__themes_external_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ExternalThemeInfoResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Online store"],"summary":"Remove External Theme","description":"Remove the external theme and revert to a built-in theme.","operationId":"remove_external_theme_api_v1_stores__store_id__themes_external_delete","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveExternalThemeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/external/dev-mode":{"post":{"tags":["Online store"],"summary":"Connect a local theme dev server (numu-theme dev)","description":"Connect a local theme dev server URL to this store.\n\nThe dev server should be running `numu-theme dev` (default port: 4321).\nThe backend probes the dev server to verify it's reachable, then stores\nthe URL in theme_settings.external_theme with mode=\"dev\" so the storefront\nknows to bypass caching and always re-fetch the bundle.\n\nUsed for the local development workflow:\n1. Developer runs `numu-theme dev` in their theme repo\n2. Developer pastes the URL (http://localhost:5173) into the dashboard\n3. Storefront loads from the dev URL, no caching\n4. Developer edits files → vite rebuilds → developer refreshes storefront","operationId":"connect_dev_server_api_v1_stores__store_id__themes_external_dev_mode_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectDevServerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ExternalThemeInfoResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/external/builds/{build_id}":{"get":{"tags":["Online store"],"summary":"Get Build Status","description":"Check the status of a theme build.","operationId":"get_build_status_api_v1_stores__store_id__themes_external_builds__build_id__get","parameters":[{"name":"build_id","in":"path","required":true,"schema":{"type":"string","title":"Build Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ThemeBuildStatusResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/external/rebuild":{"post":{"tags":["Online store"],"summary":"Rebuild External Theme","description":"Rebuild the current external theme using the stored source_repo URL.","operationId":"rebuild_external_theme_api_v1_stores__store_id__themes_external_rebuild_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RebuildExternalThemeRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ThemeBuildResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/external/validate":{"post":{"tags":["Online store"],"summary":"Validate External Theme","description":"Validate the bundle of the currently configured external theme.","operationId":"validate_external_theme_api_v1_stores__store_id__themes_external_validate_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ThemeValidationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v2/installed":{"get":{"tags":["Online store"],"summary":"List all theme installations for a store","description":"Return all installed themes for this store (active + inactive).","operationId":"list_installations_api_v1_stores__store_id__themes_v2_installed_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StoreInstalledThemesResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v2/install":{"post":{"tags":["Online store"],"summary":"Install a theme on the store","description":"Install a marketplace theme on this store.\n\nIf `version_id` is omitted, the latest version is installed.\nReturns 409 if the theme is already installed.","operationId":"install_theme_api_v1_stores__store_id__themes_v2_install_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__v1__schemas__tenant__theme_v2__InstallThemeRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StoreThemeInstallationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v2/{installation_id}":{"get":{"tags":["Online store"],"summary":"Get a specific installation","description":"Return the detail of a single installation.","operationId":"get_installation_api_v1_stores__store_id__themes_v2__installation_id__get","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"string","title":"Installation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StoreThemeInstallationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Online store"],"summary":"Rename a theme installation","description":"Set the merchant-facing label for an installation.\n\nMetadata-only — the live storefront is unaffected.","operationId":"rename_installation_api_v1_stores__store_id__themes_v2__installation_id__patch","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"string","title":"Installation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameThemeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StoreThemeInstallationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Online store"],"summary":"Uninstall a theme from the store","description":"Remove a theme installation from this store.\n\nReturns 400 if you try to uninstall the currently active theme.\nActivate another theme first, then uninstall this one.","operationId":"uninstall_theme_api_v1_stores__store_id__themes_v2__installation_id__delete","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"string","title":"Installation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v2/{installation_id}/duplicate":{"post":{"tags":["Online store"],"summary":"Duplicate a theme installation into a new draft copy","description":"Clone an installation (incl. its full customization) as a new,\ninactive copy the merchant can edit independently.","operationId":"duplicate_installation_api_v1_stores__store_id__themes_v2__installation_id__duplicate_post","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"string","title":"Installation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DuplicateThemeRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StoreThemeInstallationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v2/{installation_id}/export":{"get":{"tags":["Online store"],"summary":"Export an installation as a portable JSON document","description":"Return a self-describing JSON snapshot of the theme + customization.\n\nThe hub turns this into a downloadable ``.json`` file.","operationId":"export_installation_api_v1_stores__store_id__themes_v2__installation_id__export_get","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"string","title":"Installation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ThemeExportResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v2/{installation_id}/activate":{"post":{"tags":["Online store"],"summary":"Activate an installed theme","description":"Make the selected installation the active theme for this store.\n\nAlso denormalizes the active theme into `stores.theme_settings` for\nbackward compatibility with existing storefront code.","operationId":"activate_theme_api_v1_stores__store_id__themes_v2__installation_id__activate_post","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"string","title":"Installation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ActivateThemeResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v2/{installation_id}/customize":{"patch":{"tags":["Online store"],"summary":"Save draft customization (not yet live)","description":"Save draft customization for an installation.\n\nChanges are saved but NOT published — the live store is unaffected.\nUse the `/publish` endpoint to make them live.","operationId":"customize_draft_api_v1_stores__store_id__themes_v2__installation_id__customize_patch","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"string","title":"Installation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomizeDraftRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StoreThemeInstallationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v2/{installation_id}/publish":{"post":{"tags":["Online store"],"summary":"Publish draft customization (goes live)","description":"Promote the draft customization to live.\n\nCopies `draft_customization` → `customization` and triggers a\nbackward-compat write to `stores.theme_settings`.\nOnly allowed on the active installation.","operationId":"publish_customization_api_v1_stores__store_id__themes_v2__installation_id__publish_post","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"string","title":"Installation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_StoreThemeInstallationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v2/{installation_id}/preview":{"post":{"tags":["Online store"],"summary":"Generate a preview URL for an installation","description":"Generate a short-lived preview URL for the given installation.\n\nThe URL points to the Next.js storefront's `/api/preview?token=xxx`\nendpoint. Clicking it enables Draft Mode so the merchant can preview\ntheir draft_customization before publishing.\n\nToken TTL: 30 minutes.","operationId":"generate_preview_url_api_v1_stores__store_id__themes_v2__installation_id__preview_post","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"string","title":"Installation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/code/files":{"get":{"tags":["Online store"],"summary":"List the store's theme workspace files","operationId":"list_files_api_v1_stores__store_id__themes_code_files_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ThemeFileListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/code/files/{file_path}":{"get":{"tags":["Online store"],"summary":"Read one workspace file","operationId":"read_file_api_v1_stores__store_id__themes_code_files__file_path__get","parameters":[{"name":"file_path","in":"path","required":true,"schema":{"type":"string","title":"File Path"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ThemeFileContentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]},"put":{"tags":["Online store"],"summary":"Create or overwrite a workspace file","operationId":"write_file_api_v1_stores__store_id__themes_code_files__file_path__put","parameters":[{"name":"file_path","in":"path","required":true,"schema":{"type":"string","title":"File Path"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteThemeFileRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ThemeFileContentResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Online store"],"summary":"Delete a workspace file","operationId":"delete_file_api_v1_stores__store_id__themes_code_files__file_path__delete","parameters":[{"name":"file_path","in":"path","required":true,"schema":{"type":"string","title":"File Path"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/code/scaffold":{"post":{"tags":["Online store"],"summary":"Seed a buildable starter theme into the workspace","operationId":"scaffold_theme_api_v1_stores__store_id__themes_code_scaffold_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScaffoldThemeRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ScaffoldThemeResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/code/publish":{"post":{"tags":["Online store"],"summary":"Build & publish the code-editor workspace","description":"Run the workspace through the external-theme build pipeline.\n\nIdentical downstream to a GitHub BYOT build — only the source differs\n(``source=\"files\"`` materializes ``store_theme_files`` instead of cloning).\nReturns a build_id to poll at the existing\n``GET /themes/external/builds/{build_id}`` endpoint.","operationId":"publish_workspace_api_v1_stores__store_id__themes_code_publish_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ThemeBuildResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/editor/draft":{"get":{"tags":["Online store"],"summary":"Get Draft","description":"Get the current V3 draft for the active theme.\n\nReturns the draft as the response data and emits an HTTP `ETag`\nheader so the client can echo it on the next autosave (`If-Match`).\nMismatch on autosave → 409. This is the standard optimistic-\nconcurrency pattern; using a real header keeps the JSON payload\nbackwards compatible with older hub builds.","operationId":"get_draft_api_v1_stores__store_id__themes_v3_editor_draft_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/editor/autosave":{"put":{"tags":["Online store"],"summary":"Autosave Draft","description":"Auto-save V3 draft with Dual-Write to legacy columns.\n\nIdempotent if the payload is unchanged from the last draft.\nPydantic re-validates the payload (incl. external_theme URL allowlist)\nbefore any DB write.\n\nRejects oversized payloads with 413 (Payload Too Large) before the\nservice layer touches the DB. JSONB can technically hold ~1 GB, but\na customization that big means runaway preset duplication or embedded\ndata URLs and the autosave debouncer can't keep up.\n\nOptimistic concurrency: when the client sends `If-Match: <etag>`\n(the etag from the most recent /draft fetch or a previous\nautosave), we compare to the current store_theme.updated_at. On\nmismatch → 409 with the current etag + draft so the client can\nsurface \"another tab is editing; reload to continue\". When the\nrequest body carries `expected_etag`, that wins over the header\n(kept for clients that prefer body-only payloads).","operationId":"autosave_draft_api_v1_stores__store_id__themes_v3_editor_autosave_put","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutosaveDraftRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AutosaveDraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/editor/publish":{"post":{"tags":["Online store"],"summary":"Publish","description":"Publish V3 draft with Dual-Write to all columns.\n\nFreshness-safe ordering (the cache-staleness fix):\n  1. ``svc.publish`` persists AND commits the transaction, then confirms a\n     separate session can read the new payload (``verified``).\n  2. We invalidate the backend Redis caches (post-commit).\n  3. We revalidate the Next.js storefront tags (post-commit) and capture a\n     structured summary.\n  4. The response reports the revalidation outcome so the hub can show an\n     honest \"Live\" vs \"Saved, storefront refresh delayed\" state rather than\n     a misleading success.\n\nRevalidation is intentionally NOT fired before the commit — doing so let a\nracing storefront read re-cache the stale, pre-commit row.","operationId":"publish_api_v1_stores__store_id__themes_v3_editor_publish_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PublishResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/editor/versions":{"get":{"tags":["Online store"],"summary":"List Versions","description":"List version history for the store's theme customization.","operationId":"list_versions_api_v1_stores__store_id__themes_v3_editor_versions_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VersionListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/editor/versions/{version_id}":{"get":{"tags":["Online store"],"summary":"Get Version Payload","description":"Return a single version's payload — the snapshot the pre-publish /\nversion diff compares the current draft against. Without this, the editor's\ndiff fetch 404s and PrePublishDiffDialog can't compute a diff (which blocked\nPublish with a misleading \"0 changes\").","operationId":"get_version_payload_api_v1_stores__store_id__themes_v3_editor_versions__version_id__get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_VersionPayloadResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/editor/versions/{version_id}/restore":{"post":{"tags":["Online store"],"summary":"Restore Version","description":"Restore a previous version as the current draft.","operationId":"restore_version_api_v1_stores__store_id__themes_v3_editor_versions__version_id__restore_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AutosaveDraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/editor/discard":{"post":{"tags":["Online store"],"summary":"Discard Draft","description":"Discard V3 draft and revert to published state.","operationId":"discard_draft_api_v1_stores__store_id__themes_v3_editor_discard_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_DiscardDraftResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/editor/schemas":{"get":{"tags":["Online store"],"summary":"Get Schemas","description":"Get the active theme's section/block schemas.\n\nFor built-in themes: reads from the theme's settings_schema and\nsection_schemas. For BYOT themes: reads from the marketplace theme\nversion's schema columns.","operationId":"get_schemas_api_v1_stores__store_id__themes_v3_editor_schemas_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SchemaResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/editor/resolve":{"get":{"tags":["Online store"],"summary":"Resolve Theme","description":"Resolve the published theme settings using Dual-Read normalization.\n\nDistinct from `/draft`: this endpoint never returns draft data. It is\nintended for the storefront SDK to render the live theme. Returns V3\npublished data if present; otherwise normalizes V1/V2 published →\nV3 in memory.","operationId":"resolve_theme_api_v1_stores__store_id__themes_v3_editor_resolve_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/undo":{"get":{"tags":["Online store"],"summary":"List undo entries","description":"Newest-first; capped at MAX_UNDO_ENTRIES.\n\nThe customizer rehydrates its undo stack from this list on mount\nso closing the tab and re-opening preserves history.","operationId":"list_undo_entries","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"theme_id","in":"query","required":true,"schema":{"type":"string","title":"Theme Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_UndoEntryResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Online store"],"summary":"Append an undo entry","description":"Append + prune in a single transaction so the stack never\ngrows past MAX_UNDO_ENTRIES.\n\nPruning is by created_at desc — drop everything past row 50.","operationId":"append_undo_entry","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UndoEntryRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_UndoEntryResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Online store"],"summary":"Clear undo stack","description":"On publish, the customizer can clear its undo stack — published\nstate becomes the new baseline.","operationId":"clear_undo_stack","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"theme_id","in":"query","required":true,"schema":{"type":"string","title":"Theme Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_str__int__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/themes/v3/undo/{entry_id}":{"delete":{"tags":["Online store"],"summary":"Remove an undo entry (after applying)","description":"When the client undoes an action and applies the inverse, it\ndeletes that entry so re-mounting doesn't replay the same undo\nover and over.","operationId":"delete_undo_entry","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entry Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_str__str__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"themes:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/apps/catalog":{"get":{"tags":["Settings & money"],"summary":"List installable apps","operationId":"list_app_catalog","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_AppCatalogEntry__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/apps":{"get":{"tags":["Settings & money"],"summary":"List installs for this store","operationId":"list_app_installations","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_AppInstallation__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/apps/{slug}/install":{"post":{"tags":["Settings & money"],"summary":"Install an app","description":"Idempotent: re-installing an already-installed app simply\nre-enables it (keeps existing settings).","operationId":"install_app","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AppInstallation_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/apps/{slug}/settings":{"put":{"tags":["Settings & money"],"summary":"Update app settings","description":"Update per-store app settings.\n\nMERGES by default. A full replace loses writes whenever two tabs, or a\nsettings form and an onboarding step, save overlapping keys — the second\nsave silently drops whatever the first added, with no ETag and no version\nhistory to notice it. Send `replace: true` to deliberately overwrite the\nwhole blob (the only honest way to REMOVE a key).\n\nBusts both caches on the way out. Doing neither is what this endpoint did\nbefore: app settings ride the store payload, which the API caches in Redis\nfor 60s and the storefront caches again under `store-{subdomain}`, so a\nmerchant changing a swatch shape saw nothing change and tried again.","operationId":"update_app_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__v1__routes__stores__apps__UpdateSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AppInstallation_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/apps/{slug}/disable":{"post":{"tags":["Settings & money"],"summary":"Disable app","operationId":"disable_app","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AppInstallation_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/apps/{slug}/enable":{"post":{"tags":["Settings & money"],"summary":"Enable app","operationId":"enable_app","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AppInstallation_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/apps/{slug}":{"delete":{"tags":["Settings & money"],"summary":"Uninstall app","operationId":"uninstall_app","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_str__str__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/apps/{slug}/open-url":{"get":{"tags":["Settings & money"],"summary":"Signed link to a Partner App's own admin","description":"``app_url?store_id&locale&timestamp&hmac``, signed with the app's\nclient secret (plan 03 § 6.3). It proves the merchant came from the hub;\nit is not a login, and the app must reject a timestamp older than 5 min.","operationId":"app_open_url","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"locale","in":"query","required":false,"schema":{"type":"string","default":"ar","title":"Locale"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_str__str__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/apps/{slug}/subscription":{"get":{"tags":["Settings & money"],"summary":"The store's subscription to a paid app","operationId":"get_app_subscription","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_str__Any__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Settings & money"],"summary":"Pay for a paid app from the store's wallet","description":"Charges one period to the NUMU wallet, now. Already covered: nothing is\ncharged (and a pending cancellation is withdrawn). 402 when the wallet\ncan't cover it; top it up (InstaPay, Vodafone Cash or card) and retry.","operationId":"subscribe_app","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_str__Any__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Settings & money"],"summary":"Cancel a paid app at the end of the paid period","operationId":"cancel_app_subscription","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_str__Any__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"settings:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/signup-config":{"get":{"tags":["Marketing"],"summary":"Get Meta Embedded Signup config","description":"Return the Meta App ID and config needed for the embedded signup JS SDK.","operationId":"get_whatsapp_signup_config","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_EmbeddedSignupConfig_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/complete-signup":{"post":{"tags":["Marketing"],"summary":"Complete WhatsApp embedded signup","description":"Exchange the code from Meta's embedded signup for permanent credentials.\n\n1. Exchange the one-time code for the business integration token\n2. Validate the token and its granted WhatsApp accounts\n3. Validate and register the selected phone number\n4. Subscribe the WABA to webhooks\n5. Store the account credentials encrypted","operationId":"complete_whatsapp_signup","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddedSignupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_EmbeddedSignupResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/disconnect":{"delete":{"tags":["Marketing"],"summary":"Disconnect WhatsApp Business","description":"Revoke per-store WhatsApp credentials, fall back to shared NUMU number.","operationId":"disconnect_whatsapp","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/status":{"get":{"tags":["Marketing"],"summary":"Get WhatsApp connection status","description":"Return connection status including phone number and quality rating.","operationId":"get_whatsapp_status","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_WhatsAppConnectionStatus_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/notifications":{"get":{"tags":["Marketing"],"summary":"Get WhatsApp notification settings","description":"Get per-notification-type toggles.\n\nReads from ``store.settings.whatsapp_notifications`` — the same path\nthe backend order-lifecycle handlers consult. The legacy path\n``store.settings.whatsapp.notification_toggles`` is no longer\nread or written; backfill migration 20260729_010000 seeded the\ncanonical path for existing stores, and create_store.py seeds it\nfor new stores.","operationId":"get_whatsapp_notifications","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_NotificationSettings_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Marketing"],"summary":"Update WhatsApp notification settings","description":"Toggle individual notification types on/off.\n\nWrites to ``store.settings.whatsapp_notifications.{key}`` — the same\npath the backend handlers read at send-time. Partial update: only\nkeys present (non-None) in the request body are written.","operationId":"update_whatsapp_notifications","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateNotificationSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_NotificationSettings_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/analytics":{"get":{"tags":["Marketing"],"summary":"Get WhatsApp analytics","description":"Aggregated message stats for the store.","operationId":"get_whatsapp_analytics","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"period","in":"query","required":false,"schema":{"type":"string","pattern":"^(7d|30d|90d)$","default":"30d","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_WhatsAppAnalytics_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/messages":{"get":{"tags":["Marketing"],"summary":"List recent WhatsApp messages","description":"Recent sent/received WhatsApp messages from ``message_logs``.\n\nThis is the full record of what actually went out (and came in),\nincluding automated order-lifecycle notifications that never created\na conversation thread. Ordered newest-first.","operationId":"list_whatsapp_messages","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(inbound|outbound)$"},{"type":"null"}],"description":"Filter by message direction; omit for both.","title":"Direction"},"description":"Filter by message direction; omit for both."},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_WhatsAppMessageLogList_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/byo/connect":{"post":{"tags":["Marketing"],"summary":"Connect merchant's own Meta WABA (BYO)","description":"3-step validate + encrypt + persist + reset toggles (FR-019..FR-025).","operationId":"connect_byo_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BYOConnectRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/byo/disconnect":{"delete":{"tags":["Marketing"],"summary":"Disconnect BYO Meta WABA and revert to platform-managed","description":"Reverts mode to platform_managed; restores prior toggle snapshot.","operationId":"disconnect_byo_credentials","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/byo/status":{"get":{"tags":["Marketing"],"summary":"Get WhatsApp connection status (BYO-aware)","description":"Returns the WhatsAppStatus shape per the BYO contract. Distinct\nfrom the legacy /status endpoint which uses the older\nWhatsAppConnectionStatus schema kept for backward compatibility.","operationId":"get_whatsapp_status_v2","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/settings":{"patch":{"tags":["Marketing"],"summary":"Update store-level WhatsApp preferences (e.g. message language)","description":"Partial update of ``store.settings.whatsapp.*`` store-level prefs.\n\nCurrently exposes ``message_language`` (auto | ar | en) — the language\nthe automated order-lifecycle notifications are sent in. Honored at\nsend time by ``whatsapp_notification_handler._resolve_send_context``;\n'auto' follows ``store.default_language``.","operationId":"update_whatsapp_settings","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/byo/notifications":{"patch":{"tags":["Marketing"],"summary":"Update notification toggles (BYO-path)","description":"Partial update of ``store.settings.whatsapp_notifications.*``.\n\nDistinct from the legacy PATCH /notifications endpoint which writes\nto a different settings path (``store.settings.whatsapp.notification_toggles``)\nfor backward compatibility with the embedded-signup UI. This endpoint\nwrites to the canonical path that the order-event handlers + the\nsend guard read from (FR-019a).","operationId":"update_whatsapp_notifications_v2","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/access":{"get":{"tags":["Marketing"],"summary":"Get the store's WhatsApp access-gate state","description":"Return whether this store is allowed to use WhatsApp (and where in the\nrequest lifecycle it is). Drives the merchant-hub gate above the connection\nUI. ``status='none'`` means no request has been made yet.","operationId":"get_whatsapp_access","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppAccessState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/access/pay":{"post":{"tags":["Marketing"],"summary":"Open (or resume) the bill for this store's WhatsApp access","description":"Renew at the price an admin set, without waiting on the admin.\n\nThe receipt is uploaded to ``/billing/instapay-intents/{payment_intent_id}/proof``\nlike any subscription payment; verifying it extends access by one period.","operationId":"pay_whatsapp_access","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppAccessState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/access/request":{"post":{"tags":["Marketing"],"summary":"Request WhatsApp access for this store (merchant)","description":"Submit (or re-submit after a rejection) a request for WhatsApp access.\n\nOne row per store: a first request inserts a PENDING row; a re-request on a\nREJECTED store flips the same row back to PENDING and clears the prior\nreview. Requesting while already PENDING / APPROVED / DISABLED is a 409 —\nthe merchant can't self-serve past those (admin drives them).","operationId":"request_whatsapp_access","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppAccessRequestBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppAccessState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/templates":{"get":{"tags":["Marketing"],"summary":"List WhatsApp templates","operationId":"list_whatsapp_templates","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TemplateListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Marketing"],"summary":"Create WhatsApp template","description":"Submit a custom WhatsApp template to Meta for approval.\n\nPhase 1 (FR-026 / EDIT-C / analyze HIGH-3): **BYO-only**.\nPlatform-managed stores cannot create custom templates — they share\nNUMU's single Meta WABA, and per-merchant custom templates against\na shared WABA cause cross-store visibility + approval-budget\nexhaustion. Platform-managed stores rely on the system-seeded\ncanonical templates (FR-030); custom templates require BYO.\n\nBehavior:\n- Store mode = platform_managed → 403 ``template_submission_requires_byo``.\n- Local duplicate (name + language) → 409.\n- Meta synchronous rejection → 422 with the sanitized Meta error\n  body (TASK-SEC-009 — fbtrace_id never surfaced); no local row.\n- Meta accept → 201 with the persisted PENDING row.","operationId":"create_whatsapp_template","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TemplateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/templates/{template_id}":{"delete":{"tags":["Marketing"],"summary":"Delete WhatsApp template","operationId":"delete_whatsapp_template","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_dict_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/templates/sync":{"post":{"tags":["Marketing"],"summary":"Sync template statuses from Meta","description":"Fetch latest template statuses from Meta and update local DB.","operationId":"sync_whatsapp_templates","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_TemplateListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/email-templates/events":{"get":{"tags":["Marketing"],"summary":"List registered email events","description":"Return the registry of customer-facing email events.\n\nPure registry lookup — no DB query. The registry is the single\nsource of truth for event types, declared variables, sample data,\nand the default subject in each language.","operationId":"list_email_events","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_list_EmailEventResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/email-templates/events/{event_type}/default":{"get":{"tags":["Marketing"],"summary":"Get registry default template for an event/language","description":"Return the registry-default subject + HTML body for the given event.","operationId":"get_default_email_template","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"event_type","in":"path","required":true,"schema":{"type":"string","maxLength":50,"description":"Event identifier","title":"Event Type"},"description":"Event identifier"},{"name":"language","in":"query","required":false,"schema":{"enum":["ar","en"],"type":"string","description":"Language","default":"ar","title":"Language"},"description":"Language"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_DefaultTemplateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/email-templates/":{"get":{"tags":["Marketing"],"summary":"List merchant email templates","description":"List merchant-customized templates for a store, with optional filters.","operationId":"list_email_templates","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Event Type"}},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"enum":["en","ar"],"type":"string"},{"type":"null"}],"title":"Language"}},{"name":"is_enabled","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Enabled"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PaginatedListResponse_EmailTemplateResponse__"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Marketing"],"summary":"Create email template override","description":"Create a new merchant-customized email template.","operationId":"create_email_template","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEmailTemplateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_EmailTemplateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/email-templates/{template_id}":{"get":{"tags":["Marketing"],"summary":"Get email template by ID","description":"Fetch a single email template by id.","operationId":"get_email_template","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template ID","title":"Template Id"},"description":"Template ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_EmailTemplateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"put":{"tags":["Marketing"],"summary":"Update email template","description":"Update an existing email template — only provided fields are touched.","operationId":"update_email_template","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template ID","title":"Template Id"},"description":"Template ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEmailTemplateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_EmailTemplateResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Marketing"],"summary":"Delete email template","description":"Delete a merchant-customized email template.","operationId":"delete_email_template","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template ID","title":"Template Id"},"description":"Template ID"}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/email-templates/preview-draft":{"post":{"tags":["Marketing"],"summary":"Preview an unsaved email-template draft","description":"Render the in-flight editor buffer without persisting anything.\n\nThe merchant editor calls this on every debounced keystroke so the\npreview iframe always reflects their current draft (whether they're\ncreating a new template or editing an existing one with unsaved\nchanges). Mirrors the rendering logic of the saved-template preview\nendpoint — same Jinja sandbox, same variable whitelist — minus the\nDB lookup.","operationId":"preview_email_template_draft","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewDraftRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PreviewEmailResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/email-templates/{template_id}/preview":{"post":{"tags":["Marketing"],"summary":"Preview a saved email template","description":"Render the saved template *as is*, even if it's currently disabled.\n\nUnlike :class:`EmailTemplateRenderer.render` (which uses\n``get_for_send`` and only ever sees enabled rows), preview must show\nthe merchant their draft. We render directly in the same sandbox the\nruntime renderer uses, with the same variable whitelist applied.","operationId":"preview_email_template","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template ID","title":"Template Id"},"description":"Template ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewEmailRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_PreviewEmailResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/email-templates/{template_id}/send-test":{"post":{"tags":["Marketing"],"summary":"Send a test email rendered from this template","description":"Send a fully rendered test email to the requesting merchant.\n\nThe use case enforces that ``recipient`` matches the requesting\nuser's own email address and applies a 5/min rate limit per\n``(user_id, template_id)``.","operationId":"send_test_email_template","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Template ID","title":"Template Id"},"description":"Template ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTestEmailRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_SendTestEmailResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/conversations":{"get":{"tags":["Marketing"],"summary":"List conversations (inbox)","operationId":"list_whatsapp_conversations","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unread Only"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ConversationListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/conversations/unread-count":{"get":{"tags":["Marketing"],"summary":"Get unread conversation count","operationId":"get_whatsapp_unread_count","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_UnreadCountResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/conversations/{conversation_id}/messages":{"get":{"tags":["Marketing"],"summary":"Get messages for a conversation","operationId":"get_whatsapp_messages","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MessageListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/conversations/{conversation_id}/send":{"post":{"tags":["Marketing"],"summary":"Send a message in a conversation","description":"Send a reply. Freeform text within 24h window, template-only outside.","operationId":"send_whatsapp_message","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_MessageBubble_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/conversations/{conversation_id}":{"patch":{"tags":["Marketing"],"summary":"Update conversation (mark read, archive, assign)","operationId":"update_whatsapp_conversation","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_ConversationSummary_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/campaigns":{"get":{"tags":["Marketing"],"summary":"List campaigns","operationId":"list_whatsapp_campaigns","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_CampaignListResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Marketing"],"summary":"Create campaign draft","operationId":"create_whatsapp_campaign","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_CampaignResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/campaigns/{campaign_id}":{"get":{"tags":["Marketing"],"summary":"Get campaign details","operationId":"get_whatsapp_campaign","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_CampaignResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"patch":{"tags":["Marketing"],"summary":"Update campaign draft","operationId":"update_whatsapp_campaign","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_CampaignResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/campaigns/{campaign_id}/send":{"post":{"tags":["Marketing"],"summary":"Send campaign now","description":"Resolve audience, create recipients, and queue for sending.","operationId":"send_whatsapp_campaign","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_CampaignResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/campaigns/{campaign_id}/schedule":{"post":{"tags":["Marketing"],"summary":"Schedule campaign","operationId":"schedule_whatsapp_campaign","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignScheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_CampaignResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/campaigns/{campaign_id}/cancel":{"post":{"tags":["Marketing"],"summary":"Cancel scheduled campaign","operationId":"cancel_whatsapp_campaign","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__api__responses__base__SuccessResponse_CampaignResponse___2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/campaigns/{campaign_id}/recipients":{"get":{"tags":["Marketing"],"summary":"List campaign recipients","operationId":"list_campaign_recipients","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Campaign Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_CampaignRecipientsListResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/campaigns/estimate-audience":{"post":{"tags":["Marketing"],"summary":"Estimate audience size","operationId":"estimate_whatsapp_audience","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AudienceFilter"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse_AudienceEstimate_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/opt-ins":{"get":{"tags":["Marketing"],"summary":"List Opt Ins","operationId":"list_opt_ins_api_v1_stores__store_id__whatsapp_opt_ins_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by E.164 phone.","title":"Phone"},"description":"Filter by E.164 phone."},{"name":"active_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Active Only"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OptInRow"},"title":"Response List Opt Ins Api V1 Stores  Store Id  Whatsapp Opt Ins Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Marketing"],"summary":"Create Opt In","description":"Merchant-side opt-in creation. Used by import flows / API integrations.\n\nPhone is canonicalized inside the use-case; 422 on parse failure.\nIdempotent: if an active opt-in already exists for (store, phone) the\nexisting row is returned with 201 (no new row written).","operationId":"create_opt_in_api_v1_stores__store_id__whatsapp_opt_ins_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptInCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptInRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/opt-ins/revoke":{"post":{"tags":["Marketing"],"summary":"Revoke Opt In","description":"Merchant-initiated opt-out for a customer's WhatsApp messaging.\n\nReturns 404 when no active opt-in row exists for (store, phone).","operationId":"revoke_opt_in_api_v1_stores__store_id__whatsapp_opt_ins_revoke_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptInRevoke"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptInRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/scheduled-sends":{"get":{"tags":["Marketing"],"summary":"List Scheduled Sends","operationId":"list_scheduled_sends_api_v1_stores__store_id__whatsapp_scheduled_sends_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to one of pending / sent / cancelled / skipped / failed.","title":"Status"},"description":"Filter to one of pending / sent / cancelled / skipped / failed."},{"name":"related_order_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Related Order Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledSend"},"title":"Response List Scheduled Sends Api V1 Stores  Store Id  Whatsapp Scheduled Sends Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"post":{"tags":["Marketing"],"summary":"Create Scheduled Send","operationId":"create_scheduled_send_api_v1_stores__store_id__whatsapp_scheduled_sends_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledSendCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledSend"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/scheduled-sends/{send_id}":{"get":{"tags":["Marketing"],"summary":"Get Scheduled Send","operationId":"get_scheduled_send_api_v1_stores__store_id__whatsapp_scheduled_sends__send_id__get","parameters":[{"name":"send_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Send Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledSend"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]},"delete":{"tags":["Marketing"],"summary":"Cancel Scheduled Send","description":"Cancel a pending row. 200 on success, 409 if the row is not\npending (already sent / cancelled / failed / skipped).","operationId":"cancel_scheduled_send_api_v1_stores__store_id__whatsapp_scheduled_sends__send_id__delete","parameters":[{"name":"send_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Send Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/dead-letters":{"get":{"tags":["Marketing"],"summary":"List Dead Letters","operationId":"list_dead_letters_api_v1_stores__store_id__whatsapp_dead_letters_get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"originating_context","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Originating Context"}},{"name":"replay_state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replay State"}},{"name":"error_classification","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Classification"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeadLetter"},"title":"Response List Dead Letters Api V1 Stores  Store Id  Whatsapp Dead Letters Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/dead-letters/{dl_id}":{"get":{"tags":["Marketing"],"summary":"Get Dead Letter","operationId":"get_dead_letter_api_v1_stores__store_id__whatsapp_dead_letters__dl_id__get","parameters":[{"name":"dl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dl Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeadLetter"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/dead-letters/{dl_id}/replay":{"post":{"tags":["Marketing"],"summary":"Replay Dead Letter","description":"Replay a dead-letter row.\n\n202 on accept (row transitions to ``replaying`` and the underlying\nCelery task is re-enqueued). 409 if the row is already in\n``replaying`` / ``replayed_success`` / ``replayed_failed`` — the\ndouble-send guard refuses to replay a row twice.\n\nIf the original send actually succeeded after the DLQ row was\nwritten (e.g., a delivery webhook arrived late and updated\n``message_logs``), the use-case auto-marks the row\n``replayed_success`` without re-issuing the send.","operationId":"replay_dead_letter_api_v1_stores__store_id__whatsapp_dead_letters__dl_id__replay_post","parameters":[{"name":"dl_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dl Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Replay Dead Letter Api V1 Stores  Store Id  Whatsapp Dead Letters  Dl Id  Replay Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/channels/connect":{"post":{"tags":["Marketing"],"summary":"Connect Meta","description":"Start Meta OAuth flow - returns authorization URL.","operationId":"connect_meta_api_v1_stores__store_id__channels_connect_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectMetaDTO"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/channels/callback":{"post":{"tags":["Marketing"],"summary":"Meta Callback","description":"Exchange the OAuth code and list the Pages available to connect.\n\nNothing is connected yet — the merchant picks which assets they want,\nthen POSTs them to /connect-assets.","operationId":"meta_callback_api_v1_stores__store_id__channels_callback_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectMetaCallbackDTO"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/channels/connect-assets":{"post":{"tags":["Marketing"],"summary":"Connect Assets","description":"Connect the Pages (and their linked Instagram accounts) chosen.","operationId":"connect_assets_api_v1_stores__store_id__channels_connect_assets_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectAssetsDTO"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/channels/{connection_id}/sync-history":{"post":{"tags":["Marketing"],"summary":"Sync History","description":"Re-import past conversations for a connection.\n\nRuns automatically after connecting; this endpoint is the manual\nre-run (history deeper than the default window, or after a gap).","operationId":"sync_history_api_v1_stores__store_id__channels__connection_id__sync_history_post","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Connection Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"since_days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":90,"title":"Since Days"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/channels/{connection_id}":{"delete":{"tags":["Marketing"],"summary":"Disconnect Channel","description":"Disconnect a channel connection.","operationId":"disconnect_channel_api_v1_stores__store_id__channels__connection_id__delete","parameters":[{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Connection Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/channels/":{"get":{"tags":["Marketing"],"summary":"List Connections","description":"List all channel connections for a store.","operationId":"list_connections_api_v1_stores__store_id__channels__get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by channel type","title":"Channel"},"description":"Filter by channel type"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/threads/":{"get":{"tags":["Marketing"],"summary":"List Threads","description":"List message threads for a store.\n\nGET /stores/{store_id}/inbox/threads\nQuery: ?channel=&status=&unread_only=&search=&cursor=&limit=50","operationId":"list_threads_api_v1_stores__store_id__threads__get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by channel (facebook|instagram|whatsapp)","title":"Channel"},"description":"Filter by channel (facebook|instagram|whatsapp)"},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status (open|resolved|spam)","title":"Status Filter"},"description":"Filter by status (open|resolved|spam)"},{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only threads with unread","default":false,"title":"Unread Only"},"description":"Only threads with unread"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search participant name/phone","title":"Search"},"description":"Search participant name/phone"},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max results","default":50,"title":"Limit"},"description":"Max results"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/threads/{thread_id}":{"get":{"tags":["Marketing"],"summary":"Get Thread","description":"Get a specific thread by ID.\n\nGET /stores/{store_id}/inbox/threads/{thread_id}","operationId":"get_thread_api_v1_stores__store_id__threads__thread_id__get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/threads/{thread_id}/read":{"post":{"tags":["Marketing"],"summary":"Mark Read","description":"Mark thread as read.\n\nPOST /stores/{store_id}/inbox/threads/{thread_id}/read\nPATCH body: { \"mark_read\": true }","operationId":"mark_read_api_v1_stores__store_id__threads__thread_id__read_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/threads/{thread_id}/resolve":{"post":{"tags":["Marketing"],"summary":"Resolve Thread","description":"Mark thread as resolved/closed.\n\nPOST /stores/{store_id}/inbox/threads/{thread_id}/resolve\nPATCH body: { \"status\": \"resolved\" }","operationId":"resolve_thread_api_v1_stores__store_id__threads__thread_id__resolve_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/threads/{thread_id}/customer":{"post":{"tags":["Marketing"],"summary":"Link Customer","description":"Link this conversation to a customer record.\n\nDeliberate and reversible: Meta gives us no phone number, and guessing\nfrom a display name would merge two different people into one customer\nhistory. An agent confirms who they're talking to, then links.","operationId":"link_customer_api_v1_stores__store_id__threads__thread_id__customer_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkCustomerDTO"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]},"delete":{"tags":["Marketing"],"summary":"Unlink Customer","description":"Remove the customer link from this conversation.","operationId":"unlink_customer_api_v1_stores__store_id__threads__thread_id__customer_delete","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/threads/{thread_id}/messages/":{"get":{"tags":["Marketing"],"summary":"List Messages","description":"List messages in a thread.\n\nGET /stores/{store_id}/inbox/threads/{thread_id}/messages\nQuery: ?cursor=&limit=50","operationId":"list_messages_api_v1_stores__store_id__threads__thread_id__messages__get","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}},{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Pagination cursor","title":"Cursor"},"description":"Pagination cursor"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/threads/{thread_id}/messages/send":{"post":{"tags":["Marketing"],"summary":"Send Message","description":"Send a message to a thread.\n\nPOST /stores/{store_id}/threads/{thread_id}/messages/send\nBody: { \"type\", \"text\", ... } — thread id comes from the path.","operationId":"send_message_api_v1_stores__store_id__threads__thread_id__messages_send_post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageBodyDTO"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]}},"/api/v1/stores/{store_id}/whatsapp/":{"post":{"tags":["Marketing"],"summary":"Create Template","description":"Create a WhatsApp template.\n\nPOST /stores/{store_id}/channels/whatsapp/templates\nBody: { \"name\", \"category\", \"language\", \"components\": [...] }","operationId":"create_template_api_v1_stores__store_id__whatsapp__post","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateDTO"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:write","security":[{"bearerAuth":[]}]},"get":{"tags":["Marketing"],"summary":"List Templates","description":"List WhatsApp templates for a connection.\n\nGET /stores/{store_id}/channels/whatsapp/templates","operationId":"list_templates_api_v1_stores__store_id__whatsapp__get","parameters":[{"name":"store_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Store Id"}},{"name":"connection_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Connection Id"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status Filter"},"description":"Filter by status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-numu-scope":"marketing:read","security":[{"bearerAuth":[]}]}}},"components":{"schemas":{"AbandonedCheckoutLineItem":{"properties":{"product_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Product Id"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"variant_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Variant Id"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"quantity":{"type":"integer","title":"Quantity","default":1},"unit_price":{"type":"integer","title":"Unit Price","default":0},"total_price":{"type":"integer","title":"Total Price","default":0},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"}},"type":"object","title":"AbandonedCheckoutLineItem","description":"Line item snapshot stored on an abandoned checkout."},"AbandonedCheckoutListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AbandonedCheckoutResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"total_pages":{"type":"integer","title":"Total Pages"}},"type":"object","required":["items","total","page","page_size","total_pages"],"title":"AbandonedCheckoutListResponse","description":"Paginated abandoned-checkout feed."},"AbandonedCheckoutResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"store_id":{"type":"string","format":"uuid","title":"Store Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"line_items":{"items":{"$ref":"#/components/schemas/AbandonedCheckoutLineItem"},"type":"array","title":"Line Items"},"shipping_address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Shipping Address"},"subtotal":{"type":"integer","title":"Subtotal"},"shipping_cost":{"type":"integer","title":"Shipping Cost"},"tax_amount":{"type":"integer","title":"Tax Amount"},"discount_amount":{"type":"integer","title":"Discount Amount"},"total":{"type":"integer","title":"Total"},"currency":{"type":"string","title":"Currency"},"coupon_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coupon Code"},"utm_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Source"},"utm_medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Medium"},"utm_campaign":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Campaign"},"last_activity_at":{"type":"string","format":"date-time","title":"Last Activity At"},"abandoned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Abandoned At"},"recovered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Recovered At"},"recovery_email_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Recovery Email Sent At"},"recovered_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Recovered Order Id"},"item_count":{"type":"integer","title":"Item Count","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"cart_started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cart Started At"}},"type":"object","required":["id","store_id","subtotal","shipping_cost","tax_amount","discount_amount","total","currency","last_activity_at","created_at","updated_at"],"title":"AbandonedCheckoutResponse","description":"Single abandoned checkout entry."},"AbandonedCheckoutSummaryResponse":{"properties":{"open_count":{"type":"integer","title":"Open Count"},"open_value_cents":{"type":"integer","title":"Open Value Cents"},"recovered_count":{"type":"integer","title":"Recovered Count"},"recovered_value_cents":{"type":"integer","title":"Recovered Value Cents"},"reminders_sent":{"type":"integer","title":"Reminders Sent"},"payback_pct":{"type":"number","title":"Payback Pct"},"currency":{"type":"string","title":"Currency"}},"type":"object","required":["open_count","open_value_cents","recovered_count","recovered_value_cents","reminders_sent","payback_pct","currency"],"title":"AbandonedCheckoutSummaryResponse","description":"Analytics strip on the hub's Abandoned carts page."},"AbcClassSummary":{"properties":{"count":{"type":"integer","title":"Count"},"revenue_cents":{"type":"integer","title":"Revenue Cents"},"revenue_share_pct":{"type":"number","title":"Revenue Share Pct"}},"type":"object","required":["count","revenue_cents","revenue_share_pct"],"title":"AbcClassSummary"},"AbcProductItem":{"properties":{"product_id":{"type":"string","title":"Product Id"},"name":{"type":"string","title":"Name"},"abc_class":{"type":"string","title":"Abc Class"},"revenue_cents":{"type":"integer","title":"Revenue Cents"},"revenue_share_pct":{"type":"number","title":"Revenue Share Pct"},"sell_through_pct":{"type":"number","title":"Sell Through Pct"}},"type":"object","required":["product_id","name","abc_class","revenue_cents","revenue_share_pct","sell_through_pct"],"title":"AbcProductItem"},"ActivateThemeResponse":{"properties":{"activated":{"type":"boolean","title":"Activated"},"installation":{"$ref":"#/components/schemas/StoreThemeInstallationResponse"},"message":{"type":"string","title":"Message"}},"type":"object","required":["activated","installation","message"],"title":"ActivateThemeResponse","description":"Response after activating a theme."},"AnalyticsEraseResponse":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"funnel_events_deleted":{"type":"integer","title":"Funnel Events Deleted"},"note":{"type":"string","title":"Note"}},"type":"object","required":["customer_id","funnel_events_deleted","note"],"title":"AnalyticsEraseResponse","description":"Result of a DSAR analytics erase request."},"AnalyticsTopProductResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"quantity_sold":{"type":"integer","title":"Quantity Sold"},"revenue":{"type":"integer","title":"Revenue"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["id","name","sku","quantity_sold","revenue","percentage"],"title":"AnalyticsTopProductResponse","description":"Top product by sales (analytics view with percentage)."},"AnnotationItem":{"properties":{"date":{"type":"string","title":"Date"},"iso_date":{"type":"string","title":"Iso Date"},"type":{"type":"string","title":"Type"},"label":{"type":"string","title":"Label"}},"type":"object","required":["date","iso_date","type","label"],"title":"AnnotationItem"},"AnnotationsResponse":{"properties":{"annotations":{"items":{"$ref":"#/components/schemas/AnnotationItem"},"type":"array","title":"Annotations"}},"type":"object","required":["annotations"],"title":"AnnotationsResponse"},"AnnouncementBarContent":{"properties":{"surface":{"type":"string","const":"announcement_bar","title":"Surface","default":"announcement_bar"},"background":{"type":"string","title":"Background","default":"#000000"},"text_color":{"type":"string","title":"Text Color","default":"#FFFFFF"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"},"dismissible":{"type":"boolean","title":"Dismissible","default":true},"link_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Link Url"},"background_gradient_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Background Gradient To"},"font_size":{"type":"string","enum":["sm","md","lg"],"title":"Font Size","default":"md"},"text_align":{"type":"string","enum":["start","center","end"],"title":"Text Align","default":"center"},"animation":{"type":"string","enum":["none","pulse","marquee"],"title":"Animation","default":"none"},"auto_apply_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Auto Apply Code"}},"additionalProperties":false,"type":"object","title":"AnnouncementBarContent","description":"Top-of-page banner config."},"ApiKeyInfoResponse":{"properties":{"token_name":{"type":"string","title":"Token Name"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"store_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Store Id"},"store_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Store Name"},"subdomain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subdomain"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"default_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Language"},"tenant_id":{"type":"string","title":"Tenant Id"},"app_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Slug"}},"type":"object","required":["token_name","scopes","store_id","store_name","subdomain","currency","default_language","tenant_id"],"title":"ApiKeyInfoResponse","description":"Identity of the calling personal access token and its store binding.\n\nMachine clients (the NUMU MCP server) call this once per session to learn\nwhich store they operate on and which scopes they hold — so individual\ntools never need a store_id parameter."},"AppCatalogEntry":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"},"version":{"type":"string","title":"Version"},"blocks":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Blocks","default":[]},"listing":{"$ref":"#/components/schemas/AppListing","default":{"screenshots":[],"highlights":[],"locales":{},"app_locales":{},"features":[],"languages":[]}},"connect":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Connect"}},"type":"object","required":["slug","name","version"],"title":"AppCatalogEntry"},"AppInstallation":{"properties":{"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"icon_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon Url"},"version":{"type":"string","title":"Version"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"settings":{"additionalProperties":true,"type":"object","title":"Settings"},"blocks":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Blocks","default":[]},"settings_schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Settings Schema","default":[]},"granted_scopes":{"items":{"type":"string"},"type":"array","title":"Granted Scopes","default":[]},"install_status":{"type":"string","title":"Install Status","default":"active"},"missing_scopes":{"items":{"type":"string"},"type":"array","title":"Missing Scopes","default":[]},"listing":{"$ref":"#/components/schemas/AppListing","default":{"screenshots":[],"highlights":[],"locales":{},"app_locales":{},"features":[],"languages":[]}},"app_status":{"type":"string","title":"App Status","default":"published"},"is_live":{"type":"boolean","title":"Is Live","default":true}},"type":"object","required":["slug","name","version","is_enabled","settings"],"title":"AppInstallation"},"AppListing":{"properties":{"tagline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tagline"},"developer":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Developer"},"lockup_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lockup Url"},"screenshots":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Screenshots","default":[]},"highlights":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Highlights","default":[]},"locales":{"additionalProperties":true,"type":"object","title":"Locales","default":{}},"app_locales":{"additionalProperties":true,"type":"object","title":"App Locales","default":{}},"features":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Features","default":[]},"pricing":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Pricing"},"languages":{"items":{"type":"string"},"type":"array","title":"Languages","default":[]},"compatibility":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Compatibility"}},"type":"object","title":"AppListing","description":"Everything the merchant-facing app page shows about an app.\n\nRead straight off the manifest, so a THIRD-PARTY app gets the same detail\npage as a first-party one by filling the same keys — the hub renders what\nis present and omits what is not, rather than special-casing any app."},"ApplyStatusRequest":{"properties":{"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","minItems":1,"title":"Rows"}},"type":"object","required":["rows"],"title":"ApplyStatusRequest","description":"Rows the merchant confirmed after seeing the preview."},"ApproveReturnRequest":{"properties":{"merchant_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Merchant Note"}},"type":"object","title":"ApproveReturnRequest"},"AssetFocalPoint":{"properties":{"x":{"type":"number","maximum":1.0,"minimum":0.0,"title":"X"},"y":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Y"}},"type":"object","required":["x","y"],"title":"AssetFocalPoint","description":"Normalized focal point (0..1) — the subject's position in the image."},"AssetTransform":{"properties":{"v":{"type":"integer","title":"V","default":1},"focal":{"anyOf":[{"$ref":"#/components/schemas/AssetFocalPoint"},{"type":"null"}]},"zoom":{"anyOf":[{"type":"number","maximum":4.0,"minimum":1.0},{"type":"null"}],"title":"Zoom"},"rotation":{"anyOf":[{"type":"integer","maximum":359.0,"minimum":0.0},{"type":"null"}],"title":"Rotation"},"fit":{"anyOf":[{"type":"string","enum":["cover","contain"]},{"type":"null"}],"title":"Fit"}},"type":"object","title":"AssetTransform","description":"Per-asset DEFAULT non-destructive transform (focal/zoom/rotation).\n\nStored in ``asset_meta[key].transform`` and used to SEED a new image\nplacement's transform when the merchant first picks this asset from the\nlibrary. All scalars are aspect-independent, so the same default applies\nacross hero/card/promo placements. Strictly validated here (the editor\nalready clamps before sending); the free-form customization path uses a\nlenient clamp instead — see ``application/services/image_transform.py``."},"AudienceEstimate":{"properties":{"estimated_count":{"type":"integer","title":"Estimated Count"},"sample_recipients":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Sample Recipients","default":[]}},"type":"object","required":["estimated_count"],"title":"AudienceEstimate","description":"Audience size estimate before sending."},"AudienceFilter":{"properties":{"type":{"type":"string","title":"Type","default":"all"},"ordered_within_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ordered Within Days"},"inactive_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inactive Days"},"min_total_spent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Total Spent"},"governorate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governorate"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"opted_in_marketing":{"type":"boolean","title":"Opted In Marketing","default":true}},"type":"object","title":"AudienceFilter","description":"Audience filter for campaigns."},"AutomaticContent":{"properties":{"surface":{"type":"string","const":"automatic","title":"Surface","default":"automatic"}},"additionalProperties":false,"type":"object","title":"AutomaticContent","description":"Automatic discount: label is translatable; no extra config here."},"AutopilotExceptionItem":{"properties":{"order_id":{"type":"string","format":"uuid","title":"Order Id"},"order_number":{"type":"string","title":"Order Number"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"total_cents":{"type":"integer","title":"Total Cents"},"currency":{"type":"string","title":"Currency"},"exception_reason":{"type":"string","title":"Exception Reason"},"flagged_at":{"type":"string","format":"date-time","title":"Flagged At"},"age_hours":{"type":"integer","title":"Age Hours"},"attempts":{"type":"integer","title":"Attempts"},"order_status":{"type":"string","title":"Order Status"}},"type":"object","required":["order_id","order_number","total_cents","currency","exception_reason","flagged_at","age_hours","attempts","order_status"],"title":"AutopilotExceptionItem","description":"One order the Autopilot could not close on its own."},"AutopilotExceptionListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AutopilotExceptionItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"AutopilotExceptionListResponse"},"AutosaveDraftRequest":{"properties":{"payload":{"additionalProperties":true,"type":"object","title":"Payload","description":"ThemeSettingsV3-shaped dict"},"change_summary":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Change Summary","description":"Short label describing this change for version history"},"expected_etag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Etag","description":"Optimistic-concurrency token from the previous draft fetch. Omit on first save; mandatory afterwards to detect conflicts."}},"type":"object","required":["payload"],"title":"AutosaveDraftRequest","description":"Request body for autosave.\n\n`payload` is the full V3 ThemeSettingsV3 dict. Pydantic re-parses it\ninto the strongly-typed model in the service layer so the URL allowlist\nruns at the boundary as well as in storage.\n\n`expected_etag` is the value the client received from the most recent\nGET /draft or PUT /autosave. If it doesn't match the server's current\netag, a different tab / device has saved since this draft was loaded\nand we'd silently overwrite their work. The route returns 409 in that\ncase and the client surfaces \"newer changes elsewhere; reload to\ncontinue\"."},"AutosaveDraftResponse":{"properties":{"draft":{"additionalProperties":true,"type":"object","title":"Draft"},"etag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Etag"}},"type":"object","required":["draft"],"title":"AutosaveDraftResponse"},"BYOConnectRequest":{"properties":{"access_token":{"type":"string","minLength":1,"title":"Access Token","description":"Meta System User Access Token with whatsapp_business_management + whatsapp_business_messaging scopes."},"phone_number_id":{"type":"string","minLength":1,"title":"Phone Number Id"},"waba_id":{"type":"string","minLength":1,"title":"Waba Id"},"app_secret":{"type":"string","minLength":1,"title":"App Secret"}},"type":"object","required":["access_token","phone_number_id","waba_id","app_secret"],"title":"BYOConnectRequest","description":"Body for POST /whatsapp/byo/connect."},"BalancesResponse":{"properties":{"wallet_balance_cents":{"type":"integer","title":"Wallet Balance Cents"},"store_balance_cents":{"type":"integer","title":"Store Balance Cents"},"pending_clearance_cents":{"type":"integer","title":"Pending Clearance Cents","default":0},"cod_in_transit_cents":{"type":"integer","title":"Cod In Transit Cents","default":0},"cod_in_transit_count":{"type":"integer","title":"Cod In Transit Count","default":0},"store_balance_source":{"type":"string","title":"Store Balance Source","default":"transactions"}},"type":"object","required":["wallet_balance_cents","store_balance_cents"],"title":"BalancesResponse"},"BenchmarkItem":{"properties":{"metric":{"type":"string","title":"Metric"},"yours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Yours"},"p25":{"type":"number","title":"P25"},"p50":{"type":"number","title":"P50"},"p75":{"type":"number","title":"P75"},"n_stores_bucket":{"type":"string","title":"N Stores Bucket"},"segment_used":{"type":"string","title":"Segment Used"}},"type":"object","required":["metric","yours","p25","p50","p75","n_stores_bucket","segment_used"],"title":"BenchmarkItem"},"BenchmarksResponse":{"properties":{"published":{"type":"boolean","title":"Published"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"opted_in":{"type":"boolean","title":"Opted In"},"period":{"type":"string","title":"Period"},"benchmarks":{"items":{"$ref":"#/components/schemas/BenchmarkItem"},"type":"array","title":"Benchmarks"}},"type":"object","required":["published","reason","opted_in","period","benchmarks"],"title":"BenchmarksResponse"},"Body_execute_customer_import":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"CSV file"},"mapping_json":{"type":"string","title":"Mapping Json","description":"JSON: {csv_column: target_field | ''}"},"save_mapping":{"type":"boolean","title":"Save Mapping","default":true}},"type":"object","required":["file","mapping_json"],"title":"Body_execute_customer_import"},"Body_execute_order_import":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"CSV file"},"mapping_json":{"type":"string","title":"Mapping Json","description":"JSON: {csv_column: target_field | ''}"},"save_mapping":{"type":"boolean","title":"Save Mapping","default":true}},"type":"object","required":["file","mapping_json"],"title":"Body_execute_order_import"},"Body_import_products":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"CSV file to import"}},"type":"object","required":["file"],"title":"Body_import_products"},"Body_merchant_record_order_payment":{"properties":{"image":{"type":"string","contentMediaType":"application/octet-stream","title":"Image","description":"Receipt screenshot"},"amount_cents":{"type":"integer","maximum":2147483647.0,"exclusiveMinimum":0.0,"title":"Amount Cents"},"method":{"type":"string","title":"Method"},"reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference"},"idempotency_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency Key"}},"type":"object","required":["image","amount_cents","method"],"title":"Body_merchant_record_order_payment"},"Body_preview_customer_import":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"CSV file"}},"type":"object","required":["file"],"title":"Body_preview_customer_import"},"Body_preview_order_import":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"CSV file"}},"type":"object","required":["file"],"title":"Body_preview_order_import"},"Body_preview_status_import":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_preview_status_import"},"Body_upload_category_image":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Image file to upload"}},"type":"object","required":["file"],"title":"Body_upload_category_image"},"Body_upload_customization_asset":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"asset_type":{"type":"string","title":"Asset Type","description":"Asset type: logo, favicon, hero_image, section_image, profile_picture, or social_image"}},"type":"object","required":["file","asset_type"],"title":"Body_upload_customization_asset"},"Body_upload_instapay_qr_image":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"InstaPay QR image (PNG/JPG)"}},"type":"object","required":["file"],"title":"Body_upload_instapay_qr_image"},"Body_upload_product_image":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"Image file to upload"}},"type":"object","required":["file"],"title":"Body_upload_product_image"},"BostaCredentialsResponse":{"properties":{"is_configured":{"type":"boolean","title":"Is Configured"},"api_key_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Masked"},"business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Id"},"auto_create_shipment":{"type":"boolean","title":"Auto Create Shipment","default":false},"last_configured":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Configured"}},"type":"object","required":["is_configured"],"title":"BostaCredentialsResponse","description":"Bosta credentials status (masked, never returns real keys)."},"BulkCreateShipmentRequest":{"properties":{"order_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":50,"minItems":1,"title":"Order Ids"},"carrier":{"type":"string","title":"Carrier","description":"Shipping carrier: bosta, manual, mylerz, jt","default":"bosta"}},"type":"object","required":["order_ids"],"title":"BulkCreateShipmentRequest","description":"Bulk create shipments for multiple orders."},"BulkSetBundlesRequest":{"properties":{"primary_product_id":{"type":"string","title":"Primary Product Id","description":"Product whose bundles to replace"},"bundles":{"items":{"$ref":"#/components/schemas/BundleItemRequest"},"type":"array","maxItems":10,"title":"Bundles"}},"type":"object","required":["primary_product_id","bundles"],"title":"BulkSetBundlesRequest","description":"Replace all bundles for a primary product (set operation)."},"BulkShipmentResultItem":{"properties":{"order_id":{"type":"string","format":"uuid","title":"Order Id"},"success":{"type":"boolean","title":"Success"},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number"},"shipment_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Shipment Id"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["order_id","success"],"title":"BulkShipmentResultItem","description":"Result for a single order in bulk creation."},"BulkShipmentResultResponse":{"properties":{"total":{"type":"integer","title":"Total"},"succeeded":{"type":"integer","title":"Succeeded"},"failed":{"type":"integer","title":"Failed"},"results":{"items":{"$ref":"#/components/schemas/BulkShipmentResultItem"},"type":"array","title":"Results"}},"type":"object","required":["total","succeeded","failed","results"],"title":"BulkShipmentResultResponse","description":"Bulk shipment creation results."},"BulkUpdateOrderStatusRequest":{"properties":{"order_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":100,"minItems":1,"title":"Order Ids","description":"List of order UUIDs to update"},"status":{"type":"string","title":"Status","description":"New order status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason for status change"}},"type":"object","required":["order_ids","status"],"title":"BulkUpdateOrderStatusRequest","description":"Bulk update order status request.","example":{"order_ids":["770e8400-e29b-41d4-a716-446655440000","880e8400-e29b-41d4-a716-446655440000"],"reason":"Batch shipment via Bosta","status":"shipped"}},"BulkUpdateOrderStatusResponse":{"properties":{"updated":{"type":"integer","title":"Updated","description":"Number of orders successfully updated"},"failed":{"type":"integer","title":"Failed","description":"Number of orders that failed to update","default":0},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","description":"Error details for failed updates"}},"type":"object","required":["updated"],"title":"BulkUpdateOrderStatusResponse","description":"Bulk update order status response."},"BundleItemRequest":{"properties":{"bundled_product_id":{"type":"string","title":"Bundled Product Id"},"discount_type":{"type":"string","title":"Discount Type","default":"none"},"discount_value":{"type":"integer","title":"Discount Value","default":0},"position":{"type":"integer","title":"Position","default":0},"is_active":{"type":"boolean","title":"Is Active","default":true},"section_title_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Title En"},"section_title_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Title Ar"}},"type":"object","required":["bundled_product_id"],"title":"BundleItemRequest","description":"A single bundle item in a bulk set operation."},"BundleLeg":{"properties":{"quantity":{"type":"integer","minimum":1.0,"title":"Quantity","default":1},"label":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Label"}},"type":"object","title":"BundleLeg","description":"One required component of a BUNDLE — \"1 tee\", \"2 caps\".\n\nThe leg's CATALOGUE SCOPE is not stored here. It lives on\n`PromotionTarget` rows tagged `role=\"leg:<index>\"`, where the index is this\nleg's position in `DiscountRule.bundle_legs`, and reaches the math as a\n`LineFilter` built by `discount_calculator._build_leg_filters`. Keeping\nscope in targets rather than inlining product ids here is what lets the\nexisting target machinery — tenant isolation, the replace-for-promotion\nwrite path, the resolver's eligible-set reporting — carry bundles with no\nparallel implementation.\n\n`label` is merchant display copy only (\"1 tee\"). Nothing computes from it;\nthe theme is free to ignore it and render `quantity` itself."},"BundleResponse":{"properties":{"id":{"type":"string","title":"Id"},"store_id":{"type":"string","title":"Store Id"},"primary_product_id":{"type":"string","title":"Primary Product Id"},"bundled_product_id":{"type":"string","title":"Bundled Product Id"},"discount_type":{"type":"string","title":"Discount Type"},"discount_value":{"type":"integer","title":"Discount Value"},"position":{"type":"integer","title":"Position"},"is_active":{"type":"boolean","title":"Is Active"},"section_title_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Title En"},"section_title_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Title Ar"},"bundled_product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bundled Product Name"},"bundled_product_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Bundled Product Price"},"bundled_product_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bundled Product Image"},"bundled_product_in_stock":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Bundled Product In Stock"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","store_id","primary_product_id","bundled_product_id","discount_type","discount_value","position","is_active","section_title_en","section_title_ar","created_at","updated_at"],"title":"BundleResponse","description":"Bundle response for the dashboard."},"BuyerInfoRequest":{"properties":{"buyer_type":{"type":"string","title":"Buyer Type","description":"B=Business, P=Person, F=Foreigner","default":"B"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id","description":"Tax ID (required for business)"},"national_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"National Id","description":"National ID (for persons)"},"name":{"type":"string","title":"Name","description":"Buyer name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar","description":"Buyer name in Arabic"},"governorate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governorate","description":"Governorate"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"City"},"street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street","description":"Street"},"building_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Building Number","description":"Building number"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Phone number"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Email address"}},"type":"object","required":["name"],"title":"BuyerInfoRequest","description":"Buyer information for invoice.","example":{"buyer_type":"B","city":"Alexandria","email":"billing@acme.eg","name":"Acme Corp","tax_id":"987654321"}},"BuyerInfoResponse":{"properties":{"buyer_type":{"type":"string","title":"Buyer Type"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"national_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"National Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"country":{"type":"string","title":"Country","default":"EG"},"governorate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governorate"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street"},"building_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Building Number"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["buyer_type","tax_id","national_id","name","name_ar","governorate","city","street","building_number","phone","email"],"title":"BuyerInfoResponse","description":"Buyer information response."},"CLVStats":{"properties":{"avg_clv":{"type":"integer","title":"Avg Clv"},"median_clv":{"type":"integer","title":"Median Clv"},"top_10_pct_clv":{"type":"integer","title":"Top 10 Pct Clv"},"total_customers":{"type":"integer","title":"Total Customers"},"single_order_pct":{"type":"number","title":"Single Order Pct"}},"type":"object","required":["avg_clv","median_clv","top_10_pct_clv","total_customers","single_order_pct"],"title":"CLVStats"},"CampaignCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"template_id":{"type":"string","format":"uuid","title":"Template Id"},"audience_filter":{"$ref":"#/components/schemas/AudienceFilter"},"template_params":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Template Params"}},"type":"object","required":["name","template_id"],"title":"CampaignCreate","description":"Create a new campaign."},"CampaignRecipientResponse":{"properties":{"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"phone":{"type":"string","title":"Phone"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"status":{"type":"string","title":"Status"},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"}},"type":"object","required":["phone","status"],"title":"CampaignRecipientResponse","description":"Per-recipient delivery status."},"CampaignRecipientsListResponse":{"properties":{"recipients":{"items":{"$ref":"#/components/schemas/CampaignRecipientResponse"},"type":"array","title":"Recipients"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["recipients","total"],"title":"CampaignRecipientsListResponse","description":"Paginated campaign recipients."},"CampaignScheduleRequest":{"properties":{"scheduled_at":{"type":"string","format":"date-time","title":"Scheduled At"}},"type":"object","required":["scheduled_at"],"title":"CampaignScheduleRequest","description":"Schedule a campaign for later."},"CampaignStatus-Output":{"type":"string","enum":["draft","scheduled","sending","completed","failed","cancelled"],"title":"CampaignStatus"},"CampaignUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Template Id"},"audience_filter":{"anyOf":[{"$ref":"#/components/schemas/AudienceFilter"},{"type":"null"}]},"template_params":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Template Params"}},"type":"object","title":"CampaignUpdate","description":"Update a draft campaign."},"CartAbandonmentResponse":{"properties":{"carts_created":{"type":"integer","title":"Carts Created"},"checkouts_started":{"type":"integer","title":"Checkouts Started"},"abandonment_rate":{"type":"number","title":"Abandonment Rate"},"estimated_lost_revenue":{"type":"integer","title":"Estimated Lost Revenue"}},"type":"object","required":["carts_created","checkouts_started","abandonment_rate","estimated_lost_revenue"],"title":"CartAbandonmentResponse"},"CategoryPerformanceItem":{"properties":{"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id"},"category_name":{"type":"string","title":"Category Name"},"revenue":{"type":"integer","title":"Revenue"},"quantity_sold":{"type":"integer","title":"Quantity Sold"},"product_count":{"type":"integer","title":"Product Count"}},"type":"object","required":["category_id","category_name","revenue","quantity_sold","product_count"],"title":"CategoryPerformanceItem"},"CategoryResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Category UUID"},"store_id":{"type":"string","title":"Store Id","description":"Owning store UUID"},"name":{"type":"string","title":"Name","description":"Category name"},"slug":{"type":"string","title":"Slug","description":"URL slug"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Category description"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url","description":"Category image URL"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"Parent category UUID"},"position":{"type":"integer","title":"Position","description":"Sort position"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the category is visible"},"seo_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seo Title","description":"SEO page title override."},"robots_noindex":{"type":"boolean","title":"Robots Noindex","description":"Keep this page out of search results.","default":false},"canonical_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Canonical Url","description":"Absolute URL this page should credit as the original."},"sitemap_exclude":{"type":"boolean","title":"Sitemap Exclude","description":"Leave this page out of sitemap.xml.","default":false},"seo_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seo Description","description":"SEO meta description override."},"social_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Social Image Url","description":"OG/Twitter card image."},"template_suffix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Suffix","description":"Alternate template variant suffix; null = base template."},"product_count":{"type":"integer","title":"Product Count","description":"Number of products in this category"},"extra_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Data","description":"Extra metadata (e.g. name_ar, description_ar)"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","title":"Updated At","description":"ISO 8601 last-update timestamp"}},"type":"object","required":["id","store_id","name","slug","description","image_url","parent_id","position","is_active","product_count","created_at","updated_at"],"title":"CategoryResponse","description":"Category response schema."},"ChannelAttributionItem":{"properties":{"channel":{"type":"string","title":"Channel"},"visits":{"type":"integer","title":"Visits"},"orders":{"type":"integer","title":"Orders"},"revenue":{"type":"integer","title":"Revenue"},"conversion_rate":{"type":"number","title":"Conversion Rate"}},"type":"object","required":["channel","visits","orders","revenue","conversion_rate"],"title":"ChannelAttributionItem"},"CheckoutFieldsConfig":{"properties":{"standard_fields":{"additionalProperties":{"$ref":"#/components/schemas/StandardFieldSetting"},"type":"object","title":"Standard Fields"},"custom_fields":{"items":{"$ref":"#/components/schemas/CustomFieldSetting"},"type":"array","title":"Custom Fields"},"identity":{"$ref":"#/components/schemas/IdentityConfig"}},"type":"object","title":"CheckoutFieldsConfig"},"CodAutopilotResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"digest_hour":{"type":"integer","title":"Digest Hour","default":18},"delivery_check_delay_days":{"type":"integer","title":"Delivery Check Delay Days","default":3},"delivery_check_retry_days":{"type":"integer","title":"Delivery Check Retry Days","default":2},"delivery_check_max_attempts":{"type":"integer","title":"Delivery Check Max Attempts","default":3},"assumed_delivered_days":{"type":"integer","title":"Assumed Delivered Days","default":10},"digest_deliverable":{"type":"boolean","title":"Digest Deliverable","default":false},"auto_rto_days":{"type":"integer","title":"Auto Rto Days","default":14},"templates_ready":{"type":"boolean","title":"Templates Ready","default":false},"templates_pending":{"items":{"type":"string"},"type":"array","title":"Templates Pending"},"whatsapp_access_active":{"type":"boolean","title":"Whatsapp Access Active","default":false},"cod_enabled":{"type":"boolean","title":"Cod Enabled","default":false}},"type":"object","title":"CodAutopilotResponse","description":"COD Autopilot settings (004-cod-autopilot FR-022).\n\n``digest_deliverable`` and ``auto_rto_days`` are read-only computed\nfields: the first reflects whether the store has a usable contact\nphone for the daily ship digest; the second surfaces the auto-RTO\nwindow so the UI can warn when it overlaps ``assumed_delivered_days``."},"CodDepositPolicy":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"mode":{"type":"string","enum":["fixed","percent"],"title":"Mode","default":"fixed"},"amount_cents":{"type":"integer","minimum":0.0,"title":"Amount Cents","default":0},"percent":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Percent","default":50},"min_order_cents":{"type":"integer","minimum":0.0,"title":"Min Order Cents","default":0},"ttl_minutes":{"type":"integer","maximum":1440.0,"minimum":5.0,"title":"Ttl Minutes","default":30},"auto_refund_on_cancel":{"type":"boolean","title":"Auto Refund On Cancel","default":false},"allowed_gateways":{"items":{"type":"string","enum":["paymob","kashier","fawry","fawaterak","instapay","vodafone_cash","we_pay","orange_cash"]},"type":"array","title":"Allowed Gateways"}},"type":"object","title":"CodDepositPolicy","description":"Per-store deposit-to-confirm-COD policy.\n\nWhen enabled, customers who select COD at checkout are asked to\npay a fixed deposit via one of `allowed_gateways` BEFORE the\norder is created. On successful deposit, the order moves to\nCONFIRMED with `deposit_amount_cents` stored and the remaining\nbalance due on delivery. If the deposit isn't completed within\n`ttl_minutes`, the order auto-cancels.\n\n`mode` picks how much: a flat `amount_cents`, or `percent` of the\norder total (50 = half). `min_order_cents` gates the whole policy by\nbasket size, so a merchant can leave small COD orders alone and only\nask for a deposit once an order is worth losing."},"CodGovernorateRate":{"properties":{"governorate":{"type":"string","title":"Governorate"},"resolved":{"type":"integer","title":"Resolved"},"returned":{"type":"integer","title":"Returned"},"rate_pct":{"type":"number","title":"Rate Pct"},"shrunk_rate_pct":{"type":"number","title":"Shrunk Rate Pct"}},"type":"object","required":["governorate","resolved","returned","rate_pct","shrunk_rate_pct"],"title":"CodGovernorateRate"},"CodRejectionLocationResponse":{"properties":{"location":{"type":"string","title":"Location"},"rejected":{"type":"integer","title":"Rejected"},"total":{"type":"integer","title":"Total"},"rate":{"type":"number","title":"Rate"}},"type":"object","required":["location","rejected","total","rate"],"title":"CodRejectionLocationResponse","description":"COD rejection stats for a single location."},"CodRejectionProfile":{"properties":{"store_rate_pct":{"type":"number","title":"Store Rate Pct"},"wilson_low_pct":{"type":"number","title":"Wilson Low Pct"},"wilson_high_pct":{"type":"number","title":"Wilson High Pct"},"resolved_orders":{"type":"integer","title":"Resolved Orders"},"pending_orders":{"type":"integer","title":"Pending Orders"},"pending_value_cents":{"type":"integer","title":"Pending Value Cents"},"expected_loss_cents":{"type":"integer","title":"Expected Loss Cents"},"by_governorate":{"items":{"$ref":"#/components/schemas/CodGovernorateRate"},"type":"array","title":"By Governorate"},"confidence":{"type":"string","title":"Confidence"}},"type":"object","required":["store_rate_pct","wilson_low_pct","wilson_high_pct","resolved_orders","pending_orders","pending_value_cents","expected_loss_cents","by_governorate","confidence"],"title":"CodRejectionProfile"},"CodRejectionStatsResponse":{"properties":{"total_cod_shipments":{"type":"integer","title":"Total Cod Shipments"},"delivered_count":{"type":"integer","title":"Delivered Count"},"rejected_count":{"type":"integer","title":"Rejected Count"},"returned_count":{"type":"integer","title":"Returned Count"},"rejection_rate":{"type":"number","title":"Rejection Rate"},"total_cod_amount":{"type":"integer","title":"Total Cod Amount"},"rejected_amount":{"type":"integer","title":"Rejected Amount"},"by_location":{"items":{"$ref":"#/components/schemas/CodRejectionLocationResponse"},"type":"array","title":"By Location"}},"type":"object","required":["total_cod_shipments","delivered_count","rejected_count","returned_count","rejection_rate","total_cod_amount","rejected_amount","by_location"],"title":"CodRejectionStatsResponse","description":"COD rejection statistics."},"CodSummaryResponse":{"properties":{"total_shipments":{"type":"integer","title":"Total Shipments","default":0},"total_expected":{"type":"integer","title":"Total Expected","default":0},"total_collected":{"type":"integer","title":"Total Collected","default":0},"total_pending":{"type":"integer","title":"Total Pending","default":0},"collected_count":{"type":"integer","title":"Collected Count","default":0},"delivered_not_collected":{"type":"integer","title":"Delivered Not Collected","default":0}},"type":"object","title":"CodSummaryResponse","description":"COD reconciliation summary."},"CodTrustResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"threshold":{"type":"integer","title":"Threshold","default":70},"min_confidence":{"type":"string","enum":["low","medium","high"],"title":"Min Confidence","default":"medium"},"action":{"type":"string","enum":["block","warn","recover"],"title":"Action","default":"block"},"recovery_promo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recovery Promo"},"auto_rto_disabled":{"type":"boolean","title":"Auto Rto Disabled","default":false},"auto_rto_days":{"type":"integer","title":"Auto Rto Days","default":14}},"type":"object","title":"CodTrustResponse","description":"COD trust network protection settings."},"CohortRow":{"properties":{"cohort":{"type":"string","title":"Cohort"},"size":{"type":"integer","title":"Size"},"retention":{"items":{"type":"number"},"type":"array","title":"Retention"}},"type":"object","required":["cohort","size","retention"],"title":"CohortRow"},"ConnectAssetsDTO":{"properties":{"state":{"type":"string","title":"State"},"page_ids":{"items":{"type":"string"},"type":"array","title":"Page Ids"}},"type":"object","required":["state","page_ids"],"title":"ConnectAssetsDTO","description":"Request DTO for connecting the Pages a merchant selected."},"ConnectDevServerRequest":{"properties":{"dev_url":{"type":"string","pattern":"^https?://[^\\s]+$","title":"Dev Url","description":"URL of the running numu-theme dev server (e.g., http://localhost:4321)"}},"type":"object","required":["dev_url"],"title":"ConnectDevServerRequest","description":"Request to connect a local theme dev server to a store.\n\nThe dev_url should point to a running `numu-theme dev` server\n(e.g., http://localhost:4321 or a tunneled URL like https://abc.ngrok.io).\nThe backend fetches the theme manifest from the dev server and registers\nthe theme as an external theme with mode=\"dev\" so the storefront knows\nto bypass caching."},"ConnectMetaCallbackDTO":{"properties":{"code":{"type":"string","title":"Code"},"state":{"type":"string","title":"State"},"redirect_uri":{"type":"string","title":"Redirect Uri"}},"type":"object","required":["code","state","redirect_uri"],"title":"ConnectMetaCallbackDTO","description":"Request DTO for OAuth callback."},"ConnectMetaDTO":{"properties":{"store_id":{"type":"string","format":"uuid","title":"Store Id"},"redirect_uri":{"type":"string","title":"Redirect Uri"}},"type":"object","required":["store_id","redirect_uri"],"title":"ConnectMetaDTO","description":"Request DTO for starting Meta OAuth."},"ConnectSocialRequest":{"properties":{"platform":{"type":"string","title":"Platform","description":"Social platform: 'instagram' or 'facebook'"},"oauth_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Oauth Code","description":"OAuth authorization code (omit to get auth URL)"},"redirect_uri":{"type":"string","title":"Redirect Uri","description":"OAuth redirect URI","default":"https://merchant.numueg.app/social/callback"}},"type":"object","required":["platform"],"title":"ConnectSocialRequest","description":"Request to initiate a social account connection.","example":{"oauth_code":"AQBx...","platform":"instagram","redirect_uri":"https://merchant.numueg.app/social/callback"}},"ConnectTikTokShopRequest":{"properties":{"access_token":{"type":"string","maxLength":1024,"minLength":8,"title":"Access Token"},"refresh_token":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Refresh Token"},"shop_id":{"type":"string","maxLength":64,"minLength":1,"title":"Shop Id"},"shop_cipher":{"type":"string","maxLength":256,"minLength":1,"title":"Shop Cipher"},"shop_name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Shop Name"},"region":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Region"},"seller_name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Seller Name"}},"type":"object","required":["access_token","shop_id","shop_cipher"],"title":"ConnectTikTokShopRequest","description":"Body for ``PUT /stores/{id}/settings/channels/tiktok-shop``.\n\nSubmitted by the hub after the OAuth callback returns the token bundle +\nchosen shop. The tokens are encrypted into a ServiceCredential; the shop\nmetadata goes into ``store.settings.channels.tiktok_shop``."},"ConnectionType":{"type":"string","enum":["shared","own"],"title":"ConnectionType","description":"How the store is connected to WhatsApp."},"ConsentSettings":{"properties":{"granular_enabled":{"type":"boolean","title":"Granular Enabled","description":"When true, the storefront banner renders 4 per-category toggles (analytics, marketing, preferences, sale_of_data). When false, shows the legacy single Accept/Reject pair.","default":false},"region_default_mode":{"type":"string","enum":["auto","force_opt_in","force_opt_out"],"title":"Region Default Mode","description":"Default decision when the user hasn't chosen yet. ``force_opt_out`` is the conservative MENA default; ``auto`` enables Cloudflare-header region detection.","default":"force_opt_out"},"default_analytics":{"type":"boolean","title":"Default Analytics","default":true},"default_marketing":{"type":"boolean","title":"Default Marketing","default":true},"default_preferences":{"type":"boolean","title":"Default Preferences","default":true},"default_sale_of_data":{"type":"boolean","title":"Default Sale Of Data","default":false}},"type":"object","title":"ConsentSettings","description":"Wave 3 Phase 18 — Per-store granular consent defaults.\n\nMirrors Shopify's Customer Privacy API surface: four boolean\ncategories the merchant can enable + a region-mode selector that\ndrives the banner's default state. The storefront's\n``<ConsentBanner>`` reads ``granular_enabled`` to decide whether\nto render the 4-toggle UI or the legacy 1-toggle UX, and reads\n``region_default_mode`` to decide whether to opt-in or opt-out\nby default.\n\nPer-user choices are still stored in localStorage on the\nstorefront (``numu_consent_v2``); this struct only carries the\n*merchant's policy*, not any individual visitor's decision."},"ConversationListResponse":{"properties":{"conversations":{"items":{"$ref":"#/components/schemas/ConversationSummary"},"type":"array","title":"Conversations"},"total":{"type":"integer","title":"Total"},"unread_total":{"type":"integer","title":"Unread Total","default":0}},"type":"object","required":["conversations","total"],"title":"ConversationListResponse","description":"Paginated conversation list."},"ConversationStatus":{"type":"string","enum":["active","archived","spam"],"title":"ConversationStatus"},"ConversationSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"customer_phone":{"type":"string","title":"Customer Phone"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"last_message_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message Preview"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At"},"last_message_direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message Direction"},"unread_count":{"type":"integer","title":"Unread Count","default":0},"status":{"$ref":"#/components/schemas/ConversationStatus","default":"active"},"assigned_to":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assigned To"},"window_open":{"type":"boolean","title":"Window Open","default":false},"window_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Window Expires At"}},"type":"object","required":["id","customer_phone"],"title":"ConversationSummary","description":"Conversation list item for inbox view."},"ConversationUpdateRequest":{"properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ConversationStatus"},{"type":"null"}]},"assigned_to":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Assigned To"},"mark_read":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Mark Read"}},"type":"object","title":"ConversationUpdateRequest","description":"Update conversation (mark read, archive, assign)."},"ConversionStatsResponse":{"properties":{"total_visitors":{"type":"integer","title":"Total Visitors"},"total_orders":{"type":"integer","title":"Total Orders"},"conversion_rate":{"type":"number","title":"Conversion Rate"},"cart_abandonment_rate":{"type":"number","title":"Cart Abandonment Rate"}},"type":"object","required":["total_visitors","total_orders","conversion_rate","cart_abandonment_rate"],"title":"ConversionStatsResponse","description":"Conversion statistics."},"CookieBannerContent":{"properties":{"surface":{"type":"string","const":"cookie_banner","title":"Surface","default":"cookie_banner"},"position":{"type":"string","enum":["bottom","modal"],"title":"Position","default":"bottom"},"accept_required":{"type":"boolean","title":"Accept Required","default":false},"policy_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policy Url"},"preference_categories":{"items":{"type":"string"},"type":"array","title":"Preference Categories"}},"additionalProperties":false,"type":"object","title":"CookieBannerContent","description":"Compliance / cookie consent banner config."},"CouponResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Coupon UUID"},"store_id":{"type":"string","title":"Store Id","description":"Owning store UUID"},"code":{"type":"string","title":"Code","description":"Coupon code"},"coupon_type":{"type":"string","title":"Coupon Type","description":"percentage, fixed, or free_shipping"},"value":{"type":"string","title":"Value","description":"Formatted discount value"},"min_order_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Min Order Amount","description":"Minimum order amount"},"max_discount_amount":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Max Discount Amount","description":"Max discount cap"},"usage_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Usage Limit","description":"Total usage limit"},"usage_count":{"type":"integer","title":"Usage Count","description":"Number of times used"},"valid_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid From","description":"Validity start ISO 8601"},"valid_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid Until","description":"Validity end ISO 8601"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the coupon is active"},"is_expired":{"type":"boolean","title":"Is Expired","description":"Whether the coupon has expired"},"is_usable":{"type":"boolean","title":"Is Usable","description":"Whether the coupon can be used right now"},"applicable_product_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Applicable Product Ids","description":"Product UUIDs this coupon applies to"},"applicable_category_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Applicable Category Ids","description":"Category UUIDs this coupon applies to"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","title":"Updated At","description":"ISO 8601 last-update timestamp"}},"type":"object","required":["id","store_id","code","coupon_type","value","min_order_amount","max_discount_amount","usage_limit","usage_count","valid_from","valid_until","is_active","is_expired","is_usable","created_at","updated_at"],"title":"CouponResponse","description":"Coupon response schema.","example":{"code":"SUMMER25","coupon_type":"percentage","created_at":"2025-05-15T10:00:00Z","id":"880e8400-e29b-41d4-a716-446655440000","is_active":true,"is_expired":false,"is_usable":true,"max_discount_amount":"50.00","min_order_amount":"100.00","store_id":"660e8400-e29b-41d4-a716-446655440000","updated_at":"2025-05-15T10:00:00Z","usage_count":12,"usage_limit":100,"valid_from":"2025-06-01T00:00:00Z","valid_until":"2025-08-31T23:59:59Z","value":"25.00"}},"CouponUsageItem":{"properties":{"code":{"type":"string","title":"Code"},"uses":{"type":"integer","title":"Uses"},"revenue_impact":{"type":"integer","title":"Revenue Impact"}},"type":"object","required":["code","uses","revenue_impact"],"title":"CouponUsageItem"},"CoverageConflict":{"properties":{"governorate_code":{"type":"string","title":"Governorate Code"},"zones":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Zones"}},"type":"object","required":["governorate_code","zones"],"title":"CoverageConflict"},"CoverageResponse":{"properties":{"covered":{"items":{"type":"string"},"type":"array","title":"Covered"},"uncovered":{"items":{"type":"string"},"type":"array","title":"Uncovered"},"conflicts":{"items":{"$ref":"#/components/schemas/CoverageConflict"},"type":"array","title":"Conflicts"}},"type":"object","required":["covered","uncovered"],"title":"CoverageResponse","description":"Returned by GET /stores/{id}/shipping/coverage.\n\n`covered` + `uncovered` partition the 27 canonical governorate codes.\n`conflicts` lists any governorate that (somehow) belongs to multiple\nactive zones — should always be empty, but the dashboard surfaces it\nas a banner if something slipped through."},"CreateBundleRequest":{"properties":{"primary_product_id":{"type":"string","title":"Primary Product Id","description":"Product whose page shows the widget"},"bundled_product_id":{"type":"string","title":"Bundled Product Id","description":"Product to recommend"},"discount_type":{"type":"string","title":"Discount Type","description":"none | percentage | fixed","default":"none"},"discount_value":{"type":"integer","minimum":0.0,"title":"Discount Value","description":"Discount amount (% or cents)","default":0},"position":{"type":"integer","minimum":0.0,"title":"Position","description":"Display order","default":0},"is_active":{"type":"boolean","title":"Is Active","default":true},"section_title_en":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Section Title En"},"section_title_ar":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Section Title Ar"}},"type":"object","required":["primary_product_id","bundled_product_id"],"title":"CreateBundleRequest","description":"Create a single bundle association."},"CreateCategoryRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Category name"},"slug":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Slug","description":"URL slug (auto-generated from name if omitted)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Category description"},"image_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Image Url","description":"Category image URL"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"Parent category UUID for nesting"},"position":{"type":"integer","minimum":0.0,"title":"Position","description":"Sort position (lower = first)","default":0},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the category is visible","default":true},"seo_title":{"anyOf":[{"type":"string","maxLength":70},{"type":"null"}],"title":"Seo Title","description":"SEO page title for the collection page."},"robots_noindex":{"type":"boolean","title":"Robots Noindex","description":"Keep this page out of search results.","default":false},"canonical_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Canonical Url","description":"Absolute URL this page should credit as the original."},"sitemap_exclude":{"type":"boolean","title":"Sitemap Exclude","description":"Leave this page out of sitemap.xml.","default":false},"seo_description":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Seo Description","description":"SEO meta description for the collection page."},"social_image_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Social Image Url","description":"OG/Twitter card image for the collection page."},"template_suffix":{"anyOf":[{"type":"string","maxLength":32,"pattern":"^[a-z0-9][a-z0-9-]{0,31}$"},{"type":"null"}],"title":"Template Suffix","description":"Alternate template variant suffix (Shopify-style); null = base template."},"extra_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Data","description":"Extra metadata (e.g. name_ar, description_ar)"}},"type":"object","required":["name"],"title":"CreateCategoryRequest","description":"Create category request schema."},"CreateCouponRequest":{"properties":{"code":{"type":"string","maxLength":50,"minLength":1,"title":"Code","description":"Unique coupon code (case-insensitive)"},"coupon_type":{"type":"string","title":"Coupon Type","description":"Discount type: percentage, fixed, or free_shipping"},"value":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Value","description":"Discount value — percentage (0-100) or fixed amount","default":"0"},"is_active":{"type":"boolean","title":"Is Active","default":true},"min_order_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Min Order Amount","description":"Minimum order subtotal required to apply the coupon"},"max_discount_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Max Discount Amount","description":"Maximum discount cap (for percentage coupons)"},"usage_limit":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Usage Limit","description":"Maximum number of times this coupon can be used"},"valid_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Valid From","description":"ISO 8601 start of validity period"},"valid_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Valid Until","description":"ISO 8601 end of validity period"},"applicable_product_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Applicable Product Ids","description":"List of product UUIDs this coupon applies to (null = all)"},"applicable_category_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Applicable Category Ids","description":"List of category UUIDs this coupon applies to (null = all)"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Type-specific configuration. Required for buy_x_get_y and tiered; ignored for simple types."}},"type":"object","required":["code","coupon_type"],"title":"CreateCouponRequest","description":"Create coupon request schema.","example":{"code":"SUMMER25","coupon_type":"percentage","max_discount_amount":"50.00","min_order_amount":"100.00","usage_limit":100,"valid_from":"2025-06-01T00:00:00Z","valid_until":"2025-08-31T23:59:59Z","value":"25.00"}},"CreateEmailTemplateRequest":{"properties":{"event_type":{"type":"string","maxLength":50,"title":"Event Type"},"language":{"type":"string","enum":["ar","en"],"title":"Language"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"subject":{"type":"string","maxLength":500,"minLength":1,"title":"Subject"},"html_body":{"type":"string","minLength":1,"title":"Html Body"},"is_enabled":{"type":"boolean","title":"Is Enabled","default":true},"from_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"From Name"},"reply_to":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Reply To"},"extra_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Data"}},"type":"object","required":["event_type","language","name","subject","html_body"],"title":"CreateEmailTemplateRequest","description":"Body for ``POST /stores/{store_id}/email-templates``."},"CreateInvoiceRequest":{"properties":{"order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Order Id","description":"Associated order ID"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id","description":"Customer ID"},"invoice_type":{"$ref":"#/components/schemas/InvoiceType","description":"Invoice type: I=Invoice, C=Credit, D=Debit","default":"I"},"seller":{"$ref":"#/components/schemas/SellerInfoRequest","description":"Seller / issuer information"},"buyer":{"$ref":"#/components/schemas/BuyerInfoRequest","description":"Buyer / receiver information"},"line_items":{"items":{"$ref":"#/components/schemas/InvoiceLineItemRequest"},"type":"array","minItems":1,"title":"Line Items","description":"Invoice line items (at least one)"},"extra_discount":{"type":"integer","minimum":0.0,"title":"Extra Discount","description":"Extra discount in cents","default":0},"shipping_fee":{"type":"integer","minimum":0.0,"title":"Shipping Fee","description":"Shipping fee in cents (added to subtotal)","default":0},"vat_rate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Vat Rate","description":"VAT rate (default 14%). Prices are VAT-inclusive.","default":"14.00"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Notes in English"},"notes_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes Ar","description":"Notes in Arabic"},"original_invoice_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Invoice Number","description":"Original invoice number (required for credit/debit notes)"}},"type":"object","required":["seller","buyer","line_items"],"title":"CreateInvoiceRequest","description":"Create invoice request (VAT-inclusive pricing).","example":{"buyer":{"buyer_type":"B","name":"Acme Corp","tax_id":"987654321"},"invoice_type":"I","line_items":[{"description":"Egyptian Cotton T-Shirt","item_code":"EG-001","quantity":"2","unit_price":"100.00","vat_rate":"14.00"}],"seller":{"activity_code":"4649","name":"Nile Fashion LLC","tax_id":"123456789"},"shipping_fee":5000}},"CreateMenuRequest":{"properties":{"handle":{"type":"string","maxLength":255,"minLength":1,"title":"Handle","description":"Unique menu handle within the store"},"title":{"additionalProperties":{"type":"string"},"type":"object","title":"Title","description":"Bilingual title {en, ar}"},"items":{"items":{"$ref":"#/components/schemas/MenuItemSchema"},"type":"array","title":"Items"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["handle"],"title":"CreateMenuRequest","description":"Create a new menu for the store."},"CreateOrderCommentRequest":{"properties":{"content":{"type":"string","maxLength":4000,"minLength":1,"title":"Content"}},"type":"object","required":["content"],"title":"CreateOrderCommentRequest","description":"Body for posting a staff comment on an order.","example":{"content":"Customer called to confirm delivery slot."}},"CreateOrderRequest":{"properties":{"customer_id":{"type":"string","format":"uuid","title":"Customer Id","description":"Customer UUID"},"line_items":{"items":{"$ref":"#/components/schemas/OrderLineItemRequest"},"type":"array","minItems":1,"title":"Line Items","description":"Order line items (at least one required)"},"shipping_address":{"$ref":"#/components/schemas/OrderAddressRequest","description":"Shipping address"},"billing_address":{"anyOf":[{"$ref":"#/components/schemas/OrderAddressRequest"},{"type":"null"}],"description":"Billing address; defaults to shipping address if omitted"},"shipping_cost":{"type":"integer","minimum":0.0,"title":"Shipping Cost","description":"Shipping cost in cents","default":0},"tax_amount":{"type":"integer","minimum":0.0,"title":"Tax Amount","description":"Tax amount in cents","default":0},"discount_amount":{"type":"integer","minimum":0.0,"title":"Discount Amount","description":"Discount amount in cents","default":0},"currency":{"type":"string","maxLength":3,"title":"Currency","description":"ISO 4217 currency code","default":"EGP"},"payment_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Method","description":"Payment method: cod, paymob, fawry, etc."},"shipping_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipping Method","description":"Shipping method: bosta, pickup, etc."},"customer_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Notes","description":"Notes from the customer"}},"type":"object","required":["customer_id","line_items","shipping_address"],"title":"CreateOrderRequest","description":"Create order request schema.","example":{"currency":"EGP","customer_id":"660e8400-e29b-41d4-a716-446655440000","line_items":[{"product_id":"550e8400-e29b-41d4-a716-446655440000","product_name":"Egyptian Cotton T-Shirt","quantity":2,"unit_price":25000}],"payment_method":"cod","shipping_address":{"address_line1":"12 Tahrir Square","city":"Cairo","country":"Egypt","first_name":"Ahmed","last_name":"Hassan"},"shipping_cost":5000}},"CreatePageRequest":{"properties":{"handle":{"type":"string","maxLength":255,"minLength":1,"title":"Handle","description":"Unique page handle within the store (URL: /pages/<handle>)"},"title":{"additionalProperties":{"type":"string"},"type":"object","title":"Title","description":"Bilingual title {en, ar}"},"body":{"additionalProperties":{"type":"string"},"type":"object","title":"Body","description":"Bilingual rich-text body {en, ar}"},"seo":{"additionalProperties":true,"type":"object","title":"Seo","description":"SEO overrides: {title:{en,ar}, description:{en,ar}}"},"is_published":{"type":"boolean","title":"Is Published","default":true},"template":{"type":"string","maxLength":64,"title":"Template","default":"page"},"template_suffix":{"anyOf":[{"type":"string","maxLength":32,"pattern":"^[a-z0-9][a-z0-9-]{0,31}$"},{"type":"null"}],"title":"Template Suffix","description":"Alternate template variant suffix (Shopify-style); null = base template."}},"type":"object","required":["handle"],"title":"CreatePageRequest","description":"Create a new content page for the store."},"CreateProductRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Product display name"},"slug":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Slug","description":"URL-friendly slug; auto-generated if omitted"},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sku","description":"Stock Keeping Unit identifier"},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Description","description":"Full product description (HTML allowed)"},"short_description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Short Description","description":"Brief description for listings"},"product_type":{"type":"string","title":"Product Type","description":"Product type: physical or digital","default":"physical"},"price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Price","description":"Product price in the store currency"},"price_currency":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Price Currency","description":"ISO 4217 currency code. Defaults to the store's currency when omitted, so products inherit the merchant's market (EGP for an Egyptian store, SAR for a Saudi one)."},"compare_at_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Compare At Price","description":"Original price before discount (strike-through price)"},"cost_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Cost Price","description":"Cost of goods for profit calculation"},"quantity":{"type":"integer","minimum":0.0,"title":"Quantity","description":"Available stock quantity","default":0},"low_stock_threshold":{"type":"integer","minimum":0.0,"title":"Low Stock Threshold","description":"Threshold to trigger low-stock alerts","default":5},"images":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Images","description":"Product image URLs (max 50)"},"category_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Category Id","description":"Category UUID this product belongs to"},"tags":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Tags","description":"Searchable tags"},"attributes":{"additionalProperties":true,"type":"object","title":"Attributes","description":"Arbitrary key-value attributes (size, color, etc.)"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Product status: active, draft, or archived"},"brand":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Brand","description":"Manufacturer/brand name"},"robots_noindex":{"type":"boolean","title":"Robots Noindex","description":"Keep this page out of search results.","default":false},"canonical_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Canonical Url","description":"Absolute URL this page should credit as the original."},"sitemap_exclude":{"type":"boolean","title":"Sitemap Exclude","description":"Leave this page out of sitemap.xml.","default":false},"seo_title":{"anyOf":[{"type":"string","maxLength":70},{"type":"null"}],"title":"Seo Title","description":"SEO page title"},"seo_description":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Seo Description","description":"SEO meta description"},"template_suffix":{"anyOf":[{"type":"string","maxLength":32,"pattern":"^[a-z0-9][a-z0-9-]{0,31}$"},{"type":"null"}],"title":"Template Suffix","description":"Alternate template variant suffix (Shopify-style); null = base template."},"meta_catalog_id":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Meta Catalog Id","description":"Meta Commerce Catalog product ID. When set, the storefront uses this as `content_ids` on Pixel/CAPI events so Meta dynamic ads match conversions back to a catalog row."},"options":{"items":{"$ref":"#/components/schemas/ProductOptionInput"},"type":"array","maxItems":3,"title":"Options","description":"Up to 3 option axes (Size, Color, Material, ...)"},"variants":{"items":{"$ref":"#/components/schemas/VariantInput"},"type":"array","title":"Variants","description":"Per-variant price/SKU/inventory rows"},"weight":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Weight","description":"Shipping weight in kg"},"requires_shipping":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Requires Shipping","description":"False for digital goods — checkout then collects no address and charges no shipping. Omit to leave unchanged."},"tax_exempt":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tax Exempt","description":"True for zero-rated goods — the line is excluded from the taxable base. Omit to leave unchanged."},"sale_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Sale Price","description":"Scheduled sale price. Send the sale fields together: with a price to start or change a sale, without one to end it."},"sale_starts_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sale Starts At","description":"Sale window opens. Null = already open."},"sale_ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sale Ends At","description":"Sale window closes. Null = runs until removed."},"related_product_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":24},{"type":"null"}],"title":"Related Product Ids","description":"Curated similar products, replacing the automatic list. Send [] to fall back to automatic; omit to leave unchanged."}},"type":"object","required":["name","price"],"title":"CreateProductRequest","description":"Create product request schema.","example":{"attributes":{"color":"white","size":"M"},"compare_at_price":"350.00","cost_price":"120.00","description":"Premium Egyptian cotton t-shirt, available in multiple sizes.","images":["https://cdn.numu.com/products/tshirt-front.jpg"],"low_stock_threshold":10,"name":"Egyptian Cotton T-Shirt","price":"250.00","price_currency":"EGP","product_type":"physical","quantity":100,"short_description":"Soft Egyptian cotton tee","sku":"ECT-001","slug":"egyptian-cotton-tshirt","tags":["clothing","cotton","summer"]}},"CreatePromotionInput":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"surface":{"$ref":"#/components/schemas/PromotionSurface"},"status":{"$ref":"#/components/schemas/PromotionStatus","default":"draft"},"coupon_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Coupon Id"},"discount_rule":{"anyOf":[{"$ref":"#/components/schemas/DiscountRule"},{"type":"null"}]},"content":{"oneOf":[{"$ref":"#/components/schemas/DiscountCodeContent"},{"$ref":"#/components/schemas/AutomaticContent"},{"$ref":"#/components/schemas/AnnouncementBarContent"},{"$ref":"#/components/schemas/PopupContent"},{"$ref":"#/components/schemas/FloatingWidgetContent"},{"$ref":"#/components/schemas/CookieBannerContent"}],"title":"Content","discriminator":{"propertyName":"surface","mapping":{"announcement_bar":"#/components/schemas/AnnouncementBarContent","automatic":"#/components/schemas/AutomaticContent","cookie_banner":"#/components/schemas/CookieBannerContent","discount_code":"#/components/schemas/DiscountCodeContent","floating_widget":"#/components/schemas/FloatingWidgetContent","popup":"#/components/schemas/PopupContent"}}},"translations":{"additionalProperties":{"$ref":"#/components/schemas/LocalizedPromotionContent"},"type":"object","title":"Translations"},"displays":{"items":{"$ref":"#/components/schemas/PromotionDisplayInput"},"type":"array","title":"Displays"},"targets":{"items":{"$ref":"#/components/schemas/PromotionTargetInput"},"type":"array","title":"Targets"},"priority":{"type":"integer","title":"Priority","default":0},"starts_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Starts At"},"ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ends At"},"usage_limit_total":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Usage Limit Total"},"usage_limit_per_customer":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Usage Limit Per Customer"}},"additionalProperties":false,"type":"object","required":["name","surface","content"],"title":"CreatePromotionInput","description":"Payload for `POST /stores/{id}/promotions`."},"CreateRateRequest":{"properties":{"label":{"type":"string","maxLength":100,"minLength":1,"title":"Label"},"label_ar":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Label Ar"},"config":{"oneOf":[{"$ref":"#/components/schemas/RateConfigFlat"},{"$ref":"#/components/schemas/RateConfigFreeOver"},{"$ref":"#/components/schemas/RateConfigWeightBand"},{"$ref":"#/components/schemas/RateConfigCarrierApi"}],"title":"Config","discriminator":{"propertyName":"type","mapping":{"carrier_api":"#/components/schemas/RateConfigCarrierApi","flat":"#/components/schemas/RateConfigFlat","free_over":"#/components/schemas/RateConfigFreeOver","weight_band":"#/components/schemas/RateConfigWeightBand"}}},"is_active":{"type":"boolean","title":"Is Active","default":true},"sort_order":{"type":"integer","title":"Sort Order","default":0}},"additionalProperties":false,"type":"object","required":["label","config"],"title":"CreateRateRequest"},"CreateRefundRequest":{"properties":{"refund_type":{"type":"string","pattern":"^(full|partial)$","title":"Refund Type","description":"Refund type: 'full' or 'partial'"},"reason":{"type":"string","title":"Reason","description":"Refund reason: defective, wrong_item, not_as_described, customer_request, duplicate_order, other"},"reason_note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Reason Note","description":"Additional details about the refund reason"},"amount":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Amount","description":"Refund amount in cents (required for partial refunds)"}},"type":"object","required":["refund_type","reason"],"title":"CreateRefundRequest","description":"Create refund request schema.","example":{"reason":"customer_request","reason_note":"Customer changed their mind","refund_type":"full"}},"CreateShipmentRequest":{"properties":{"order_id":{"type":"string","format":"uuid","title":"Order Id"},"carrier":{"type":"string","title":"Carrier","description":"Shipping carrier: bosta, manual, mylerz, jt","default":"bosta"},"shipping_method":{"type":"string","title":"Shipping Method","default":"standard"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["order_id"],"title":"CreateShipmentRequest","description":"Create a shipment for an order."},"CreateShippingZoneRequest":{"properties":{"zone":{"type":"string","maxLength":100,"minLength":1,"title":"Zone"},"governorates":{"type":"string","maxLength":500,"minLength":1,"title":"Governorates"},"rate":{"type":"number","minimum":0.0,"title":"Rate"},"estimated_days":{"type":"string","maxLength":50,"minLength":1,"title":"Estimated Days"}},"type":"object","required":["zone","governorates","rate","estimated_days"],"title":"CreateShippingZoneRequest","description":"Create shipping zone request."},"CreateTemplateDTO":{"properties":{"connection_id":{"type":"string","format":"uuid","title":"Connection Id"},"name":{"type":"string","title":"Name"},"category":{"type":"string","title":"Category"},"language":{"type":"string","title":"Language"},"header":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"footer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Footer"},"buttons":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Buttons"}},"type":"object","required":["connection_id","name","category","language"],"title":"CreateTemplateDTO","description":"Request DTO for creating WhatsApp template."},"CreateTransferRequest":{"properties":{"from_location_id":{"type":"string","format":"uuid","title":"From Location Id"},"to_location_id":{"type":"string","format":"uuid","title":"To Location Id"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"carrier_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Carrier Reference"},"lines":{"items":{"$ref":"#/components/schemas/TransferLineInput"},"type":"array","title":"Lines"}},"type":"object","required":["from_location_id","to_location_id"],"title":"CreateTransferRequest"},"CreateUpsellRuleRequest":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name","description":"Rule display name"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the rule is active","default":true},"trigger_type":{"type":"string","title":"Trigger Type","description":"Trigger type: product, category, cart_value, or any","default":"any"},"trigger_product_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Trigger Product Ids","description":"Product UUIDs that trigger this upsell"},"trigger_category_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Trigger Category Ids","description":"Category UUIDs that trigger this upsell"},"trigger_min_cart_value":{"type":"integer","minimum":0.0,"title":"Trigger Min Cart Value","description":"Minimum cart value in cents","default":0},"offer_product_id":{"type":"string","title":"Offer Product Id","description":"UUID of the product to upsell"},"discount_type":{"type":"string","title":"Discount Type","description":"Discount type: percentage, fixed, or none","default":"percentage"},"discount_value":{"type":"integer","minimum":0.0,"title":"Discount Value","description":"Discount value (percentage 0-100 or fixed in cents)","default":0},"priority":{"type":"integer","title":"Priority","description":"Priority (higher = shown first)","default":0},"max_uses":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Uses","description":"Maximum uses (null = unlimited)"},"headline_ar":{"type":"string","maxLength":200,"title":"Headline Ar","description":"Arabic headline","default":"عرض خاص لك! 🎁"},"headline_en":{"type":"string","maxLength":200,"title":"Headline En","description":"English headline","default":"Special offer for you! 🎁"},"description_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description Ar","description":"Arabic description"},"description_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description En","description":"English description"}},"type":"object","required":["name","offer_product_id"],"title":"CreateUpsellRuleRequest","description":"Create upsell rule request schema.","example":{"discount_type":"percentage","discount_value":20,"headline_ar":"عرض خاص لك! 🎁","headline_en":"Special offer for you! 🎁","name":"Buy X get Y 20% off","offer_product_id":"660e8400-e29b-41d4-a716-446655440000","priority":10,"trigger_product_ids":["550e8400-e29b-41d4-a716-446655440000"],"trigger_type":"product"}},"CreateVariantRequest":{"properties":{"option_values":{"additionalProperties":{"type":"string"},"type":"object","title":"Option Values"},"price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Price"},"price_currency":{"type":"string","maxLength":3,"title":"Price Currency","default":"EGP"},"compare_at_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Compare At Price"},"cost_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Cost Price"},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sku"},"barcode":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Barcode"},"inventory_quantity":{"type":"integer","minimum":0.0,"title":"Inventory Quantity","default":0},"image_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Image Url"},"weight_g":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Weight G"},"position":{"type":"integer","minimum":0.0,"title":"Position","default":0},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"fulfillment_type":{"$ref":"#/components/schemas/FulfillmentType","default":"physical"},"requires_shipping":{"type":"boolean","title":"Requires Shipping","default":true},"track_inventory":{"type":"boolean","title":"Track Inventory","default":true}},"type":"object","required":["price"],"title":"CreateVariantRequest","description":"POST body. `price` is required, EGP-majors; everything else\noptional with sensible defaults."},"CreateZoneRequest":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"name_ar":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name Ar"},"governorate_codes":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Governorate Codes","description":"ISO 3166-2 codes the zone covers"},"estimated_days_min":{"type":"integer","maximum":365.0,"minimum":0.0,"title":"Estimated Days Min","default":2},"estimated_days_max":{"type":"integer","maximum":365.0,"minimum":0.0,"title":"Estimated Days Max","default":5},"cod_enabled":{"type":"boolean","title":"Cod Enabled","default":true},"cod_fee_cents":{"type":"integer","minimum":0.0,"title":"Cod Fee Cents","default":0},"is_active":{"type":"boolean","title":"Is Active","default":true},"sort_order":{"type":"integer","title":"Sort Order","default":0}},"additionalProperties":false,"type":"object","required":["name","governorate_codes"],"title":"CreateZoneRequest"},"CustomFieldSetting":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id"},"label":{"type":"string","maxLength":80,"minLength":1,"title":"Label"},"label_ar":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Label Ar"},"type":{"type":"string","title":"Type","description":"text | textarea | number | select | checkbox"},"required":{"type":"boolean","title":"Required","default":false},"placeholder":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Placeholder"},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"position":{"type":"integer","title":"Position","default":0}},"type":"object","required":["label","type"],"title":"CustomFieldSetting"},"CustomerAnalyticsResponse":{"properties":{"total_customers":{"type":"integer","title":"Total Customers"},"new_customers":{"type":"integer","title":"New Customers"},"returning_customers":{"type":"integer","title":"Returning Customers"},"avg_customer_value":{"type":"integer","title":"Avg Customer Value"}},"type":"object","required":["total_customers","new_customers","returning_customers","avg_customer_value"],"title":"CustomerAnalyticsResponse","description":"Customer analytics."},"CustomerHealthItem":{"properties":{"customer_id":{"type":"string","format":"uuid","title":"Customer Id"},"name":{"type":"string","title":"Name"},"score":{"type":"integer","title":"Score"},"state":{"type":"string","title":"State"},"orders":{"type":"integer","title":"Orders"},"total_spent_cents":{"type":"integer","title":"Total Spent Cents"},"days_since_last":{"type":"integer","title":"Days Since Last"}},"type":"object","required":["customer_id","name","score","state","orders","total_spent_cents","days_since_last"],"title":"CustomerHealthItem"},"CustomerHealthResponse":{"properties":{"distribution":{"items":{"$ref":"#/components/schemas/HealthStateCount"},"type":"array","title":"Distribution"},"median_gap_days":{"type":"number","title":"Median Gap Days"},"customers":{"items":{"$ref":"#/components/schemas/CustomerHealthItem"},"type":"array","title":"Customers"}},"type":"object","required":["distribution","median_gap_days","customers"],"title":"CustomerHealthResponse"},"CustomerResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Customer UUID"},"store_id":{"type":"string","title":"Store Id","description":"Store UUID this customer belongs to"},"email":{"type":"string","title":"Email","description":"Customer email address"},"first_name":{"type":"string","title":"First Name","description":"First name"},"last_name":{"type":"string","title":"Last Name","description":"Last name"},"full_name":{"type":"string","title":"Full Name","description":"Concatenated full name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Phone number"},"accepts_marketing":{"type":"boolean","title":"Accepts Marketing","description":"Marketing opt-in","default":false},"is_verified":{"type":"boolean","title":"Is Verified","description":"Whether email is verified","default":false},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location","description":"Merchant-captured city / governorate (from metadata)"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url","description":"Customer photo (adopted from a linked conversation)"},"total_orders":{"type":"integer","title":"Total Orders","description":"Lifetime order count","default":0},"total_spent":{"type":"integer","title":"Total Spent","description":"Lifetime spend in cents","default":0},"default_address_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Address Id","description":"Default address UUID"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO 8601 creation timestamp"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"ISO 8601 last-update timestamp"}},"type":"object","required":["id","store_id","email","first_name","last_name","full_name"],"title":"CustomerResponse","description":"Customer response schema.","example":{"accepts_marketing":true,"created_at":"2025-01-05T09:00:00Z","email":"ahmed@example.com","first_name":"Ahmed","full_name":"Ahmed Hassan","id":"990e8400-e29b-41d4-a716-446655440000","is_verified":true,"last_name":"Hassan","phone":"+201234567890","store_id":"660e8400-e29b-41d4-a716-446655440000","total_orders":5,"total_spent":125000,"updated_at":"2025-02-10T14:00:00Z"}},"CustomerSegmentsResponse":{"properties":{"segments":{"items":{"$ref":"#/components/schemas/RFMSegmentItem"},"type":"array","title":"Segments"},"cohorts":{"items":{"$ref":"#/components/schemas/CohortRow"},"type":"array","title":"Cohorts"},"clv":{"$ref":"#/components/schemas/CLVStats"}},"type":"object","required":["segments","cohorts","clv"],"title":"CustomerSegmentsResponse"},"CustomerTrustStatsResponse":{"properties":{"has_data":{"type":"boolean","title":"Has Data"},"network_orders":{"type":"integer","title":"Network Orders"},"network_rtos":{"type":"integer","title":"Network Rtos"},"network_deliveries":{"type":"integer","title":"Network Deliveries"},"network_refunds":{"type":"integer","title":"Network Refunds"},"contributing_store_count":{"type":"integer","title":"Contributing Store Count"},"rto_rate_pct":{"type":"number","title":"Rto Rate Pct"},"delivery_rate_pct":{"type":"number","title":"Delivery Rate Pct"},"risk_score":{"type":"integer","title":"Risk Score"},"risk_label":{"type":"string","title":"Risk Label"},"confidence":{"type":"string","title":"Confidence"},"last_order_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Order At"},"last_rto_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Rto At"},"recommendation":{"type":"string","title":"Recommendation"}},"type":"object","required":["has_data","network_orders","network_rtos","network_deliveries","network_refunds","contributing_store_count","rto_rate_pct","delivery_rate_pct","risk_score","risk_label","confidence","last_order_at","last_rto_at","recommendation"],"title":"CustomerTrustStatsResponse","description":"Customer COD trust network statistics."},"CustomizationFooter":{"properties":{"footer_text":{"type":"string","title":"Footer Text","default":""},"social_links":{"$ref":"#/components/schemas/CustomizationSocialLinks"},"show_newsletter":{"type":"boolean","title":"Show Newsletter","default":true}},"type":"object","title":"CustomizationFooter","description":"Store footer customization."},"CustomizationHeader":{"properties":{"nav_layout":{"type":"string","title":"Nav Layout","default":"left-aligned"},"show_search_bar":{"type":"boolean","title":"Show Search Bar","default":true},"show_cart_icon":{"type":"boolean","title":"Show Cart Icon","default":true},"announcement_text":{"type":"string","title":"Announcement Text","default":""},"announcement_color":{"type":"string","title":"Announcement Color","default":"#4318FF"},"announcement_text_color":{"type":"string","title":"Announcement Text Color","default":"#FFFFFF"}},"type":"object","title":"CustomizationHeader","description":"Store header customization."},"CustomizationHero":{"properties":{"hero_image_url":{"type":"string","title":"Hero Image Url","default":""},"headline":{"type":"string","title":"Headline","default":""},"subtitle":{"type":"string","title":"Subtitle","default":""},"cta_text":{"type":"string","title":"Cta Text","default":""},"cta_link":{"type":"string","title":"Cta Link","default":""}},"type":"object","title":"CustomizationHero","description":"Store hero/banner customization."},"CustomizationIdentity":{"properties":{"logo_url":{"type":"string","title":"Logo Url","default":""},"store_name":{"type":"string","title":"Store Name","default":""},"favicon_url":{"type":"string","title":"Favicon Url","default":""},"logo_footer_url":{"type":"string","title":"Logo Footer Url","default":""},"logo_dark_url":{"type":"string","title":"Logo Dark Url","default":""},"logo_alt_text":{"type":"string","title":"Logo Alt Text","default":""},"logo_link_target":{"type":"string","title":"Logo Link Target","default":"/"},"logo_width_desktop":{"type":"integer","title":"Logo Width Desktop","default":0},"logo_width_mobile":{"type":"integer","title":"Logo Width Mobile","default":0},"logo_footer_width_desktop":{"type":"integer","title":"Logo Footer Width Desktop","default":0},"logo_footer_width_mobile":{"type":"integer","title":"Logo Footer Width Mobile","default":0},"logo_padding":{"type":"integer","title":"Logo Padding","default":0},"logo_background_color":{"type":"string","title":"Logo Background Color","default":""},"footer_logo_filter_mode":{"type":"string","title":"Footer Logo Filter Mode","default":"none"}},"type":"object","title":"CustomizationIdentity","description":"Store identity customization.\n\nLogo model (Shopify-parity):\n  * ``logo_url`` — primary logo (header, light backgrounds)\n  * ``logo_dark_url`` — variant for dark surfaces (fallback for footer)\n  * ``logo_footer_url`` — explicit footer override (wins over ``logo_dark_url``)\n  * ``footer_logo_filter_mode`` — ``none`` (default) | ``white`` | ``invert``\nWidths are pixel numbers; ``0`` means use the theme's default / natural size."},"CustomizationLabels":{"properties":{"home_title":{"type":"string","title":"Home Title","default":""},"products_title":{"type":"string","title":"Products Title","default":""},"checkout_title":{"type":"string","title":"Checkout Title","default":""},"order_confirmed_title":{"type":"string","title":"Order Confirmed Title","default":""},"cart_empty":{"type":"string","title":"Cart Empty","default":""},"search_placeholder":{"type":"string","title":"Search Placeholder","default":""},"add_to_cart":{"type":"string","title":"Add To Cart","default":""},"added_to_cart":{"type":"string","title":"Added To Cart","default":""},"continue_shopping":{"type":"string","title":"Continue Shopping","default":""},"footer_shop_heading":{"type":"string","title":"Footer Shop Heading","default":""},"footer_help_heading":{"type":"string","title":"Footer Help Heading","default":""},"footer_contact_heading":{"type":"string","title":"Footer Contact Heading","default":""}},"type":"object","title":"CustomizationLabels","description":"Store label customization."},"CustomizationLayout":{"properties":{"header_layout":{"type":"string","title":"Header Layout","default":"logo-right"},"footer_layout":{"type":"string","title":"Footer Layout","default":"4-col"},"footer_columns":{"type":"integer","title":"Footer Columns","default":4},"home_sections":{"items":{"type":"string"},"type":"array","title":"Home Sections"},"hero_position":{"type":"string","title":"Hero Position","default":"top"},"product_card_style":{"type":"string","title":"Product Card Style","default":"default"}},"type":"object","title":"CustomizationLayout","description":"Store page layout customization."},"CustomizationNavLink":{"properties":{"label":{"type":"string","title":"Label","default":""},"to":{"type":"string","title":"To","default":""}},"type":"object","title":"CustomizationNavLink","description":"Navigation link."},"CustomizationNavigation":{"properties":{"links":{"items":{"$ref":"#/components/schemas/CustomizationNavLink"},"type":"array","title":"Links"},"show_categories_in_nav":{"type":"boolean","title":"Show Categories In Nav","default":true}},"type":"object","title":"CustomizationNavigation","description":"Store navigation customization."},"CustomizationProducts":{"properties":{"layout":{"type":"string","title":"Layout","default":"grid"},"products_per_row":{"type":"integer","maximum":4.0,"minimum":2.0,"title":"Products Per Row","default":3},"show_price":{"type":"boolean","title":"Show Price","default":true},"show_rating":{"type":"boolean","title":"Show Rating","default":true},"image_aspect":{"type":"string","title":"Image Aspect","default":"portrait"}},"type":"object","title":"CustomizationProducts","description":"Store products section customization."},"CustomizationResponse":{"properties":{"customization_mode":{"type":"string","title":"Customization Mode","default":"preset"},"identity":{"$ref":"#/components/schemas/CustomizationIdentity"},"theme":{"$ref":"#/components/schemas/CustomizationTheme"},"header":{"$ref":"#/components/schemas/CustomizationHeader"},"hero":{"$ref":"#/components/schemas/CustomizationHero"},"products":{"$ref":"#/components/schemas/CustomizationProducts"},"footer":{"$ref":"#/components/schemas/CustomizationFooter"},"navigation":{"$ref":"#/components/schemas/CustomizationNavigation"},"labels":{"$ref":"#/components/schemas/CustomizationLabels"},"layout":{"$ref":"#/components/schemas/CustomizationLayout"},"is_published":{"type":"boolean","title":"Is Published","default":false},"last_published_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Published At"},"schema_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Schema Version"},"templates":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Templates"},"external_theme_merchant_settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"External Theme Merchant Settings"}},"type":"object","title":"CustomizationResponse","description":"Full customization settings response."},"CustomizationSocialLinks":{"properties":{"facebook":{"type":"string","title":"Facebook","default":""},"instagram":{"type":"string","title":"Instagram","default":""},"twitter":{"type":"string","title":"Twitter","default":""},"whatsapp":{"type":"string","title":"Whatsapp","default":""}},"type":"object","title":"CustomizationSocialLinks","description":"Social media links."},"CustomizationTheme":{"properties":{"base_theme":{"type":"string","title":"Base Theme","default":"modern"},"primary_color":{"type":"string","title":"Primary Color","default":""},"secondary_color":{"type":"string","title":"Secondary Color","default":""},"accent_color":{"type":"string","title":"Accent Color","default":""},"background_color":{"type":"string","title":"Background Color","default":""},"text_color":{"type":"string","title":"Text Color","default":""},"button_style":{"type":"string","title":"Button Style","default":"rounded"},"enable_animations":{"type":"boolean","title":"Enable Animations","default":true},"border_radius":{"type":"integer","title":"Border Radius","default":12},"heading_font":{"type":"string","title":"Heading Font","default":"Cairo"},"nav_style":{"type":"string","title":"Nav Style","default":"floating"}},"type":"object","title":"CustomizationTheme","description":"Store theme customization."},"CustomizeDraftRequest":{"properties":{"draft_customization":{"additionalProperties":true,"type":"object","title":"Draft Customization","description":"Draft customization settings (not yet live)"}},"type":"object","required":["draft_customization"],"title":"CustomizeDraftRequest","description":"Request to save draft customization for an installation.","example":{"draft_customization":{"header":{"sticky":true},"theme":{"primaryColor":"#ff6b6b"}}}},"DailyAnalytics":{"properties":{"day":{"type":"string","format":"date","title":"Day"},"impressions":{"type":"integer","title":"Impressions","default":0},"clicks":{"type":"integer","title":"Clicks","default":0},"dismissals":{"type":"integer","title":"Dismissals","default":0},"redemptions":{"type":"integer","title":"Redemptions","default":0},"conversions":{"type":"integer","title":"Conversions","default":0},"revenue_cents":{"type":"integer","title":"Revenue Cents","default":0}},"additionalProperties":false,"type":"object","required":["day"],"title":"DailyAnalytics","description":"Per-day aggregate row inside the analytics response."},"DashboardTopProductResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"quantity_sold":{"type":"integer","title":"Quantity Sold"},"revenue":{"type":"integer","title":"Revenue"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"}},"type":"object","required":["id","name","sku","quantity_sold","revenue"],"title":"DashboardTopProductResponse","description":"Top product response (dashboard view)."},"DeadLetter":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"store_id":{"type":"string","format":"uuid","title":"Store Id"},"phone":{"type":"string","title":"Phone"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Template Id"},"template_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Template Params"},"text_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Message"},"originating_context":{"type":"string","enum":["order_created","order_paid","order_status_changed","campaign","scheduled_send","abandoned_cart","ad_hoc"],"title":"Originating Context"},"originating_context_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Originating Context Id"},"error_history":{"items":{"$ref":"#/components/schemas/DeadLetterError"},"type":"array","title":"Error History"},"error_classification":{"type":"string","enum":["retriable_exhausted","non_retriable"],"title":"Error Classification"},"final_error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Error Code"},"replay_state":{"type":"string","enum":["not_replayed","replaying","replayed_success","replayed_failed"],"title":"Replay State"},"replayed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Replayed At"},"replayed_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Replayed By"},"replayed_send_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Replayed Send Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","store_id","phone","originating_context","error_history","error_classification","replay_state","created_at"],"title":"DeadLetter","description":"A row returned by GET /whatsapp/dead-letters."},"DeadLetterError":{"properties":{"attempt_n":{"type":"integer","title":"Attempt N"},"at":{"type":"string","format":"date-time","title":"At"},"http_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Http Status"},"meta_error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Error Code"},"error_message":{"type":"string","title":"Error Message"}},"type":"object","required":["attempt_n","at","error_message"],"title":"DeadLetterError","description":"One row inside `error_history`."},"DeadStockBucket":{"properties":{"label":{"type":"string","title":"Label"},"products":{"type":"integer","title":"Products"},"units":{"type":"integer","title":"Units"},"value_cents":{"type":"integer","title":"Value Cents"}},"type":"object","required":["label","products","units","value_cents"],"title":"DeadStockBucket"},"DeadStockProductItem":{"properties":{"product_id":{"type":"string","title":"Product Id"},"name":{"type":"string","title":"Name"},"quantity":{"type":"integer","title":"Quantity"},"value_cents":{"type":"integer","title":"Value Cents"},"days_since_last_sale":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Since Last Sale"}},"type":"object","required":["product_id","name","quantity","value_cents","days_since_last_sale"],"title":"DeadStockProductItem"},"DefaultTemplateResponse":{"properties":{"event_type":{"type":"string","title":"Event Type"},"language":{"type":"string","enum":["ar","en"],"title":"Language"},"subject":{"type":"string","title":"Subject"},"html_body":{"type":"string","title":"Html Body"}},"type":"object","required":["event_type","language","subject","html_body"],"title":"DefaultTemplateResponse","description":"Registry-default subject + body for one (event_type, language)."},"DeleteAssetRequest":{"properties":{"key":{"type":"string","maxLength":1024,"minLength":1,"title":"Key"}},"type":"object","required":["key"],"title":"DeleteAssetRequest","description":"Delete an uploaded asset by its object key."},"DeleteImageRequest":{"properties":{"image_url":{"type":"string","title":"Image Url","description":"URL of the image to delete"}},"type":"object","required":["image_url"],"title":"DeleteImageRequest","description":"Delete image request schema.","example":{"image_url":"https://cdn.numu.com/products/img-001.jpg"}},"DigestContent":{"properties":{"headline":{"type":"string","title":"Headline"},"highlights":{"items":{"type":"string"},"type":"array","title":"Highlights"},"has_sales":{"type":"boolean","title":"Has Sales"},"nudge":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nudge"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"}},"type":"object","required":["headline","highlights","has_sales","period_start","period_end"],"title":"DigestContent"},"DigestSettings":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"channels":{"items":{"type":"string","enum":["email","whatsapp"]},"type":"array","title":"Channels","default":["email"]}},"type":"object","title":"DigestSettings"},"DiscardDraftResponse":{"properties":{"published":{"additionalProperties":true,"type":"object","title":"Published"}},"type":"object","required":["published"],"title":"DiscardDraftResponse"},"DiscountCodeContent":{"properties":{"surface":{"type":"string","const":"discount_code","title":"Surface","default":"discount_code"}},"additionalProperties":false,"type":"object","title":"DiscountCodeContent","description":"Code-based promo: code lives on the linked Coupon. No extra config."},"DiscountRule":{"properties":{"kind":{"$ref":"#/components/schemas/DiscountRuleKind"},"value_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Value Cents"},"value_percent":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Value Percent"},"min_subtotal_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Min Subtotal Cents"},"max_discount_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Discount Cents"},"buy_quantity":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Buy Quantity"},"get_quantity":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Get Quantity"},"get_discount_percent":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Get Discount Percent"},"tiers":{"items":{"$ref":"#/components/schemas/DiscountTier"},"type":"array","title":"Tiers"},"multibuy_quantity":{"anyOf":[{"type":"integer","minimum":2.0},{"type":"null"}],"title":"Multibuy Quantity"},"multibuy_price_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Multibuy Price Cents"},"multibuy_tiers":{"items":{"$ref":"#/components/schemas/MultibuyTier"},"type":"array","title":"Multibuy Tiers"},"bundle_legs":{"items":{"$ref":"#/components/schemas/BundleLeg"},"type":"array","title":"Bundle Legs"},"bundle_price_cents":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Bundle Price Cents"}},"type":"object","required":["kind"],"title":"DiscountRule","description":"Frozen value object — the math for one discount.\n\nFields are a superset across all kinds; `_validate_kind_fields`\nenforces which fields each kind requires. Validation never reaches\nthe database."},"DiscountRuleKind":{"type":"string","enum":["percentage","fixed","free_shipping","bogo","tiered","multibuy","bundle"],"title":"DiscountRuleKind","description":"Kinds of discount math the rule can perform."},"DiscountTier":{"properties":{"threshold_cents":{"type":"integer","minimum":0.0,"title":"Threshold Cents"},"percent":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Percent"}},"type":"object","required":["threshold_cents","percent"],"title":"DiscountTier","description":"One step of a tiered discount: 'spend X, get Y%'."},"DisplayFrequency":{"type":"string","enum":["once_per_session","once_per_visitor","every_visit","until_dismissed","until_redeemed"],"title":"DisplayFrequency","description":"How often the same shopper should see a given display."},"DisplayTrigger":{"type":"string","enum":["on_load","on_delay","on_scroll_pct","on_exit_intent","on_add_to_cart","always"],"title":"DisplayTrigger","description":"Customer-side event that fires a popup / banner display."},"DuplicateThemeRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Name","description":"Label for the copy. Defaults to 'Copy of <source name>'."}},"type":"object","title":"DuplicateThemeRequest","description":"Request to duplicate a theme installation into a new draft copy.","example":{"name":"Copy of Bazar"}},"EmailEventResponse":{"properties":{"event_type":{"type":"string","title":"Event Type","description":"Stable event identifier"},"label_en":{"type":"string","title":"Label En","description":"Human label in English"},"label_ar":{"type":"string","title":"Label Ar","description":"Human label in Arabic"},"variables":{"additionalProperties":{"type":"string"},"type":"object","title":"Variables","description":"Variable name → description map"},"sample_data":{"additionalProperties":true,"type":"object","title":"Sample Data","description":"Sample values used for previews"},"default_subject_en":{"type":"string","title":"Default Subject En","description":"Registry default English subject"},"default_subject_ar":{"type":"string","title":"Default Subject Ar","description":"Registry default Arabic subject"}},"type":"object","required":["event_type","label_en","label_ar","default_subject_en","default_subject_ar"],"title":"EmailEventResponse","description":"Registry entry for a single email event."},"EmailTemplateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"store_id":{"type":"string","format":"uuid","title":"Store Id"},"event_type":{"type":"string","title":"Event Type"},"language":{"type":"string","title":"Language"},"name":{"type":"string","title":"Name"},"subject":{"type":"string","title":"Subject"},"html_body":{"type":"string","title":"Html Body"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"from_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Name"},"reply_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reply To"},"extra_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Data"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","store_id","event_type","language","name","subject","html_body","is_enabled","from_name","reply_to","extra_data","created_at","updated_at"],"title":"EmailTemplateResponse","description":"Read-shape returned for a single template."},"EmbeddedSignupConfig":{"properties":{"app_id":{"type":"string","title":"App Id"},"config_id":{"type":"string","title":"Config Id"},"graph_api_version":{"type":"string","title":"Graph Api Version"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["app_id","config_id","graph_api_version"],"title":"EmbeddedSignupConfig","description":"Config returned to frontend for Meta Embedded Signup JS SDK."},"EmbeddedSignupRequest":{"properties":{"code":{"type":"string","minLength":1,"title":"Code"},"waba_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Waba Id"},"phone_number_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Phone Number Id"},"business_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Business Id"}},"type":"object","required":["code"],"title":"EmbeddedSignupRequest","description":"Code received from Meta's embedded signup callback."},"EmbeddedSignupResponse":{"properties":{"connected":{"type":"boolean","title":"Connected"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"waba_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waba Id"}},"type":"object","required":["connected"],"title":"EmbeddedSignupResponse","description":"Result of completing embedded signup."},"ExecutiveGauges":{"properties":{"revenue":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Revenue"},"profit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profit"},"store":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Store"},"marketing":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Marketing"},"inventory":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Inventory"},"customer":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Customer"}},"type":"object","required":["revenue","profit","store","marketing","inventory","customer"],"title":"ExecutiveGauges"},"ExecutiveResponse":{"properties":{"briefing":{"type":"string","title":"Briefing"},"problems":{"items":{"$ref":"#/components/schemas/SignalItem"},"type":"array","title":"Problems"},"opportunities":{"items":{"$ref":"#/components/schemas/SignalItem"},"type":"array","title":"Opportunities"},"gauges":{"$ref":"#/components/schemas/ExecutiveGauges"},"weekly_priorities":{"items":{"$ref":"#/components/schemas/SignalItem"},"type":"array","title":"Weekly Priorities"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["briefing","problems","opportunities","gauges","weekly_priorities","generated_at"],"title":"ExecutiveResponse"},"ExternalThemeInfoResponse":{"properties":{"has_external_theme":{"type":"boolean","title":"Has External Theme"},"theme_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Id"},"bundle_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bundle Url"},"css_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Css Url"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"source_repo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Repo"},"built_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Built At"}},"type":"object","required":["has_external_theme"],"title":"ExternalThemeInfoResponse","description":"Response with current external theme info for a store."},"FawaterakCredentialsResponse":{"properties":{"is_configured":{"type":"boolean","title":"Is Configured"},"api_key_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Masked"},"vendor_key_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Key Masked"},"environment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Environment"},"last_configured":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Configured"}},"type":"object","required":["is_configured"],"title":"FawaterakCredentialsResponse","description":"Fawaterak credentials status (masked, never returns real keys)."},"FloatingWidgetContent":{"properties":{"surface":{"type":"string","const":"floating_widget","title":"Surface","default":"floating_widget"},"position":{"type":"string","enum":["bottom-right","bottom-left","top-right","top-left"],"title":"Position","default":"bottom-right"},"icon":{"type":"string","title":"Icon","default":"tag"},"expanded_default":{"type":"boolean","title":"Expanded Default","default":false},"color_bg":{"type":"string","title":"Color Bg","default":"#000000"},"auto_apply_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Auto Apply Code"}},"additionalProperties":false,"type":"object","title":"FloatingWidgetContent","description":"Sticky in-corner widget config."},"ForecastMetadataResponse":{"properties":{"status":{"type":"string","title":"Status"},"days_available":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Available"},"days_required":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Required"},"horizon_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Horizon Days"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"},"avg_daily_revenue_7d":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Daily Revenue 7D"},"forecast_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Forecast Total"},"forecast_daily_avg":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Forecast Daily Avg"},"trend":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trend"},"message_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message En"},"message_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Ar"}},"type":"object","required":["status"],"title":"ForecastMetadataResponse"},"ForecastPointResponse":{"properties":{"date":{"type":"string","title":"Date"},"predicted":{"type":"integer","title":"Predicted"},"lower":{"type":"integer","title":"Lower"},"upper":{"type":"integer","title":"Upper"}},"type":"object","required":["date","predicted","lower","upper"],"title":"ForecastPointResponse"},"ForecastResponse":{"properties":{"historical":{"items":{"$ref":"#/components/schemas/HistoricalPointResponse"},"type":"array","title":"Historical"},"forecast":{"items":{"$ref":"#/components/schemas/ForecastPointResponse"},"type":"array","title":"Forecast"},"metadata":{"$ref":"#/components/schemas/ForecastMetadataResponse"}},"type":"object","required":["historical","forecast","metadata"],"title":"ForecastResponse"},"FreeShippingProgressResponse":{"properties":{"current_cents":{"type":"integer","title":"Current Cents"},"threshold_cents":{"type":"integer","title":"Threshold Cents"},"remaining_cents":{"type":"integer","title":"Remaining Cents"},"qualified":{"type":"boolean","title":"Qualified"}},"type":"object","required":["current_cents","threshold_cents","remaining_cents","qualified"],"title":"FreeShippingProgressResponse"},"FulfillmentTimeStats":{"properties":{"avg_hours":{"type":"number","title":"Avg Hours"},"p50_hours":{"type":"number","title":"P50 Hours"},"p95_hours":{"type":"number","title":"P95 Hours"}},"type":"object","required":["avg_hours","p50_hours","p95_hours"],"title":"FulfillmentTimeStats"},"FulfillmentType":{"type":"string","enum":["physical","digital","service"],"title":"FulfillmentType"},"FunnelStepResponse":{"properties":{"step":{"type":"string","title":"Step"},"count":{"type":"integer","title":"Count"},"drop_off_pct":{"type":"number","title":"Drop Off Pct"}},"type":"object","required":["step","count","drop_off_pct"],"title":"FunnelStepResponse"},"FunnelTrendPoint":{"properties":{"date":{"type":"string","title":"Date"},"conversion_rate":{"type":"number","title":"Conversion Rate"}},"type":"object","required":["date","conversion_rate"],"title":"FunnelTrendPoint"},"GatewayBreakdownResponse":{"properties":{"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"},"rows":{"items":{"$ref":"#/components/schemas/GatewayBreakdownRow"},"type":"array","title":"Rows"},"total_successful_cents":{"type":"integer","title":"Total Successful Cents"},"total_failed_cents":{"type":"integer","title":"Total Failed Cents"}},"type":"object","required":["period_start","period_end","rows","total_successful_cents","total_failed_cents"],"title":"GatewayBreakdownResponse"},"GatewayBreakdownRow":{"properties":{"gateway":{"type":"string","title":"Gateway"},"status":{"type":"string","title":"Status"},"count":{"type":"integer","title":"Count"},"total_cents":{"type":"integer","title":"Total Cents"},"currency":{"type":"string","title":"Currency"}},"type":"object","required":["gateway","status","count","total_cents","currency"],"title":"GatewayBreakdownRow","description":"One row per gateway in a date-window payment summary.\n\nSurfaces InstaPay volume alongside Paymob/Fawry/Kashier/Fawaterak/COD\nso merchants can reconcile each rail independently."},"GeoLocationItem":{"properties":{"location":{"type":"string","title":"Location"},"orders":{"type":"integer","title":"Orders"},"revenue":{"type":"integer","title":"Revenue"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["location","orders","revenue","percentage"],"title":"GeoLocationItem"},"GiftCardResponse":{"properties":{"id":{"type":"string","title":"Id"},"last_four":{"type":"string","title":"Last Four"},"initial_balance_cents":{"type":"integer","title":"Initial Balance Cents"},"current_balance_cents":{"type":"integer","title":"Current Balance Cents"},"currency":{"type":"string","title":"Currency"},"status":{"type":"string","title":"Status"},"customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"},"issued_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issued By User Id"},"issuing_order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuing Order Id"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","last_four","initial_balance_cents","current_balance_cents","currency","status","created_at","updated_at"],"title":"GiftCardResponse"},"GiftCardStatus":{"type":"string","enum":["active","depleted","expired","voided"],"title":"GiftCardStatus"},"GiftCardTransactionResponse":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"amount_cents":{"type":"integer","title":"Amount Cents"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"actor_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor User Id"},"actor_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Customer Id"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","kind","amount_cents","created_at"],"title":"GiftCardTransactionResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthScoreMetrics":{"properties":{"delivery_success_rate":{"type":"number","title":"Delivery Success Rate"},"cod_acceptance_rate":{"type":"number","title":"Cod Acceptance Rate"},"order_completion_rate":{"type":"number","title":"Order Completion Rate"},"return_rate":{"type":"number","title":"Return Rate"},"avg_response_hours":{"type":"number","title":"Avg Response Hours"}},"type":"object","required":["delivery_success_rate","cod_acceptance_rate","order_completion_rate","return_rate","avg_response_hours"],"title":"HealthScoreMetrics"},"HealthScoreResponse":{"properties":{"score":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Score"},"grade":{"type":"string","title":"Grade"},"insufficient_data":{"type":"boolean","title":"Insufficient Data","default":false},"insufficient_metrics":{"items":{"type":"string"},"type":"array","title":"Insufficient Metrics","default":[]},"metrics":{"$ref":"#/components/schemas/HealthScoreMetrics"},"sub_scores":{"additionalProperties":{"type":"integer"},"type":"object","title":"Sub Scores"},"recommendations":{"items":{"type":"string"},"type":"array","title":"Recommendations"},"orders_analyzed":{"type":"integer","title":"Orders Analyzed"},"shipments_analyzed":{"type":"integer","title":"Shipments Analyzed"},"window_days":{"type":"integer","title":"Window Days","default":90},"empty_state_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Empty State Message"},"requirements":{"items":{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"string"}]},"type":"object"},"type":"array","title":"Requirements","default":[]},"calculated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calculated At"}},"type":"object","required":["score","grade","metrics","sub_scores","recommendations","orders_analyzed","shipments_analyzed","calculated_at"],"title":"HealthScoreResponse"},"HealthStateCount":{"properties":{"state":{"type":"string","title":"State"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["state","count"],"title":"HealthStateCount"},"HistoricalPointResponse":{"properties":{"date":{"type":"string","title":"Date"},"revenue":{"type":"integer","title":"Revenue"},"orders":{"type":"integer","title":"Orders"}},"type":"object","required":["date","revenue","orders"],"title":"HistoricalPointResponse"},"IdentityConfig":{"properties":{"require_verification":{"type":"boolean","title":"Require Verification","default":true},"nudge_enabled":{"type":"boolean","title":"Nudge Enabled","default":true},"nudge_min_items":{"type":"integer","maximum":50.0,"minimum":0.0,"title":"Nudge Min Items","default":1},"nudge_min_value_cents":{"type":"integer","maximum":100000000.0,"minimum":0.0,"title":"Nudge Min Value Cents","default":0},"nudge_delay_seconds":{"type":"integer","maximum":3600.0,"minimum":0.0,"title":"Nudge Delay Seconds","default":45}},"type":"object","title":"IdentityConfig","description":"Phone-first identification layer (checkout OTP gate + save-cart nudge).\n\nBounds keep a typo from becoming a footgun: a 10-hour nudge delay or a\nmillion-pound threshold is a config mistake, not a strategy."},"ImportFromUrlRequest":{"properties":{"urls":{"items":{"type":"string"},"type":"array","maxItems":20,"minItems":1,"title":"Urls","description":"Instagram or Facebook post URLs (max 20 per request)"}},"type":"object","required":["urls"],"title":"ImportFromUrlRequest","description":"Request to import products from Instagram/Facebook post URLs.","example":{"urls":["https://www.instagram.com/p/ABC123/","https://www.instagram.com/p/DEF456/"]}},"ImportFromUrlResponse":{"properties":{"imported":{"type":"integer","title":"Imported"},"results":{"items":{"$ref":"#/components/schemas/UrlImportResultResponse"},"type":"array","title":"Results"}},"type":"object","required":["imported","results"],"title":"ImportFromUrlResponse","description":"Response after importing from URLs."},"ImportPostsRequest":{"properties":{"post_ids":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Post Ids","description":"Platform post IDs to import"}},"type":"object","required":["post_ids"],"title":"ImportPostsRequest","description":"Request to import social posts as products.","example":{"post_ids":["ig_post_1_abc123","ig_post_2_def456"]}},"ImportPostsResponse":{"properties":{"imported":{"type":"integer","title":"Imported"},"product_ids":{"items":{"type":"string"},"type":"array","title":"Product Ids"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["imported","product_ids"],"title":"ImportPostsResponse","description":"Response after importing social posts."},"ImportResultResponse":{"properties":{"total_rows":{"type":"integer","title":"Total Rows"},"created":{"type":"integer","title":"Created"},"updated":{"type":"integer","title":"Updated"},"errors":{"items":{"$ref":"#/components/schemas/ImportRowErrorResponse"},"type":"array","title":"Errors"}},"type":"object","required":["total_rows","created","updated","errors"],"title":"ImportResultResponse","description":"Response for product CSV import."},"ImportRowErrorResponse":{"properties":{"row":{"type":"integer","title":"Row"},"field":{"type":"string","title":"Field"},"message":{"type":"string","title":"Message"}},"type":"object","required":["row","field","message"],"title":"ImportRowErrorResponse","description":"Error detail for a single CSV row."},"InsightNarrativeResponse":{"properties":{"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"top_actions":{"items":{"type":"string"},"type":"array","title":"Top Actions","default":[]},"outlook":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outlook"}},"type":"object","title":"InsightNarrativeResponse"},"InsightSignalResponse":{"properties":{"type":{"type":"string","title":"Type"},"severity":{"type":"string","title":"Severity"},"title_en":{"type":"string","title":"Title En"},"title_ar":{"type":"string","title":"Title Ar"},"body_en":{"type":"string","title":"Body En"},"body_ar":{"type":"string","title":"Body Ar"},"action_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action En"},"action_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Ar"},"metric":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metric"},"current_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Value"},"baseline_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Baseline Value"},"deviation_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Deviation Pct"}},"type":"object","required":["type","severity","title_en","title_ar","body_en","body_ar"],"title":"InsightSignalResponse"},"InsightsResponse":{"properties":{"signals":{"items":{"$ref":"#/components/schemas/InsightSignalResponse"},"type":"array","title":"Signals"},"narrative":{"anyOf":[{"$ref":"#/components/schemas/InsightNarrativeResponse"},{"type":"null"}]},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["signals","generated_at"],"title":"InsightsResponse"},"InstapayCredentialsResponse":{"properties":{"is_configured":{"type":"boolean","title":"Is Configured"},"enabled":{"type":"boolean","title":"Enabled","default":false},"ipa_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ipa Masked"},"ipa_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ipa Display Name"},"fallback_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fallback Phone"},"auto_approve_enabled":{"type":"boolean","title":"Auto Approve Enabled","default":true},"auto_approve_threshold_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Approve Threshold Cents"},"auto_approve_daily_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Approve Daily Cap Cents"},"auto_approve_daily_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Approve Daily Count"},"last_configured":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Configured"},"qr_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qr Image Url"},"qr_link_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qr Link Url"},"ocr_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Provider"},"require_ocr_amount_match":{"type":"boolean","title":"Require Ocr Amount Match","default":false},"require_ocr_ipa_match":{"type":"boolean","title":"Require Ocr Ipa Match","default":false},"ocr_amount_tolerance_bps":{"type":"integer","title":"Ocr Amount Tolerance Bps","default":100},"require_note_contains_reference":{"type":"boolean","title":"Require Note Contains Reference","default":false},"require_transaction_ref_match":{"type":"boolean","title":"Require Transaction Ref Match","default":false},"require_recipient_name_match":{"type":"boolean","title":"Require Recipient Name Match","default":false},"recipient_name_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Name Token"}},"type":"object","required":["is_configured"],"title":"InstapayCredentialsResponse","description":"Masked InstaPay config (the IPA itself is the only sensitive bit)."},"InventoryAnalyticsResponse":{"properties":{"sell_through_pct":{"type":"number","title":"Sell Through Pct"},"units_sold":{"type":"integer","title":"Units Sold"},"units_in_stock":{"type":"integer","title":"Units In Stock"},"abc":{"additionalProperties":{"$ref":"#/components/schemas/AbcClassSummary"},"type":"object","title":"Abc"},"abc_products":{"items":{"$ref":"#/components/schemas/AbcProductItem"},"type":"array","title":"Abc Products"},"dead_stock_buckets":{"items":{"$ref":"#/components/schemas/DeadStockBucket"},"type":"array","title":"Dead Stock Buckets"},"dead_stock_products":{"items":{"$ref":"#/components/schemas/DeadStockProductItem"},"type":"array","title":"Dead Stock Products"},"dead_stock_value_cents":{"type":"integer","title":"Dead Stock Value Cents"},"value_is_cost":{"type":"boolean","title":"Value Is Cost"}},"type":"object","required":["sell_through_pct","units_sold","units_in_stock","abc","abc_products","dead_stock_buckets","dead_stock_products","dead_stock_value_cents","value_is_cost"],"title":"InventoryAnalyticsResponse","description":"Sell-through, ABC classification, and dead-stock aging.\n\n- Sell-through = units sold ÷ (units sold + units still in stock)\n  over the selected window — the standard retail definition.\n- ABC: products ranked by window revenue; A = the head that makes\n  up 80% of revenue, B = the next 15%, C = the tail (incl. products\n  with zero sales).\n- Dead stock: in-stock products with no sale in ≥30 days, bucketed\n  by age of last sale (never-sold products age from their creation\n  date). Value uses cost_price when set, else sale price\n  (``value_is_cost`` tells the UI which caption to show)."},"InventoryHealthResponse":{"properties":{"in_stock":{"type":"integer","title":"In Stock"},"low_stock":{"type":"integer","title":"Low Stock"},"out_of_stock":{"type":"integer","title":"Out Of Stock"},"dead_stock":{"type":"integer","title":"Dead Stock"}},"type":"object","required":["in_stock","low_stock","out_of_stock","dead_stock"],"title":"InventoryHealthResponse"},"InventoryItemResponse":{"properties":{"id":{"type":"string","title":"Id"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"name":{"type":"string","title":"Name"},"quantity":{"type":"integer","title":"Quantity"},"low_stock_threshold":{"type":"integer","title":"Low Stock Threshold"},"is_low_stock":{"type":"boolean","title":"Is Low Stock"},"is_out_of_stock":{"type":"boolean","title":"Is Out Of Stock"},"price":{"type":"integer","title":"Price"},"inventory_value":{"type":"integer","title":"Inventory Value"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","sku","name","quantity","low_stock_threshold","is_low_stock","is_out_of_stock","price","inventory_value","status"],"title":"InventoryItemResponse","description":"Inventory item response."},"InventoryLevelResponse":{"properties":{"id":{"type":"string","title":"Id"},"variant_id":{"type":"string","title":"Variant Id"},"location_id":{"type":"string","title":"Location Id"},"available":{"type":"integer","title":"Available"},"reserved":{"type":"integer","title":"Reserved"}},"type":"object","required":["id","variant_id","location_id","available","reserved"],"title":"InventoryLevelResponse"},"InventoryStatsResponse":{"properties":{"total_products":{"type":"integer","title":"Total Products"},"low_stock_count":{"type":"integer","title":"Low Stock Count"},"out_of_stock_count":{"type":"integer","title":"Out Of Stock Count"},"total_inventory_value":{"type":"integer","title":"Total Inventory Value"},"currency":{"type":"string","title":"Currency"}},"type":"object","required":["total_products","low_stock_count","out_of_stock_count","total_inventory_value","currency"],"title":"InventoryStatsResponse","description":"Inventory statistics response."},"InvoiceLineItemRequest":{"properties":{"description":{"type":"string","minLength":1,"title":"Description"},"description_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description Ar"},"item_code":{"type":"string","title":"Item Code","description":"EGS or GS1 product code"},"item_type":{"type":"string","title":"Item Type","description":"GS1 or EGS","default":"EGS"},"unit_type":{"type":"string","title":"Unit Type","description":"Unit of measure","default":"EA"},"quantity":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Quantity"},"unit_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Unit Price","description":"Price per unit before tax"},"discount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Discount","default":"0"},"vat_rate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Vat Rate","description":"VAT rate percentage","default":"14.00"},"internal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Code","description":"Internal SKU"}},"type":"object","required":["description","item_code","quantity","unit_price"],"title":"InvoiceLineItemRequest","description":"Invoice line item request."},"InvoiceLineItemResponse":{"properties":{"description":{"type":"string","title":"Description"},"description_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description Ar"},"item_type":{"type":"string","title":"Item Type"},"item_code":{"type":"string","title":"Item Code"},"unit_type":{"type":"string","title":"Unit Type"},"quantity":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Quantity"},"unit_price":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Unit Price"},"discount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Discount"},"sales_total":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Sales Total"},"net_total":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Net Total"},"taxes":{"items":{"$ref":"#/components/schemas/TaxLineResponse"},"type":"array","title":"Taxes"},"total":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total"},"internal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Code"}},"type":"object","required":["description","description_ar","item_type","item_code","unit_type","quantity","unit_price","discount","sales_total","net_total","taxes","total","internal_code"],"title":"InvoiceLineItemResponse","description":"Invoice line item response."},"InvoiceListResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"invoice_number":{"type":"string","title":"Invoice Number"},"invoice_type":{"$ref":"#/components/schemas/InvoiceType"},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"date_issued":{"type":"string","format":"date-time","title":"Date Issued"},"buyer_name":{"type":"string","title":"Buyer Name"},"currency":{"type":"string","title":"Currency"},"total":{"type":"integer","title":"Total"},"total_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Formatted"},"eta_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Uuid"},"order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Order Id"},"order_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Number"},"order_payment_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Payment Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","invoice_number","invoice_type","status","date_issued","buyer_name","currency","total","eta_uuid","created_at"],"title":"InvoiceListResponse","description":"Invoice list item (simplified)."},"InvoiceSettingsResponse":{"properties":{"tax_id":{"type":"string","title":"Tax Id","default":""},"name_ar":{"type":"string","title":"Name Ar","default":""},"branch_id":{"type":"string","title":"Branch Id","default":"0"},"activity_code":{"type":"string","title":"Activity Code","default":"4649"},"governorate":{"type":"string","title":"Governorate","default":""},"city":{"type":"string","title":"City","default":""},"street":{"type":"string","title":"Street","default":""},"building_number":{"type":"string","title":"Building Number","default":""}},"type":"object","title":"InvoiceSettingsResponse","description":"Invoice and tax settings for ETA compliance."},"InvoiceStatus":{"type":"string","enum":["draft","pending","submitted","accepted","rejected","cancelled"],"title":"InvoiceStatus","description":"Invoice status for ETA submission workflow."},"InvoiceType":{"type":"string","enum":["I","C","D"],"title":"InvoiceType","description":"Invoice types per ETA classification."},"IssueGiftCardRequest":{"properties":{"initial_balance_cents":{"type":"integer","maximum":10000000.0,"exclusiveMinimum":0.0,"title":"Initial Balance Cents"},"currency":{"type":"string","maxLength":3,"minLength":3,"title":"Currency","default":"EGP"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note"}},"type":"object","required":["initial_balance_cents"],"title":"IssueGiftCardRequest"},"IssueRefundRequest":{"properties":{"amount":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Amount","description":"Refund amount in cents. When omitted, defaults to the return's requested_amount (sum of line item totals)."},"reason_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Reason Note"}},"type":"object","title":"IssueRefundRequest","description":"Optional override of the refund amount (defaults to requested_amount)."},"IssuedGiftCardResponse":{"properties":{"card":{"$ref":"#/components/schemas/GiftCardResponse"},"code":{"type":"string","title":"Code","description":"Plaintext code — only available immediately after issue. Cannot be recovered from the DB once this response is sent. Display to merchant for delivery to customer."}},"type":"object","required":["card","code"],"title":"IssuedGiftCardResponse","description":"Response returned ONLY on issue. Includes plaintext code."},"JourneyResponse":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"touch_count":{"type":"integer","title":"Touch Count"},"touches":{"items":{"$ref":"#/components/schemas/JourneyTouchResponse"},"type":"array","title":"Touches"}},"type":"object","required":["customer_id","touch_count","touches"],"title":"JourneyResponse"},"JourneyTouchResponse":{"properties":{"id":{"type":"string","title":"Id"},"ts":{"type":"string","title":"Ts"},"utm_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Source"},"utm_medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Medium"},"utm_campaign":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Campaign"},"utm_term":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Term"},"utm_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Content"},"gclid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gclid"},"fbclid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fbclid"},"ttclid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ttclid"},"referrer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referrer"},"landing_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Landing Path"},"campaign_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Id"},"campaign_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign Name"},"is_first_touch":{"type":"boolean","title":"Is First Touch"}},"type":"object","required":["id","ts","is_first_touch"],"title":"JourneyTouchResponse","description":"One entry on the customer-journey timeline."},"KashierCredentialsResponse":{"properties":{"is_configured":{"type":"boolean","title":"Is Configured"},"merchant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Id"},"api_key_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Masked"},"apple_pay_enabled":{"type":"boolean","title":"Apple Pay Enabled","default":false},"mode":{"anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}],"title":"Mode"},"last_configured":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Configured"}},"type":"object","required":["is_configured"],"title":"KashierCredentialsResponse","description":"Kashier credentials status (masked, never returns real keys)."},"LandingPageItem":{"properties":{"path":{"type":"string","title":"Path"},"sessions":{"type":"integer","title":"Sessions"}},"type":"object","required":["path","sessions"],"title":"LandingPageItem"},"LinkCustomerDTO":{"properties":{"customer_id":{"type":"string","format":"uuid","title":"Customer Id"}},"type":"object","required":["customer_id"],"title":"LinkCustomerDTO","description":"Request DTO for linking a conversation to a customer."},"LocalizedPromotionContent":{"properties":{"headline":{"anyOf":[{"$ref":"#/components/schemas/LocalizedString"},{"type":"null"}]},"body":{"anyOf":[{"$ref":"#/components/schemas/LocalizedString"},{"type":"null"}]},"cta_label":{"anyOf":[{"$ref":"#/components/schemas/LocalizedString"},{"type":"null"}]},"cta_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cta Url"},"label":{"anyOf":[{"$ref":"#/components/schemas/LocalizedString"},{"type":"null"}]}},"additionalProperties":false,"type":"object","title":"LocalizedPromotionContent","description":"Translatable copy for a single locale of a promotion."},"LocalizedString":{"properties":{"en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"En"},"ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ar"}},"additionalProperties":true,"type":"object","title":"LocalizedString","description":"Immutable value object for storing localized text.\n\nSupports multiple languages with automatic fallback to English\nwhen the requested locale is not available.\n\nExample:\n    name = LocalizedString(en=\"Product Name\", ar=\"اسم المنتج\")\n    print(name.get(\"ar\"))  # اسم المنتج\n    print(name.get(\"fr\"))  # Product Name (falls back to en)"},"LocationPayload":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"address":{"additionalProperties":true,"type":"object","title":"Address"},"fulfills_orders":{"type":"boolean","title":"Fulfills Orders","default":true},"fulfills_pickup":{"type":"boolean","title":"Fulfills Pickup","default":false},"pickup_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pickup Instructions"},"pickup_instructions_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pickup Instructions Ar"},"is_active":{"type":"boolean","title":"Is Active","default":true},"position":{"type":"integer","title":"Position","default":0}},"type":"object","required":["name"],"title":"LocationPayload"},"LocationResponse":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"address":{"additionalProperties":true,"type":"object","title":"Address"},"fulfills_orders":{"type":"boolean","title":"Fulfills Orders","default":true},"fulfills_pickup":{"type":"boolean","title":"Fulfills Pickup","default":false},"pickup_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pickup Instructions"},"pickup_instructions_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pickup Instructions Ar"},"is_active":{"type":"boolean","title":"Is Active","default":true},"position":{"type":"integer","title":"Position","default":0},"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["name","id","created_at","updated_at"],"title":"LocationResponse"},"LtvByChannelResponse":{"properties":{"group_by":{"type":"string","title":"Group By"},"channels":{"items":{"$ref":"#/components/schemas/LtvChannelRow"},"type":"array","title":"Channels"},"totals":{"$ref":"#/components/schemas/LtvByChannelTotals"}},"type":"object","required":["group_by","channels","totals"],"title":"LtvByChannelResponse","description":"LTV by first-touch acquisition channel."},"LtvByChannelTotals":{"properties":{"customer_count":{"type":"integer","title":"Customer Count"},"total_orders":{"type":"integer","title":"Total Orders"},"total_revenue_cents":{"type":"integer","title":"Total Revenue Cents"},"average_ltv_cents":{"type":"integer","title":"Average Ltv Cents"}},"type":"object","required":["customer_count","total_orders","total_revenue_cents","average_ltv_cents"],"title":"LtvByChannelTotals","description":"Overall totals across all channels in the response window."},"LtvChannelRow":{"properties":{"channel":{"type":"string","title":"Channel"},"customer_count":{"type":"integer","title":"Customer Count"},"total_orders":{"type":"integer","title":"Total Orders"},"total_revenue_cents":{"type":"integer","title":"Total Revenue Cents"},"average_order_value_cents":{"type":"integer","title":"Average Order Value Cents"},"orders_per_customer":{"type":"number","title":"Orders Per Customer"},"ltv_cents":{"type":"integer","title":"Ltv Cents"}},"type":"object","required":["channel","customer_count","total_orders","total_revenue_cents","average_order_value_cents","orders_per_customer","ltv_cents"],"title":"LtvChannelRow","description":"One row of LTV-by-channel rollup."},"MarkReceivedRequest":{"properties":{"merchant_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Merchant Note"}},"type":"object","title":"MarkReceivedRequest"},"MarketingAttributionResponse":{"properties":{"channels":{"items":{"$ref":"#/components/schemas/ChannelAttributionItem"},"type":"array","title":"Channels"},"campaigns":{"items":{"$ref":"#/components/schemas/src__api__v1__routes__stores__analytics__CampaignItem"},"type":"array","title":"Campaigns"},"total_visits":{"type":"integer","title":"Total Visits"},"attributed_visits":{"type":"integer","title":"Attributed Visits"},"top_landing_pages":{"items":{"$ref":"#/components/schemas/LandingPageItem"},"type":"array","title":"Top Landing Pages","default":[]},"top_referrers":{"items":{"$ref":"#/components/schemas/ReferrerItem"},"type":"array","title":"Top Referrers","default":[]}},"type":"object","required":["channels","campaigns","total_visits","attributed_visits"],"title":"MarketingAttributionResponse"},"MenuItemSchema":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Stable client id for the item"},"label":{"additionalProperties":{"type":"string"},"type":"object","title":"Label","description":"Bilingual label {en, ar}"},"url":{"type":"string","title":"Url","description":"Resolved destination URL/path","default":""},"type":{"type":"string","title":"Type","description":"Semantic: home|collection|product|page|http|catalog|search|link","default":"link"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id","description":"Optional resource id for the type"},"children":{"items":{"$ref":"#/components/schemas/MenuItemSchema"},"type":"array","title":"Children","description":"Nested sub-items"}},"type":"object","title":"MenuItemSchema","description":"A single navigation item. ``children`` nest up to depth 3."},"MenuResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Menu UUID"},"store_id":{"type":"string","title":"Store Id","description":"Owning store UUID"},"handle":{"type":"string","title":"Handle","description":"Unique handle within the store"},"title":{"additionalProperties":{"type":"string"},"type":"object","title":"Title","description":"Bilingual title {en, ar}"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items","description":"Nested navigation items"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the menu is active"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","title":"Updated At","description":"ISO 8601 last-update timestamp"}},"type":"object","required":["id","store_id","handle","title","items","is_active","created_at","updated_at"],"title":"MenuResponse","description":"Menu response schema."},"MerchantCreateCustomerRequest":{"properties":{"first_name":{"type":"string","maxLength":100,"minLength":1,"title":"First Name","description":"First name"},"last_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Last Name","description":"Last name (optional)"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Phone. Accepts E.164 or {country_code, local}; stored as E.164."},"location":{"type":"string","maxLength":200,"minLength":1,"title":"Location","description":"City / governorate / area the customer ships to"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Email (optional)"},"accepts_marketing":{"type":"boolean","title":"Accepts Marketing","description":"Whether the customer opts in to marketing","default":false},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes","description":"Internal merchant notes"},"tags":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Tags","description":"Customer tags"}},"type":"object","required":["first_name","phone","location"],"title":"MerchantCreateCustomerRequest","description":"Merchant-created customer (no password — the customer can't log in\nuntil they register themselves with the same email on the storefront).\n\nRequired: name + phone + location — matching how Egyptian merchants\nactually capture customers (Instagram/WhatsApp orders). Email is\noptional; when absent, a phone-derived placeholder is stored using the\nsame convention as the CSV importers so dedupe keeps working.","example":{"accepts_marketing":true,"email":"ahmed@example.com","first_name":"Ahmed","last_name":"Hassan","location":"Cairo","notes":"VIP — met at the Cairo pop-up","phone":"+201234567890","tags":["vip","wholesale"]}},"MessageBubble":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"message_id":{"type":"string","title":"Message Id"},"direction":{"type":"string","title":"Direction"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"template_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["id","message_id","direction","status","created_at"],"title":"MessageBubble","description":"Single message in a conversation thread."},"MessageListResponse":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/MessageBubble"},"type":"array","title":"Messages"},"total":{"type":"integer","title":"Total"},"window_open":{"type":"boolean","title":"Window Open","default":false},"window_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Window Expires At"}},"type":"object","required":["messages","total"],"title":"MessageListResponse","description":"Paginated message thread."},"MetaDeliveryHealth":{"properties":{"pending":{"type":"integer","title":"Pending","default":0},"retrying":{"type":"integer","title":"Retrying","default":0},"dead_letter":{"type":"integer","title":"Dead Letter","default":0},"expired":{"type":"integer","title":"Expired","default":0},"failed":{"type":"integer","title":"Failed","default":0},"window_hours":{"type":"integer","title":"Window Hours","default":24}},"type":"object","title":"MetaDeliveryHealth","description":"What the outbox still owes Meta, and what it gave up on.\n\nThe failure rate above is computed over the last 20 rows, so it answers\n\"is this store healthy right now\". These counters answer the question it\ncannot: \"is anything stuck\". A store can show a perfectly clean recent\nwindow while a hundred conversions sit in the retry ladder behind it."},"MetaEventLogEntry":{"properties":{"id":{"type":"string","title":"Id"},"event_id":{"type":"string","title":"Event Id"},"event_name":{"type":"string","title":"Event Name"},"event_time":{"type":"string","format":"date-time","title":"Event Time"},"pixel_id":{"type":"string","title":"Pixel Id"},"response_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Response Status"},"fbtrace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fbtrace Id"},"attempt_count":{"type":"integer","title":"Attempt Count","default":1},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"channel":{"type":"string","enum":["browser","server","both"],"title":"Channel","default":"server"},"request_payload_redacted":{"additionalProperties":true,"type":"object","title":"Request Payload Redacted"}},"type":"object","required":["id","event_id","event_name","event_time","pixel_id","created_at","request_payload_redacted"],"title":"MetaEventLogEntry","description":"One row from the merchant dashboard's \"Recent events\" table.\n\nThe ``request_payload.user_data`` sub-object is **dropped entirely**\nby the route layer before this schema sees it — the dashboard shows\nonly \"hashed ✓\" indicators, not raw or hashed PII.\n\n``channel`` is always ``\"server\"`` today because we only log\nserver-side fires. Wave 2E will fire the browser event with the same\n``event_id``; a follow-up enhancement can join the two and surface\na \"both\" badge here."},"MetaMatchKeyCoverage":{"properties":{"identifier":{"type":"string","title":"Identifier"},"coverage_percentage":{"type":"number","title":"Coverage Percentage"}},"type":"object","required":["identifier","coverage_percentage"],"title":"MetaMatchKeyCoverage","description":"One match key and how many of this event's instances carried it."},"MetaMatchQualityEvent":{"properties":{"event_name":{"type":"string","title":"Event Name"},"pixel_id":{"type":"string","title":"Pixel Id"},"emq_score":{"type":"number","title":"Emq Score","description":"Meta's composite_score, 0.0-10.0"},"emq_week_ago":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Emq Week Ago","description":"The score from the newest snapshot at least 7 days old"},"total_events":{"type":"integer","title":"Total Events","default":0},"dedup_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Dedup Rate"},"event_coverage":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Event Coverage","description":"7-day average % of browser Pixel events also covered by CAPI — Meta measuring the browser-vs-server gap directly."},"data_freshness":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Freshness"},"match_keys":{"items":{"$ref":"#/components/schemas/MetaMatchKeyCoverage"},"type":"array","title":"Match Keys"},"diagnostics":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Diagnostics","description":"Meta's own diagnostics — each names a problem AND states the solution. Rendered verbatim; their copy is better than ours."},"captured_at":{"type":"string","format":"date-time","title":"Captured At"}},"type":"object","required":["event_name","pixel_id","emq_score","captured_at"],"title":"MetaMatchQualityEvent","description":"EMQ for one event name, as Meta last reported it."},"MetaMatchQualityResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/MetaMatchQualityEvent"},"type":"array","title":"Events"},"last_polled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Polled At"},"low_score_threshold":{"type":"number","title":"Low Score Threshold","default":6.5}},"type":"object","title":"MetaMatchQualityResponse","description":"Latest EMQ snapshot per event for a store.\n\n``events`` empty with ``last_polled_at`` null means no poll has landed\nyet — distinct from \"this store has no Meta connection\", which the caller\nalready knows from the tracking config."},"MetaTrackingResponse":{"properties":{"pixel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pixel Id"},"pixel_enabled":{"type":"boolean","title":"Pixel Enabled","default":false},"capi_enabled":{"type":"boolean","title":"Capi Enabled","default":false},"mode":{"type":"string","enum":["off","pixel_only","capi_only","both"],"title":"Mode","default":"off"},"capi_access_token_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Capi Access Token Masked"},"domain_verification_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Verification Token"},"test_event_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Test Event Code"},"consent_required":{"type":"boolean","title":"Consent Required","default":false},"debug_mode":{"type":"boolean","title":"Debug Mode","default":false},"debug_mode_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Debug Mode Expires At"},"last_validated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Validated At"},"status":{"type":"string","enum":["disabled","configured_no_events","connected","failing","pending","browser_only"],"title":"Status","default":"disabled"},"ad_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ad Account Id"},"page_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Id"},"purchase_trigger":{"anyOf":[{"type":"string","enum":["confirmed","processing","shipped","delivered"]},{"type":"null"}],"title":"Purchase Trigger"},"lead_trigger":{"anyOf":[{"type":"string","enum":["confirmed","processing","shipped","delivered"]},{"type":"null"}],"title":"Lead Trigger"},"whatsapp_lead_enabled":{"type":"boolean","title":"Whatsapp Lead Enabled","default":false},"pixels":{"anyOf":[{"items":{"$ref":"#/components/schemas/PixelEntry"},"type":"array"},{"type":"null"}],"title":"Pixels"},"consent_settings":{"anyOf":[{"$ref":"#/components/schemas/ConsentSettings"},{"type":"null"}]}},"type":"object","title":"MetaTrackingResponse","description":"Shape returned by GET, PUT, DELETE on the meta-tracking endpoints.\n\nNEVER includes the raw CAPI access token — only the masked form. The\nraw token lives in ``service_credentials.credentials_encrypted`` and\nis decrypted only at Celery-task execution time."},"MetaTrackingStatusResponse":{"properties":{"status":{"type":"string","enum":["disabled","configured_no_events","connected","failing","pending","browser_only"],"title":"Status"},"mode":{"type":"string","enum":["off","pixel_only","capi_only","both"],"title":"Mode"},"last_validated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Validated At"},"recent_failure_rate":{"type":"number","title":"Recent Failure Rate","default":0.0},"recent_event_count":{"type":"integer","title":"Recent Event Count","default":0},"delivery":{"$ref":"#/components/schemas/MetaDeliveryHealth"}},"type":"object","required":["status","mode"],"title":"MetaTrackingStatusResponse","description":"Live status badge for the dashboard header (plan §7.5)."},"MetricTargetInput":{"properties":{"metric":{"type":"string","enum":["revenue","orders","aov","conversion"],"title":"Metric"},"period":{"type":"string","enum":["month","quarter"],"title":"Period","default":"month"},"target_value":{"type":"integer","maximum":1000000000000000.0,"minimum":0.0,"title":"Target Value"}},"type":"object","required":["metric","target_value"],"title":"MetricTargetInput"},"MetricTargetProgress":{"properties":{"metric":{"type":"string","title":"Metric"},"period":{"type":"string","title":"Period"},"target_value":{"type":"integer","title":"Target Value"},"actual_value":{"type":"integer","title":"Actual Value"},"progress_pct":{"type":"number","title":"Progress Pct"},"expected_pct":{"type":"number","title":"Expected Pct"},"pace":{"type":"string","title":"Pace"},"projected_value":{"type":"integer","title":"Projected Value"},"days_elapsed":{"type":"integer","title":"Days Elapsed"},"days_remaining":{"type":"integer","title":"Days Remaining"},"days_total":{"type":"integer","title":"Days Total"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"}},"type":"object","required":["metric","period","target_value","actual_value","progress_pct","expected_pct","pace","projected_value","days_elapsed","days_remaining","days_total","period_start","period_end"],"title":"MetricTargetProgress","description":"One goal with its live progress and pace.\n\n``target_value``/``actual_value``/``projected_value`` are integers in\nthe metric's smallest unit: cents (revenue, aov), count (orders), or\nbasis points (conversion — 250 = 2.5%)."},"MetricTargetsResponse":{"properties":{"targets":{"items":{"$ref":"#/components/schemas/MetricTargetProgress"},"type":"array","title":"Targets"}},"type":"object","required":["targets"],"title":"MetricTargetsResponse"},"MismatchSummary":{"properties":{"id":{"type":"string","title":"Id"},"mismatch_type":{"type":"string","title":"Mismatch Type"},"order_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Number"},"gateway_transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway Transaction Id"},"expected_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Amount Cents"},"actual_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Actual Amount Cents"},"gateway":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gateway"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"resolved":{"type":"boolean","title":"Resolved"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","mismatch_type","order_number","gateway_transaction_id","expected_amount_cents","actual_amount_cents","gateway","notes","resolved","created_at"],"title":"MismatchSummary"},"MonthRevenueBand":{"properties":{"expected_cents":{"type":"integer","title":"Expected Cents"},"lower_cents":{"type":"integer","title":"Lower Cents"},"upper_cents":{"type":"integer","title":"Upper Cents"},"mtd_cents":{"type":"integer","title":"Mtd Cents"},"remaining_days":{"type":"integer","title":"Remaining Days"},"confidence":{"type":"string","title":"Confidence"}},"type":"object","required":["expected_cents","lower_cents","upper_cents","mtd_cents","remaining_days","confidence"],"title":"MonthRevenueBand"},"MoyasarCredentialsResponse":{"properties":{"is_configured":{"type":"boolean","title":"Is Configured"},"secret_key_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret Key Masked"},"publishable_key_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publishable Key Masked"},"webhook_secret_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Secret Masked"},"last_configured":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Configured"}},"type":"object","required":["is_configured"],"title":"MoyasarCredentialsResponse","description":"Moyasar credentials status (masked, never returns real keys)."},"MultiTouchAttributionResponse":{"properties":{"model":{"type":"string","title":"Model"},"total_orders":{"type":"integer","title":"Total Orders"},"total_revenue_cents":{"type":"integer","title":"Total Revenue Cents"},"by_channel":{"items":{"$ref":"#/components/schemas/MultiTouchChannelRow"},"type":"array","title":"By Channel"},"by_campaign":{"items":{"$ref":"#/components/schemas/MultiTouchCampaignRow"},"type":"array","title":"By Campaign"}},"type":"object","required":["model","total_orders","total_revenue_cents","by_channel","by_campaign"],"title":"MultiTouchAttributionResponse"},"MultiTouchCampaignRow":{"properties":{"campaign_id":{"type":"string","title":"Campaign Id"},"campaign_name":{"type":"string","title":"Campaign Name"},"credit_cents":{"type":"integer","title":"Credit Cents"},"credit_pct":{"type":"number","title":"Credit Pct"}},"type":"object","required":["campaign_id","campaign_name","credit_cents","credit_pct"],"title":"MultiTouchCampaignRow"},"MultiTouchChannelRow":{"properties":{"channel":{"type":"string","title":"Channel"},"credit_cents":{"type":"integer","title":"Credit Cents"},"credit_pct":{"type":"number","title":"Credit Pct"}},"type":"object","required":["channel","credit_cents","credit_pct"],"title":"MultiTouchChannelRow"},"MultibuyTier":{"properties":{"quantity":{"type":"integer","minimum":2.0,"title":"Quantity"},"price_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Price Cents"}},"type":"object","required":["quantity","price_cents"],"title":"MultibuyTier","description":"One price break on a multibuy: 'N of them together cost P'."},"NotificationTemplate":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"template":{"type":"string","title":"Template","default":""},"delay":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delay"}},"type":"object","title":"NotificationTemplate","description":"Notification template configuration."},"NotificationToggle":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"template_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"},"last_sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sent At"},"sent_count_30d":{"type":"integer","title":"Sent Count 30D","default":0}},"type":"object","title":"NotificationToggle","description":"Individual notification type toggle."},"NotifyWhatsAppResponse":{"properties":{"sent":{"type":"boolean","title":"Sent"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id"}},"type":"object","required":["sent"],"title":"NotifyWhatsAppResponse","description":"Result of a merchant-initiated abandoned-cart WhatsApp nudge."},"OnboardingResponse":{"properties":{"id":{"type":"string","title":"Id"},"store_id":{"type":"string","title":"Store Id"},"steps":{"items":{"$ref":"#/components/schemas/OnboardingStepResponse"},"type":"array","title":"Steps"},"completion_percentage":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Completion Percentage"},"current_step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Step","description":"Next pending step key, or null if all done"},"is_completed":{"type":"boolean","title":"Is Completed"},"is_dismissed":{"type":"boolean","title":"Is Dismissed"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","store_id","steps","completion_percentage","current_step","is_completed","is_dismissed","created_at","updated_at"],"title":"OnboardingResponse","description":"Full onboarding state response."},"OnboardingStepResponse":{"properties":{"key":{"type":"string","title":"Key","description":"Step identifier"},"status":{"type":"string","title":"Status","description":"pending | completed | skipped"},"is_skippable":{"type":"boolean","title":"Is Skippable","description":"Whether this step can be skipped"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At","description":"ISO timestamp when completed"},"skipped_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped At","description":"ISO timestamp when skipped"}},"type":"object","required":["key","status","is_skippable"],"title":"OnboardingStepResponse","description":"Individual step in the onboarding response."},"OptInCreate":{"properties":{"phone":{"type":"string","title":"Phone","description":"Will be canonicalized to E.164."},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"source":{"type":"string","enum":["import","api","signup","inbound_reply"],"title":"Source"}},"type":"object","required":["phone","source"],"title":"OptInCreate","description":"Merchant-facing opt-in creation (e.g., import flow)."},"OptInRevoke":{"properties":{"phone":{"type":"string","title":"Phone"},"reason":{"type":"string","enum":["merchant_revoke","customer_request_via_support","api_revoke"],"title":"Reason"}},"type":"object","required":["phone","reason"],"title":"OptInRevoke","description":"Merchant-initiated revocation."},"OptInRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"store_id":{"type":"string","format":"uuid","title":"Store Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"phone":{"type":"string","title":"Phone"},"source":{"type":"string","enum":["checkout","signup","import","api","inbound_reply"],"title":"Source"},"opted_in_at":{"type":"string","format":"date-time","title":"Opted In At"},"opted_out_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Opted Out At"},"opt_out_reason":{"anyOf":[{"type":"string","enum":["inbound_stop_keyword","merchant_revoke","customer_request_via_support","api_revoke"]},{"type":"null"}],"title":"Opt Out Reason"}},"type":"object","required":["id","store_id","phone","source","opted_in_at"],"title":"OptInRow","description":"A row returned by GET /whatsapp/opt-ins."},"OrderActivitiesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OrderActivityResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"}},"type":"object","required":["items","total","page","page_size"],"title":"OrderActivitiesResponse","description":"Paginated activity feed for a single order."},"OrderActivityResponse":{"properties":{"id":{"type":"string","title":"Id"},"order_id":{"type":"string","title":"Order Id"},"kind":{"type":"string","title":"Kind"},"event_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"},"body":{"type":"string","title":"Body"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"user_avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Avatar Url"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","order_id","kind","body","created_at"],"title":"OrderActivityResponse","description":"Single entry in an order's activity stream (comment or system event)."},"OrderAddressRequest":{"properties":{"first_name":{"type":"string","maxLength":100,"minLength":1,"title":"First Name","description":"Recipient first name"},"last_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Last Name","description":"Recipient last name (optional)","default":""},"address_line1":{"type":"string","maxLength":255,"minLength":1,"title":"Address Line1","description":"Street address line 1"},"address_line2":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Address Line2","description":"Apartment, suite, floor, etc."},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"City","description":"City / area (optional)","default":""},"state":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"State","description":"State or governorate"},"postal_code":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Postal Code","description":"Postal / ZIP code"},"country":{"type":"string","maxLength":100,"minLength":2,"title":"Country","description":"Country name or ISO code"},"phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Phone","description":"Contact phone number"},"latitude":{"anyOf":[{"type":"number","maximum":90.0,"minimum":-90.0},{"type":"null"}],"title":"Latitude","description":"Delivery point latitude (WGS84)"},"longitude":{"anyOf":[{"type":"number","maximum":180.0,"minimum":-180.0},{"type":"null"}],"title":"Longitude","description":"Delivery point longitude (WGS84)"},"location_accuracy":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Location Accuracy","description":"GPS accuracy radius in meters"},"location_source":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Location Source","description":"How the location was captured: 'gps' | 'manual_pin'"},"geocoded_address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Geocoded Address","description":"Provider-normalized formatted address (from reverse geocoding)"}},"type":"object","required":["first_name","address_line1","country"],"title":"OrderAddressRequest","description":"Order shipping/billing address request schema.","example":{"address_line1":"12 Tahrir Square","city":"Cairo","country":"Egypt","first_name":"Ahmed","last_name":"Hassan","phone":"+201234567890"}},"OrderAddressResponse":{"properties":{"first_name":{"type":"string","title":"First Name","description":"First name"},"last_name":{"type":"string","title":"Last Name","description":"Last name"},"full_name":{"type":"string","title":"Full Name","description":"Concatenated full name"},"address_line1":{"type":"string","title":"Address Line1","description":"Address line 1"},"address_line2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address Line2","description":"Address line 2"},"city":{"type":"string","title":"City","description":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"State or governorate"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code","description":"Postal code"},"country":{"type":"string","title":"Country","description":"Country"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Phone number"},"latitude":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latitude","description":"Delivery point latitude"},"longitude":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Longitude","description":"Delivery point longitude"},"location_accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Location Accuracy","description":"GPS accuracy radius in meters"},"location_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Source","description":"Location capture source: 'gps' | 'manual_pin'"},"geocoded_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Geocoded Address","description":"Provider-normalized formatted address"}},"type":"object","required":["first_name","last_name","full_name","address_line1","address_line2","city","state","postal_code","country","phone"],"title":"OrderAddressResponse","description":"Order address response schema."},"OrderAppliedPromotion":{"properties":{"id":{"type":"string","title":"Id","description":"Promotion UUID"},"title":{"type":"string","title":"Title","description":"Promotion title"},"title_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title Ar","description":"Arabic promotion title"},"amount":{"type":"integer","title":"Amount","description":"Discount contributed by this promotion, in cents"}},"type":"object","required":["id","title","amount"],"title":"OrderAppliedPromotion","description":"One automatic / free-shipping promotion the offers engine applied.\n\nCommerce-correctness Phase 1. ``amount`` is integer cents (the discount\nthis promotion contributed). ``title_ar`` is optional — present when the\npromotion carries an Arabic title. The list is empty when no automatic\npromotion matched or the ``ff_apply_offers_at_checkout`` flag is off."},"OrderCampaignRef":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"OrderCampaignRef","description":"Embedded campaign ref for the orders list (feature 001).\n\nOnly present when the order has a resolved `campaign_id` — i.e.,\nthe visitor arrived via a campaign-tagged URL whose short_code\nmatched a real MarketingCampaign on this store. Null otherwise\n(direct / untracked / customer-share traffic)."},"OrderLineItemRequest":{"properties":{"product_id":{"type":"string","format":"uuid","title":"Product Id","description":"Product UUID"},"product_name":{"type":"string","maxLength":255,"minLength":1,"title":"Product Name","description":"Product name at time of order"},"variant_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Variant Id","description":"Product variant UUID"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name","description":"Variant label (e.g. 'Large / Blue')"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku","description":"SKU at time of order"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity","description":"Quantity ordered","default":1},"unit_price":{"type":"integer","minimum":0.0,"title":"Unit Price","description":"Price per unit in cents"}},"type":"object","required":["product_id","product_name","unit_price"],"title":"OrderLineItemRequest","description":"Order line item request schema.","example":{"product_id":"550e8400-e29b-41d4-a716-446655440000","product_name":"Egyptian Cotton T-Shirt","quantity":2,"unit_price":25000}},"OrderLineItemResponse":{"properties":{"product_id":{"type":"string","title":"Product Id","description":"Product UUID"},"product_name":{"type":"string","title":"Product Name","description":"Product name"},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id","description":"Variant UUID"},"variant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Name","description":"Variant label"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku","description":"SKU"},"quantity":{"type":"integer","title":"Quantity","description":"Quantity ordered"},"unit_price":{"type":"integer","title":"Unit Price","description":"Unit price in cents"},"total_price":{"type":"integer","title":"Total Price","description":"Line total in cents (unit_price * quantity)"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url","description":"Current product image"}},"type":"object","required":["product_id","product_name","variant_id","variant_name","sku","quantity","unit_price","total_price"],"title":"OrderLineItemResponse","description":"Order line item response schema."},"OrderListItemResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Order UUID"},"order_number":{"type":"string","title":"Order Number","description":"Human-readable order number"},"customer_id":{"type":"string","title":"Customer Id","description":"Customer UUID"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name","description":"Customer full name"},"status":{"type":"string","title":"Status","description":"Order status"},"payment_status":{"type":"string","title":"Payment Status","description":"Payment status"},"fulfillment_status":{"type":"string","title":"Fulfillment Status","description":"Fulfillment status"},"total":{"type":"integer","title":"Total","description":"Grand total in cents"},"collected_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Collected Total","description":"Cash actually collected after a partial acceptance; null = total"},"currency":{"type":"string","title":"Currency","description":"Currency code"},"item_count":{"type":"integer","title":"Item Count","description":"Total items"},"payment_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Method","description":"Payment method"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"},"discount_amount":{"type":"integer","title":"Discount Amount","description":"Total discount in cents","default":0},"campaign":{"anyOf":[{"$ref":"#/components/schemas/OrderCampaignRef"},{"type":"null"}],"description":"Resolved marketing campaign for this order, if any"},"customer_confirmation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Confirmation Status","description":"None | 'pending' | 'confirmed' (WhatsApp COD confirm flow)"},"customer_confirmed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Confirmed At","description":"ISO 8601 timestamp of the customer's confirm tap"},"shipping_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipping Method","description":"Shipping method / carrier label, if any"},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number","description":"Carrier tracking number, if any"}},"type":"object","required":["id","order_number","customer_id","status","payment_status","fulfillment_status","total","currency","item_count","payment_method","created_at"],"title":"OrderListItemResponse","description":"Order list item response schema (summary)."},"OrderResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Order UUID"},"store_id":{"type":"string","title":"Store Id","description":"Store UUID"},"customer_id":{"type":"string","title":"Customer Id","description":"Customer UUID"},"order_number":{"type":"string","title":"Order Number","description":"Human-readable order number"},"line_items":{"items":{"$ref":"#/components/schemas/OrderLineItemResponse"},"type":"array","title":"Line Items","description":"Line items"},"shipping_address":{"$ref":"#/components/schemas/OrderAddressResponse","description":"Shipping address"},"billing_address":{"anyOf":[{"$ref":"#/components/schemas/OrderAddressResponse"},{"type":"null"}],"description":"Billing address"},"status":{"type":"string","title":"Status","description":"Order status: pending, confirmed, shipped, delivered, cancelled"},"payment_status":{"type":"string","title":"Payment Status","description":"Payment status: unpaid, paid, refunded"},"fulfillment_status":{"type":"string","title":"Fulfillment Status","description":"Fulfillment status: unfulfilled, fulfilled, partial"},"subtotal":{"type":"integer","title":"Subtotal","description":"Subtotal in cents"},"shipping_cost":{"type":"integer","title":"Shipping Cost","description":"Shipping cost in cents"},"tax_amount":{"type":"integer","title":"Tax Amount","description":"Tax amount in cents"},"discount_amount":{"type":"integer","title":"Discount Amount","description":"Discount amount in cents"},"coupon_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coupon Code","description":"Applied coupon code"},"coupon_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coupon Id","description":"Applied coupon UUID"},"applied_promotions":{"items":{"$ref":"#/components/schemas/OrderAppliedPromotion"},"type":"array","title":"Applied Promotions","description":"Automatic / free-shipping promotions applied at checkout"},"total":{"type":"integer","title":"Total","description":"Grand total in cents"},"collected_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Collected Total","description":"Cash actually collected after a partial acceptance; null = total"},"partial_acceptance":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Partial Acceptance","description":"Returned-at-door lines {lines, returned_value_cents, collected_total_cents, reason, at}"},"currency":{"type":"string","title":"Currency","description":"ISO 4217 currency code"},"payment_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Method","description":"Payment method used"},"payment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Id","description":"External payment transaction ID"},"shipping_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipping Method","description":"Shipping method used"},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number","description":"Shipment tracking number"},"tracking_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Url","description":"Shipment tracking URL"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Internal merchant notes"},"customer_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Notes","description":"Customer-provided notes"},"item_count":{"type":"integer","title":"Item Count","description":"Total number of items"},"is_paid":{"type":"boolean","title":"Is Paid","description":"Whether the order has been paid"},"can_be_cancelled":{"type":"boolean","title":"Can Be Cancelled","description":"Whether the order can still be cancelled"},"cancelled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancelled At","description":"ISO 8601 cancellation timestamp"},"paid_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid At","description":"ISO 8601 payment timestamp"},"fulfilled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fulfilled At","description":"ISO 8601 fulfilment timestamp"},"shipped_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipped At","description":"ISO 8601 shipment timestamp"},"delivered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivered At","description":"ISO 8601 delivery timestamp"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","title":"Updated At","description":"ISO 8601 last-update timestamp"},"customer_confirmation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Confirmation Status","description":"None | 'pending' | 'confirmed' (WhatsApp COD confirm flow)"},"customer_confirmed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Confirmed At","description":"ISO 8601 timestamp of the customer's confirm tap"}},"type":"object","required":["id","store_id","customer_id","order_number","line_items","shipping_address","billing_address","status","payment_status","fulfillment_status","subtotal","shipping_cost","tax_amount","discount_amount","total","currency","payment_method","payment_id","shipping_method","tracking_number","tracking_url","notes","customer_notes","item_count","is_paid","can_be_cancelled","cancelled_at","paid_at","fulfilled_at","shipped_at","delivered_at","created_at","updated_at"],"title":"OrderResponse","description":"Full order response schema.","example":{"can_be_cancelled":true,"created_at":"2025-01-20T14:30:00Z","currency":"EGP","customer_id":"550e8400-e29b-41d4-a716-446655440000","discount_amount":0,"fulfillment_status":"unfulfilled","id":"770e8400-e29b-41d4-a716-446655440000","is_paid":false,"item_count":2,"order_number":"ORD-1001","payment_method":"cod","payment_status":"unpaid","shipping_cost":5000,"status":"pending","store_id":"660e8400-e29b-41d4-a716-446655440000","subtotal":50000,"tax_amount":7700,"total":62700,"updated_at":"2025-01-20T14:30:00Z"}},"OrderStreakResponse":{"properties":{"current_streak":{"type":"integer","title":"Current Streak"},"longest_streak":{"type":"integer","title":"Longest Streak"},"last_order_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Order Date"},"active_today":{"type":"boolean","title":"Active Today"}},"type":"object","required":["current_streak","longest_streak","last_order_date","active_today"],"title":"OrderStreakResponse","description":"Daily order-streak response."},"OrderTimelineEvent":{"properties":{"timestamp":{"type":"string","title":"Timestamp","description":"ISO 8601 event timestamp"},"status":{"type":"string","title":"Status","description":"Status at this point"},"description":{"type":"string","title":"Description","description":"Human-readable event description"},"actor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor","description":"Who triggered this event"}},"type":"object","required":["timestamp","status","description"],"title":"OrderTimelineEvent","description":"Single event in an order's timeline."},"OrderTimelineResponse":{"properties":{"order_id":{"type":"string","title":"Order Id","description":"Order UUID"},"order_number":{"type":"string","title":"Order Number","description":"Order number"},"events":{"items":{"$ref":"#/components/schemas/OrderTimelineEvent"},"type":"array","title":"Events","description":"Timeline events in chronological order"}},"type":"object","required":["order_id","order_number","events"],"title":"OrderTimelineResponse","description":"Order timeline response."},"OrdersBreakdownResponse":{"properties":{"by_status":{"items":{"$ref":"#/components/schemas/OrdersByStatusItem"},"type":"array","title":"By Status"},"by_payment_method":{"items":{"$ref":"#/components/schemas/OrdersByPaymentMethodItem"},"type":"array","title":"By Payment Method"},"by_shipping_method":{"items":{"$ref":"#/components/schemas/OrdersByShippingMethodItem"},"type":"array","title":"By Shipping Method","default":[]},"fulfillment_time":{"$ref":"#/components/schemas/FulfillmentTimeStats"},"by_day_of_week":{"items":{"$ref":"#/components/schemas/OrdersByDayOfWeekItem"},"type":"array","title":"By Day Of Week"},"by_hour_of_day":{"items":{"$ref":"#/components/schemas/OrdersByHourItem"},"type":"array","title":"By Hour Of Day"}},"type":"object","required":["by_status","by_payment_method","fulfillment_time","by_day_of_week","by_hour_of_day"],"title":"OrdersBreakdownResponse"},"OrdersByDayOfWeekItem":{"properties":{"day":{"type":"string","title":"Day"},"orders":{"type":"integer","title":"Orders"},"revenue":{"type":"integer","title":"Revenue"}},"type":"object","required":["day","orders","revenue"],"title":"OrdersByDayOfWeekItem"},"OrdersByHourItem":{"properties":{"hour":{"type":"integer","title":"Hour"},"orders":{"type":"integer","title":"Orders"}},"type":"object","required":["hour","orders"],"title":"OrdersByHourItem"},"OrdersByPaymentMethodItem":{"properties":{"method":{"type":"string","title":"Method"},"count":{"type":"integer","title":"Count"},"revenue":{"type":"integer","title":"Revenue"}},"type":"object","required":["method","count","revenue"],"title":"OrdersByPaymentMethodItem"},"OrdersByShippingMethodItem":{"properties":{"method":{"type":"string","title":"Method"},"count":{"type":"integer","title":"Count"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["method","count","percentage"],"title":"OrdersByShippingMethodItem"},"OrdersByStatusItem":{"properties":{"status":{"type":"string","title":"Status"},"count":{"type":"integer","title":"Count"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["status","count","percentage"],"title":"OrdersByStatusItem"},"PageResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Page UUID"},"store_id":{"type":"string","title":"Store Id","description":"Owning store UUID"},"handle":{"type":"string","title":"Handle","description":"Unique handle within the store"},"title":{"additionalProperties":{"type":"string"},"type":"object","title":"Title","description":"Bilingual title {en, ar}"},"body":{"additionalProperties":{"type":"string"},"type":"object","title":"Body","description":"Bilingual rich-text body {en, ar}"},"seo":{"additionalProperties":true,"type":"object","title":"Seo","description":"SEO overrides"},"is_published":{"type":"boolean","title":"Is Published","description":"Whether the page is visible"},"template":{"type":"string","title":"Template","description":"Theme template key"},"template_suffix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Suffix","description":"Alternate template variant suffix; null = base template."},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","title":"Updated At","description":"ISO 8601 last-update timestamp"}},"type":"object","required":["id","store_id","handle","title","body","seo","is_published","template","created_at","updated_at"],"title":"PageResponse","description":"Page response schema."},"PaginatedListResponse_CouponResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CouponResponse"},"type":"array","title":"Items","description":"Page of results"},"total":{"type":"integer","title":"Total","description":"Total number of results"},"page":{"type":"integer","title":"Page","description":"Current page number"},"page_size":{"type":"integer","title":"Page Size","description":"Items per page"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total number of pages"}},"type":"object","required":["items","total","page","page_size","total_pages"],"title":"PaginatedListResponse[CouponResponse]"},"PaginatedListResponse_CustomerResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CustomerResponse"},"type":"array","title":"Items","description":"Page of results"},"total":{"type":"integer","title":"Total","description":"Total number of results"},"page":{"type":"integer","title":"Page","description":"Current page number"},"page_size":{"type":"integer","title":"Page Size","description":"Items per page"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total number of pages"}},"type":"object","required":["items","total","page","page_size","total_pages"],"title":"PaginatedListResponse[CustomerResponse]"},"PaginatedListResponse_EmailTemplateResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EmailTemplateResponse"},"type":"array","title":"Items","description":"Page of results"},"total":{"type":"integer","title":"Total","description":"Total number of results"},"page":{"type":"integer","title":"Page","description":"Current page number"},"page_size":{"type":"integer","title":"Page Size","description":"Items per page"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total number of pages"}},"type":"object","required":["items","total","page","page_size","total_pages"],"title":"PaginatedListResponse[EmailTemplateResponse]"},"PaginatedListResponse_InvoiceListResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InvoiceListResponse"},"type":"array","title":"Items","description":"Page of results"},"total":{"type":"integer","title":"Total","description":"Total number of results"},"page":{"type":"integer","title":"Page","description":"Current page number"},"page_size":{"type":"integer","title":"Page Size","description":"Items per page"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total number of pages"}},"type":"object","required":["items","total","page","page_size","total_pages"],"title":"PaginatedListResponse[InvoiceListResponse]"},"PaginatedListResponse_OrderListItemResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OrderListItemResponse"},"type":"array","title":"Items","description":"Page of results"},"total":{"type":"integer","title":"Total","description":"Total number of results"},"page":{"type":"integer","title":"Page","description":"Current page number"},"page_size":{"type":"integer","title":"Page Size","description":"Items per page"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total number of pages"}},"type":"object","required":["items","total","page","page_size","total_pages"],"title":"PaginatedListResponse[OrderListItemResponse]"},"PaginatedListResponse_ProductResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ProductResponse"},"type":"array","title":"Items","description":"Page of results"},"total":{"type":"integer","title":"Total","description":"Total number of results"},"page":{"type":"integer","title":"Page","description":"Current page number"},"page_size":{"type":"integer","title":"Page Size","description":"Items per page"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total number of pages"}},"type":"object","required":["items","total","page","page_size","total_pages"],"title":"PaginatedListResponse[ProductResponse]"},"PaginatedListResponse_RefundListItemResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RefundListItemResponse"},"type":"array","title":"Items","description":"Page of results"},"total":{"type":"integer","title":"Total","description":"Total number of results"},"page":{"type":"integer","title":"Page","description":"Current page number"},"page_size":{"type":"integer","title":"Page Size","description":"Items per page"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total number of pages"}},"type":"object","required":["items","total","page","page_size","total_pages"],"title":"PaginatedListResponse[RefundListItemResponse]"},"PartialAcceptanceLine":{"properties":{"order_line_index":{"type":"integer","minimum":0.0,"title":"Order Line Index"},"returned_quantity":{"type":"integer","minimum":1.0,"title":"Returned Quantity"}},"type":"object","required":["order_line_index","returned_quantity"],"title":"PartialAcceptanceLine"},"PartialAcceptanceRequest":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/PartialAcceptanceLine"},"type":"array","minItems":1,"title":"Lines"},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason"},"restock":{"type":"boolean","title":"Restock","default":true}},"type":"object","required":["lines"],"title":"PartialAcceptanceRequest"},"PartialAcceptanceResponse":{"properties":{"order":{"$ref":"#/components/schemas/OrderResponse"},"returned_value_cents":{"type":"integer","title":"Returned Value Cents"},"collected_total_cents":{"type":"integer","title":"Collected Total Cents"},"refund_due_cents":{"type":"integer","title":"Refund Due Cents"},"restocked_lines":{"type":"integer","title":"Restocked Lines"}},"type":"object","required":["order","returned_value_cents","collected_total_cents","refund_due_cents","restocked_lines"],"title":"PartialAcceptanceResponse"},"PaymentMethodStatus":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"is_configured":{"type":"boolean","title":"Is Configured","default":false},"last_configured":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Configured"}},"type":"object","title":"PaymentMethodStatus","description":"Individual payment method status."},"PaymentProofResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"order_id":{"type":"string","format":"uuid","title":"Order Id"},"transaction_ref":{"type":"string","title":"Transaction Ref"},"declared_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Declared Amount Cents"},"status":{"type":"string","title":"Status"},"rejection_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejection Reason"},"review_decision_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Review Decision By"},"review_decision_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Review Decision At"},"signed_image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signed Image Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"recorded_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recorded Method"},"ocr_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Status"},"ocr_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Provider"},"ocr_extracted_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ocr Extracted Amount Cents"},"ocr_extracted_ipa":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Extracted Ipa"},"ocr_extracted_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Extracted Note"},"ocr_extracted_transaction_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Extracted Transaction Ref"},"ocr_extracted_recipient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Extracted Recipient Name"},"auto_approval_block_reasons":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Auto Approval Block Reasons"}},"type":"object","required":["id","order_id","transaction_ref","declared_amount_cents","status","rejection_reason","review_decision_by","review_decision_at","signed_image_url","created_at"],"title":"PaymentProofResponse"},"PaymentSettingsResponse":{"properties":{"cod":{"$ref":"#/components/schemas/PaymentMethodStatus"},"fawry":{"$ref":"#/components/schemas/PaymentMethodStatus"},"fawaterak":{"$ref":"#/components/schemas/PaymentMethodStatus"},"paymob":{"$ref":"#/components/schemas/PaymentMethodStatus"},"kashier":{"$ref":"#/components/schemas/PaymentMethodStatus"},"instapay":{"$ref":"#/components/schemas/PaymentMethodStatus"},"vodafone_cash":{"$ref":"#/components/schemas/PaymentMethodStatus"},"we_pay":{"$ref":"#/components/schemas/PaymentMethodStatus"},"orange_cash":{"$ref":"#/components/schemas/PaymentMethodStatus"},"bank_transfer":{"$ref":"#/components/schemas/PaymentMethodStatus"},"bank_accounts_count":{"type":"integer","title":"Bank Accounts Count","default":0},"cod_deposit_policy":{"$ref":"#/components/schemas/CodDepositPolicy"}},"type":"object","required":["cod","fawry","paymob","vodafone_cash","we_pay","orange_cash","bank_transfer"],"title":"PaymentSettingsResponse","description":"Payment settings response."},"PaymobCredentialsResponse":{"properties":{"is_configured":{"type":"boolean","title":"Is Configured"},"public_key_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Key Masked"},"secret_key_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret Key Masked"},"hmac_secret_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hmac Secret Masked"},"card_integration_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Integration Id"},"wallet_integration_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Integration Id"},"apple_pay_integration_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Apple Pay Integration Id"},"last_configured":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Configured"},"validation_warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Validation Warning"}},"type":"object","required":["is_configured"],"title":"PaymobCredentialsResponse","description":"Paymob credentials status (masked, never returns real keys)."},"PendingVerificationOrder":{"properties":{"order_id":{"type":"string","format":"uuid","title":"Order Id"},"order_number":{"type":"string","title":"Order Number"},"customer_id":{"type":"string","format":"uuid","title":"Customer Id"},"amount_cents":{"type":"integer","title":"Amount Cents"},"currency":{"type":"string","title":"Currency"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"proof_id":{"type":"string","format":"uuid","title":"Proof Id"},"proof_created_at":{"type":"string","format":"date-time","title":"Proof Created At"},"transaction_ref":{"type":"string","title":"Transaction Ref"},"declared_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Declared Amount Cents"}},"type":"object","required":["order_id","order_number","customer_id","amount_cents","currency","created_at","proof_id","proof_created_at","transaction_ref","declared_amount_cents"],"title":"PendingVerificationOrder"},"PendingVerificationPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PendingVerificationOrder"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["items","total","page","limit"],"title":"PendingVerificationPage"},"PixelEntry":{"properties":{"pixel_id":{"type":"string","maxLength":32,"minLength":1,"title":"Pixel Id"},"pixel_enabled":{"type":"boolean","title":"Pixel Enabled","default":true},"capi_enabled":{"type":"boolean","title":"Capi Enabled","default":true},"label":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Label"},"role":{"anyOf":[{"type":"string","enum":["primary","retargeting","agency"]},{"type":"null"}],"title":"Role"}},"type":"object","required":["pixel_id"],"title":"PixelEntry","description":"One pixel in a store's multi-pixel configuration.\n\nWave 2 Phase 13: a store can register N pixels (EasyOrders parity;\nbeats Shopify which is 1-only natively). Each pixel fires the same\nevent stream; `event_id` is namespaced per-pixel by Meta's own\ndedup contract (``(pixel_id, event_name, event_id)`` tuple), so\nthe same browser-side `eventID` value works across all pixels.\n\nAll pixels under one store share a single CAPI access token in v1\n(Option A in the design: \"one Business Manager, one System User\ntoken, many pixels\"). Per-pixel credentials are a v1.1 follow-up."},"PopupContent":{"properties":{"surface":{"type":"string","const":"popup","title":"Surface","default":"popup"},"layout":{"type":"string","enum":["centered","side","custom"],"title":"Layout","default":"centered"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"form_fields":{"items":{"type":"string","enum":["email","phone","name"]},"type":"array","title":"Form Fields"},"discount_code_to_reveal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discount Code To Reveal"},"show_after_dismiss_days":{"type":"integer","minimum":0.0,"title":"Show After Dismiss Days","default":30},"custom_html":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}],"title":"Custom Html"},"auto_apply_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Auto Apply Code"}},"additionalProperties":false,"type":"object","title":"PopupContent","description":"Triggered modal config.\n\n`layout=\"custom\"` switches the storefront from the templated\nheadline/body/form popup to rendering merchant-authored `custom_html`\n(e.g. HTML a merchant pastes from an AI assistant). The storefront\nrenders it inside a sandboxed iframe — no scripts, no parent-DOM /\ncookie access — so untrusted markup can't run code against shoppers;\nthe modal shell (backdrop, close button, dismissal, analytics) is\nstill owned by us. When `custom_html` is empty the storefront falls\nback to the templated render."},"PredictionsResponse":{"properties":{"stockouts":{"items":{"$ref":"#/components/schemas/StockoutPrediction"},"type":"array","title":"Stockouts"},"revenue_month":{"anyOf":[{"$ref":"#/components/schemas/MonthRevenueBand"},{"type":"null"}]},"orders_today":{"anyOf":[{"$ref":"#/components/schemas/TodayOrdersBand"},{"type":"null"}]},"repeat":{"$ref":"#/components/schemas/RepeatProfile"},"cod":{"anyOf":[{"$ref":"#/components/schemas/CodRejectionProfile"},{"type":"null"}]},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["stockouts","revenue_month","orders_today","repeat","cod","generated_at"],"title":"PredictionsResponse"},"PresetResponse":{"properties":{"created_zone_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Created Zone Ids"},"assigned_governorate_codes":{"items":{"type":"string"},"type":"array","title":"Assigned Governorate Codes"}},"type":"object","required":["created_zone_ids","assigned_governorate_codes"],"title":"PresetResponse","description":"One-shot result of applying the Egypt 4-zone preset."},"PreviewDraftRequest":{"properties":{"event_type":{"type":"string","maxLength":50,"title":"Event Type"},"language":{"type":"string","enum":["ar","en"],"title":"Language"},"subject":{"type":"string","maxLength":500,"minLength":1,"title":"Subject"},"html_body":{"type":"string","minLength":1,"title":"Html Body"},"variables":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Variables"}},"type":"object","required":["event_type","language","subject","html_body"],"title":"PreviewDraftRequest","description":"Body for ``POST /stores/{store_id}/email-templates/preview-draft``.\n\nRenders the in-flight editor buffer without persisting anything — used\nby the merchant editor for live preview while the merchant is typing."},"PreviewEmailRequest":{"properties":{"variables":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Variables"}},"type":"object","title":"PreviewEmailRequest","description":"Body for ``POST /stores/{store_id}/email-templates/{id}/preview``."},"PreviewEmailResponse":{"properties":{"subject":{"type":"string","title":"Subject"},"html":{"type":"string","title":"Html"}},"type":"object","required":["subject","html"],"title":"PreviewEmailResponse","description":"Rendered preview output."},"ProductLabelDef":{"properties":{"key":{"type":"string","maxLength":64,"minLength":8,"pattern":"^custom:[a-z0-9][a-z0-9_-]{0,47}$","title":"Key","description":"Stable identity, format custom:<slug>"},"text_en":{"type":"string","maxLength":80,"minLength":1,"title":"Text En"},"text_ar":{"type":"string","maxLength":80,"title":"Text Ar","default":""}},"type":"object","required":["key","text_en"],"title":"ProductLabelDef","description":"One reusable custom product label, stored under\n``store.settings[\"product_labels\"]``. Built-in presets (new/sale/\nbestseller/limited) are NOT stored — only merchant-created customs.\nText is denormalized onto products at assignment time, so renames\nhere don't back-propagate to already-labeled products (v1 trade-off)."},"ProductLabelSchema":{"properties":{"key":{"type":"string","maxLength":64,"minLength":1,"title":"Key","description":"Preset key (new/sale/…) or custom:<slug>"},"text_en":{"type":"string","maxLength":80,"title":"Text En","default":""},"text_ar":{"type":"string","maxLength":80,"title":"Text Ar","default":""}},"type":"object","required":["key"],"title":"ProductLabelSchema","description":"Merchant-assigned product label stored at ``attributes.label``.\n\nv1 is text-only (no colors/icons). The text is denormalized onto the\nproduct at assignment time, so renaming a custom label definition in\nstore settings does NOT back-propagate to already-labeled products —\naccepted v1 trade-off (the storefront never joins store settings)."},"ProductLabelsResponse":{"properties":{"labels":{"items":{"$ref":"#/components/schemas/ProductLabelDef"},"type":"array","title":"Labels"}},"type":"object","title":"ProductLabelsResponse","description":"The store's custom product-label definitions."},"ProductOptionInput":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"},"position":{"type":"integer","maximum":2.0,"minimum":0.0,"title":"Position","default":0},"values":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Values"}},"type":"object","required":["name"],"title":"ProductOptionInput","description":"One option axis on the create/update payload."},"ProductPerformanceItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"revenue":{"type":"integer","title":"Revenue"},"quantity_sold":{"type":"integer","title":"Quantity Sold"},"current_stock":{"type":"integer","title":"Current Stock"},"revenue_trend":{"items":{"type":"integer"},"type":"array","title":"Revenue Trend"},"gross_sales":{"type":"integer","title":"Gross Sales","default":0},"discounts":{"type":"integer","title":"Discounts","default":0},"tax":{"type":"integer","title":"Tax","default":0},"net_sales":{"type":"integer","title":"Net Sales","default":0},"orders_count":{"type":"integer","title":"Orders Count","default":0},"cost_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Price"},"profit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Profit"},"margin_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Margin Percent"}},"type":"object","required":["id","name","sku","revenue","quantity_sold","current_stock","revenue_trend"],"title":"ProductPerformanceItem"},"ProductPerformanceResponse":{"properties":{"products":{"items":{"$ref":"#/components/schemas/ProductPerformanceItem"},"type":"array","title":"Products"},"categories":{"items":{"$ref":"#/components/schemas/CategoryPerformanceItem"},"type":"array","title":"Categories"},"inventory":{"$ref":"#/components/schemas/InventoryHealthResponse"}},"type":"object","required":["products","categories","inventory"],"title":"ProductPerformanceResponse"},"ProductResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Product UUID"},"store_id":{"type":"string","title":"Store Id","description":"Owning store UUID"},"name":{"type":"string","title":"Name","description":"Product display name"},"slug":{"type":"string","title":"Slug","description":"URL-friendly slug"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku","description":"Stock Keeping Unit"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Full product description"},"short_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Description","description":"Brief description"},"product_type":{"type":"string","title":"Product Type","description":"physical or digital"},"status":{"type":"string","title":"Status","description":"active, draft, or archived"},"price":{"type":"string","title":"Price","description":"Formatted price string"},"price_currency":{"type":"string","title":"Price Currency","description":"ISO 4217 currency code"},"compare_at_price":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compare At Price","description":"Strike-through price"},"cost_price":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Price","description":"Cost of goods"},"quantity":{"type":"integer","title":"Quantity","description":"Available stock quantity"},"is_in_stock":{"type":"boolean","title":"Is In Stock","description":"Whether the product is in stock"},"is_low_stock":{"type":"boolean","title":"Is Low Stock","description":"Whether stock is below threshold"},"is_on_sale":{"type":"boolean","title":"Is On Sale","description":"Whether compare_at_price is set"},"images":{"items":{"type":"string"},"type":"array","title":"Images","description":"Product image URLs"},"category_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Id","description":"Category UUID"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"Searchable tags"},"attributes":{"additionalProperties":true,"type":"object","title":"Attributes","description":"Key-value attributes"},"label":{"anyOf":[{"$ref":"#/components/schemas/ProductLabelSchema"},{"type":"null"}],"description":"Merchant-assigned label badge (from attributes.label)"},"meta_catalog_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Catalog Id","description":"Meta Commerce Catalog product ID — used as `content_ids` on storefront Pixel events when set, so Meta dynamic ads can match the conversion back to a catalog row. Null falls back to the product UUID."},"image_alts":{"additionalProperties":{"type":"string"},"type":"object","title":"Image Alts","description":"Image URL -> alt text."},"brand":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Brand","description":"Manufacturer/brand name (Product JSON-LD + Meta feed)."},"robots_noindex":{"type":"boolean","title":"Robots Noindex","description":"Keep this page out of search results.","default":false},"canonical_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Canonical Url","description":"Absolute URL this page should credit as the original."},"sitemap_exclude":{"type":"boolean","title":"Sitemap Exclude","description":"Leave this page out of sitemap.xml.","default":false},"seo_title":{"anyOf":[{"type":"string","maxLength":70},{"type":"null"}],"title":"Seo Title","description":"Per-product SEO title override (defaults to product name)."},"seo_description":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Seo Description","description":"Per-product SEO description override (defaults to short_description)."},"template_suffix":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Template Suffix","description":"Alternate template variant suffix; null = base template."},"options":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Options","description":"Option axes for variants"},"variants":{"items":{"$ref":"#/components/schemas/ProductVariantSummary"},"type":"array","title":"Variants","description":"Purchasable variants — at least one per product"},"metafields":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Metafields","description":"Public typed metafields ({namespace, key, type, value})"},"series":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Series","description":"Ordered series memberships with neighboring books"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","title":"Updated At","description":"ISO 8601 last-update timestamp"}},"type":"object","required":["id","store_id","name","slug","sku","description","short_description","product_type","status","price","price_currency","compare_at_price","cost_price","quantity","is_in_stock","is_low_stock","is_on_sale","images","category_id","tags","attributes","created_at","updated_at"],"title":"ProductResponse","description":"Product response schema.","example":{"attributes":{"color":"white","size":"M"},"compare_at_price":"350.00","cost_price":"120.00","created_at":"2025-01-15T10:30:00Z","description":"Premium Egyptian cotton t-shirt.","id":"550e8400-e29b-41d4-a716-446655440000","images":["https://cdn.numu.com/products/tshirt-front.jpg"],"is_in_stock":true,"is_low_stock":false,"is_on_sale":true,"name":"Egyptian Cotton T-Shirt","price":"250.00","price_currency":"EGP","product_type":"physical","quantity":100,"short_description":"Soft Egyptian cotton tee","sku":"ECT-001","slug":"egyptian-cotton-tshirt","status":"active","store_id":"660e8400-e29b-41d4-a716-446655440000","tags":["clothing","cotton"],"updated_at":"2025-01-15T10:30:00Z"}},"ProductVariantSummary":{"properties":{"id":{"type":"string","title":"Id","description":"Variant UUID"},"position":{"type":"integer","title":"Position","description":"Display order within product"},"option_values":{"additionalProperties":{"type":"string"},"type":"object","title":"Option Values","description":"axis-name → chosen-value"},"price":{"type":"string","title":"Price","description":"Cents (string for precision)"},"price_currency":{"type":"string","title":"Price Currency","description":"ISO 4217"},"compare_at_price":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compare At Price"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"barcode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Barcode"},"inventory_quantity":{"type":"integer","title":"Inventory Quantity","description":"Available stock for this variant"},"is_in_stock":{"type":"boolean","title":"Is In Stock","description":"Whether inventory_quantity > 0"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"weight":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight"},"fulfillment_type":{"type":"string","title":"Fulfillment Type","default":"physical"},"requires_shipping":{"type":"boolean","title":"Requires Shipping","default":true},"track_inventory":{"type":"boolean","title":"Track Inventory","default":true}},"type":"object","required":["id","position","price","price_currency","inventory_quantity","is_in_stock"],"title":"ProductVariantSummary","description":"Per-variant payload nested in ProductResponse.\n\nThemes read this to render a variant picker + bind the chosen\nvariant_id on add-to-cart. Cost price omitted — same reason as\non the parent ProductResponse, that's merchant-internal data."},"ProfilePayload":{"properties":{"name_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name En"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"governorate_codes":{"items":{"type":"string"},"type":"array","title":"Governorate Codes"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"cutoff_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cutoff Time"},"tracking_url_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Url Template"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"is_active":{"type":"boolean","title":"Is Active","default":true},"seed_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seed Key"}},"type":"object","title":"ProfilePayload","description":"A merchant-defined courier."},"PromotionAnalyticsOutput":{"properties":{"promotion_id":{"type":"string","format":"uuid","title":"Promotion Id"},"range_start":{"type":"string","format":"date","title":"Range Start"},"range_end":{"type":"string","format":"date","title":"Range End"},"impressions":{"type":"integer","title":"Impressions","default":0},"clicks":{"type":"integer","title":"Clicks","default":0},"dismissals":{"type":"integer","title":"Dismissals","default":0},"redemptions":{"type":"integer","title":"Redemptions","default":0},"conversions":{"type":"integer","title":"Conversions","default":0},"revenue_cents":{"type":"integer","title":"Revenue Cents","default":0},"discount_total_cents":{"type":"integer","title":"Discount Total Cents","default":0},"by_day":{"items":{"$ref":"#/components/schemas/DailyAnalytics"},"type":"array","title":"By Day"},"conversion_rate":{"type":"number","title":"Conversion Rate","default":0.0},"impression_to_click_rate":{"type":"number","title":"Impression To Click Rate","default":0.0},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"additionalProperties":false,"type":"object","required":["promotion_id","range_start","range_end","generated_at"],"title":"PromotionAnalyticsOutput","description":"Returned by `GET /stores/{id}/promotions/{pid}/analytics`."},"PromotionDisplayInput":{"properties":{"trigger":{"$ref":"#/components/schemas/DisplayTrigger"},"trigger_value":{"additionalProperties":true,"type":"object","title":"Trigger Value"},"frequency":{"$ref":"#/components/schemas/DisplayFrequency"},"pages":{"items":{"type":"string"},"type":"array","title":"Pages"},"device_targets":{"items":{"type":"string"},"type":"array","title":"Device Targets"},"is_enabled":{"type":"boolean","title":"Is Enabled","default":true}},"additionalProperties":false,"type":"object","required":["trigger","frequency"],"title":"PromotionDisplayInput","description":"Trigger / frequency / page-target rule attached to a promotion."},"PromotionDisplayOutput":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"trigger":{"$ref":"#/components/schemas/DisplayTrigger"},"trigger_value":{"additionalProperties":true,"type":"object","title":"Trigger Value"},"frequency":{"$ref":"#/components/schemas/DisplayFrequency"},"pages":{"items":{"type":"string"},"type":"array","title":"Pages"},"device_targets":{"items":{"type":"string"},"type":"array","title":"Device Targets"},"is_enabled":{"type":"boolean","title":"Is Enabled"}},"type":"object","required":["id","trigger","trigger_value","frequency","pages","device_targets","is_enabled"],"title":"PromotionDisplayOutput"},"PromotionListItemOutput":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"surface":{"$ref":"#/components/schemas/PromotionSurface"},"status":{"$ref":"#/components/schemas/PromotionStatus"},"priority":{"type":"integer","title":"Priority"},"starts_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Starts At"},"ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ends At"},"version":{"type":"integer","title":"Version"},"coupon_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Coupon Id"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"usage_count":{"type":"integer","title":"Usage Count","default":0},"discount_rule":{"anyOf":[{"$ref":"#/components/schemas/DiscountRule"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","surface","status","priority","version","created_at","updated_at"],"title":"PromotionListItemOutput","description":"Slim shape used in list/index responses."},"PromotionListOutput":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PromotionListItemOutput"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"PromotionListOutput"},"PromotionMetricsBlock":{"properties":{"impressions":{"type":"integer","title":"Impressions","default":0},"clicks":{"type":"integer","title":"Clicks","default":0},"dismissals":{"type":"integer","title":"Dismissals","default":0},"redemptions":{"type":"integer","title":"Redemptions","default":0},"conversions":{"type":"integer","title":"Conversions","default":0},"revenue_cents":{"type":"integer","title":"Revenue Cents","default":0},"discount_total_cents":{"type":"integer","title":"Discount Total Cents","default":0}},"type":"object","title":"PromotionMetricsBlock","description":"Aggregate counts displayed on the merchant detail page."},"PromotionOutput":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"tenant_id":{"type":"string","format":"uuid","title":"Tenant Id"},"store_id":{"type":"string","format":"uuid","title":"Store Id"},"name":{"type":"string","title":"Name"},"surface":{"$ref":"#/components/schemas/PromotionSurface"},"status":{"$ref":"#/components/schemas/PromotionStatus"},"coupon_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Coupon Id"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"usage_count":{"type":"integer","title":"Usage Count","default":0},"discount_rule":{"anyOf":[{"$ref":"#/components/schemas/DiscountRule"},{"type":"null"}]},"content":{"additionalProperties":true,"type":"object","title":"Content"},"translations":{"additionalProperties":{"$ref":"#/components/schemas/LocalizedPromotionContent"},"type":"object","title":"Translations"},"displays":{"items":{"$ref":"#/components/schemas/PromotionDisplayOutput"},"type":"array","title":"Displays"},"targets":{"items":{"$ref":"#/components/schemas/PromotionTargetOutput"},"type":"array","title":"Targets"},"priority":{"type":"integer","title":"Priority"},"starts_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Starts At"},"ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ends At"},"usage_limit_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Usage Limit Total"},"usage_limit_per_customer":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Usage Limit Per Customer"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"metrics":{"$ref":"#/components/schemas/PromotionMetricsBlock"}},"type":"object","required":["id","tenant_id","store_id","name","surface","status","content","priority","version","created_at","updated_at"],"title":"PromotionOutput","description":"Full read model — for merchant admin detail page."},"PromotionStatus":{"type":"string","enum":["draft","scheduled","active","paused","expired","archived"],"title":"PromotionStatus","description":"Lifecycle state of a promotion."},"PromotionSurface":{"type":"string","enum":["discount_code","automatic","announcement_bar","popup","floating_widget","cookie_banner"],"title":"PromotionSurface","description":"The presentation type of a promotion."},"PromotionTargetInput":{"properties":{"target_kind":{"$ref":"#/components/schemas/TargetKind"},"target_value":{"additionalProperties":true,"type":"object","title":"Target Value"},"inclusion":{"type":"boolean","title":"Inclusion","default":true},"role":{"anyOf":[{"type":"string","maxLength":32,"pattern":"^(buy_set|get_set|leg:(0|[1-9][0-9]?))$"},{"type":"null"}],"title":"Role"}},"additionalProperties":false,"type":"object","required":["target_kind"],"title":"PromotionTargetInput","description":"Audience / catalog / geo rule attached to a promotion.\n\n`role` decides which half of the engine reads this row:\n\n* `None` (default) — an **eligibility** gate. Every inclusion rule\n  must match (and no exclusion rule may) for the promotion to run\n  at all; the discount then applies to the whole cart.\n* `\"buy_set\"` / `\"get_set\"` — a **line filter**. Skipped by the\n  eligibility checker and read by the discount calculator instead,\n  to restrict which cart lines participate: BOGO's \"customer buys X\n  / customer gets Y\", and MULTIBUY's eligible set (`buy_set`).\n* `\"leg:<i>\"` — a BUNDLE leg's catalogue, positionally aligned with\n  `discount_rule.bundle_legs`. `\"leg:0\"` scopes the first leg.\n\nOnly catalog kinds (PRODUCT / CATEGORY) are meaningful as line\nfilters; a role on an audience/geo row is ignored rather than\nfailing the promotion.\n\nOn a MULTIBUY the server PROMOTES untagged inclusion catalog rows to\n`buy_set` on write (see `use_cases.promotions.target_roles`) — a\nclient that leaves `role` unset gets the offer it meant rather than\nan eligibility gate that hides the promotion from an empty cart.\nBUNDLE legs are never inferred: send them tagged."},"PromotionTargetOutput":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"target_kind":{"$ref":"#/components/schemas/TargetKind"},"target_value":{"additionalProperties":true,"type":"object","title":"Target Value"},"inclusion":{"type":"boolean","title":"Inclusion"},"role":{"anyOf":[{"type":"string","maxLength":32,"pattern":"^(buy_set|get_set|leg:(0|[1-9][0-9]?))$"},{"type":"null"}],"title":"Role"}},"type":"object","required":["id","target_kind","target_value","inclusion"],"title":"PromotionTargetOutput"},"PublishResponse":{"properties":{"published":{"additionalProperties":true,"type":"object","title":"Published"},"revision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision Id"},"content_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Hash"},"verified":{"type":"boolean","title":"Verified","default":false},"revalidation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Revalidation"},"etag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Etag"}},"type":"object","required":["published"],"title":"PublishResponse"},"PutDigestSettingsRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"channels":{"items":{"type":"string","enum":["email","whatsapp"]},"type":"array","maxItems":2,"minItems":1,"title":"Channels"}},"type":"object","required":["enabled","channels"],"title":"PutDigestSettingsRequest"},"PutMetricTargetsRequest":{"properties":{"targets":{"items":{"$ref":"#/components/schemas/MetricTargetInput"},"type":"array","maxItems":8,"minItems":1,"title":"Targets"}},"type":"object","required":["targets"],"title":"PutMetricTargetsRequest"},"RFMSegmentItem":{"properties":{"segment":{"type":"string","title":"Segment"},"count":{"type":"integer","title":"Count"},"percentage":{"type":"number","title":"Percentage"},"avg_revenue":{"type":"integer","title":"Avg Revenue"},"avg_orders":{"type":"number","title":"Avg Orders"}},"type":"object","required":["segment","count","percentage","avg_revenue","avg_orders"],"title":"RFMSegmentItem"},"RateCalculatorRequest":{"properties":{"governorate_code":{"type":"string","title":"Governorate Code","description":"ISO 3166-2 code, e.g. 'EG-C'"},"cart_subtotal_cents":{"type":"integer","minimum":0.0,"title":"Cart Subtotal Cents"},"cart_weight_g":{"type":"integer","minimum":0.0,"title":"Cart Weight G","default":0},"cod_requested":{"type":"boolean","title":"Cod Requested","default":false},"coupon_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coupon Code"},"location_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Location Id"}},"additionalProperties":false,"type":"object","required":["governorate_code","cart_subtotal_cents"],"title":"RateCalculatorRequest","description":"Identical shape to the storefront options request. Reuses the\nstorefront endpoint's Pydantic model so the merchant rate calculator\npreview always matches what the customer sees.\n\nKept as a subclass (not an alias) so OpenAPI shows it under the\nmerchant namespace too."},"RateConfigCarrierApi":{"properties":{"type":{"type":"string","const":"carrier_api","title":"Type","default":"carrier_api"},"carrier":{"type":"string","minLength":1,"title":"Carrier"},"service_code":{"type":"string","minLength":1,"title":"Service Code"}},"additionalProperties":false,"type":"object","required":["carrier","service_code"],"title":"RateConfigCarrierApi","description":"Live carrier-API rate — resolver branch calls IShippingService.\n\nSchema-ready; not wired in MVP. Kept to pin the contract so the\nfuture `/shipping/options` path doesn't need a schema change."},"RateConfigFlat":{"properties":{"type":{"type":"string","const":"flat","title":"Type","default":"flat"},"amount_cents":{"type":"integer","minimum":0.0,"title":"Amount Cents"}},"additionalProperties":false,"type":"object","required":["amount_cents"],"title":"RateConfigFlat","description":"Flat rate — always the same amount regardless of cart."},"RateConfigFreeOver":{"properties":{"type":{"type":"string","const":"free_over","title":"Type","default":"free_over"},"amount_cents":{"type":"integer","minimum":0.0,"title":"Amount Cents"},"free_when_subtotal_gte_cents":{"type":"integer","minimum":0.0,"title":"Free When Subtotal Gte Cents"}},"additionalProperties":false,"type":"object","required":["amount_cents","free_when_subtotal_gte_cents"],"title":"RateConfigFreeOver","description":"Free shipping when cart subtotal (post-discount) ≥ threshold.\n\nBelow the threshold, charges `amount_cents`. At or above, 0."},"RateConfigWeightBand":{"properties":{"type":{"type":"string","const":"weight_band","title":"Type","default":"weight_band"},"bands":{"items":{"$ref":"#/components/schemas/WeightBand"},"type":"array","minItems":1,"title":"Bands"}},"additionalProperties":false,"type":"object","required":["bands"],"title":"RateConfigWeightBand","description":"Weight-banded pricing. First matching band wins.\n\nBands must be sorted ascending by `max_weight_g` at write time\n(None last). Sorted / validated by the API layer, not the resolver."},"RateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"zone_id":{"type":"string","format":"uuid","title":"Zone Id"},"rate_type":{"$ref":"#/components/schemas/RateType"},"label":{"type":"string","title":"Label"},"label_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label Ar"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"is_active":{"type":"boolean","title":"Is Active"},"sort_order":{"type":"integer","title":"Sort Order"}},"type":"object","required":["id","zone_id","rate_type","label","label_ar","config","is_active","sort_order"],"title":"RateResponse","description":"Shape returned to the merchant dashboard."},"RateType":{"type":"string","enum":["flat","free_over","weight_band","carrier_api"],"title":"RateType","description":"Supported rate types. Maps 1:1 to `rate_type` column values.\n\nResolver branches on this value. Adding a new type means:\n  1. Add a member here.\n  2. Add a `RateConfig*` model below.\n  3. Add a branch in `ShippingResolver._evaluate_rate`."},"RealtimeGeoResponse":{"properties":{"total_orders":{"type":"integer","title":"Total Orders"},"locations":{"items":{"$ref":"#/components/schemas/GeoLocationItem"},"type":"array","title":"Locations"}},"type":"object","required":["total_orders","locations"],"title":"RealtimeGeoResponse"},"RealtimeSnapshotResponse":{"properties":{"views_today":{"type":"integer","title":"Views Today"},"visitors_today":{"type":"integer","title":"Visitors Today"},"active_now":{"type":"integer","title":"Active Now"},"orders_today":{"type":"integer","title":"Orders Today"},"revenue_today":{"type":"integer","title":"Revenue Today"},"recent_orders":{"items":{"$ref":"#/components/schemas/RecentOrderItem"},"type":"array","title":"Recent Orders"},"hourly_orders":{"items":{"type":"integer"},"type":"array","title":"Hourly Orders"},"hourly_revenue":{"items":{"type":"integer"},"type":"array","title":"Hourly Revenue"},"top_pages":{"items":{"$ref":"#/components/schemas/TopPageItem"},"type":"array","title":"Top Pages"},"available":{"type":"boolean","title":"Available","default":true}},"type":"object","required":["views_today","visitors_today","active_now","orders_today","revenue_today","recent_orders","hourly_orders","hourly_revenue","top_pages"],"title":"RealtimeSnapshotResponse"},"RebuildExternalThemeRequest":{"properties":{"branch":{"type":"string","title":"Branch","description":"Branch to rebuild from","default":"main"}},"type":"object","title":"RebuildExternalThemeRequest","description":"Request to rebuild the external theme using its stored source_repo."},"RecentOrderItem":{"properties":{"order_id":{"type":"string","title":"Order Id"},"order_number":{"type":"string","title":"Order Number"},"total":{"type":"integer","title":"Total"},"customer_name":{"type":"string","title":"Customer Name"},"item_count":{"type":"integer","title":"Item Count"},"payment_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Method"}},"type":"object","required":["order_id","order_number","total","customer_name","item_count","payment_method"],"title":"RecentOrderItem"},"ReconciliationRunSummary":{"properties":{"id":{"type":"string","title":"Id"},"gateway":{"type":"string","title":"Gateway"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"},"status":{"type":"string","title":"Status"},"total_orders_checked":{"type":"integer","title":"Total Orders Checked"},"total_transactions_checked":{"type":"integer","title":"Total Transactions Checked"},"mismatches_found":{"type":"integer","title":"Mismatches Found"},"expected_amount_cents":{"type":"integer","title":"Expected Amount Cents"},"actual_amount_cents":{"type":"integer","title":"Actual Amount Cents"},"variance_cents":{"type":"integer","title":"Variance Cents"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","gateway","period_start","period_end","status","total_orders_checked","total_transactions_checked","mismatches_found","expected_amount_cents","actual_amount_cents","variance_cents","completed_at","created_at"],"title":"ReconciliationRunSummary"},"RecordedPaymentResult":{"properties":{"payment":{"$ref":"#/components/schemas/PaymentProofResponse"},"amount_paid_cents":{"type":"integer","title":"Amount Paid Cents"},"balance_due_cents":{"type":"integer","title":"Balance Due Cents"},"order_payment_status":{"type":"string","title":"Order Payment Status"}},"type":"object","required":["payment","amount_paid_cents","balance_due_cents","order_payment_status"],"title":"RecordedPaymentResult","description":"What the order page needs to re-render after recording a payment."},"ReferrerItem":{"properties":{"host":{"type":"string","title":"Host"},"sessions":{"type":"integer","title":"Sessions"}},"type":"object","required":["host","sessions"],"title":"ReferrerItem"},"RefundListItemResponse":{"properties":{"id":{"type":"string","title":"Id"},"refund_number":{"type":"string","title":"Refund Number"},"order_id":{"type":"string","title":"Order Id"},"order_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Number"},"refund_type":{"type":"string","title":"Refund Type"},"status":{"type":"string","title":"Status"},"reason":{"type":"string","title":"Reason"},"amount":{"type":"integer","title":"Amount"},"currency":{"type":"string","title":"Currency"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","refund_number","order_id","order_number","refund_type","status","reason","amount","currency","created_at"],"title":"RefundListItemResponse","description":"Refund list item response schema."},"RefundResponse":{"properties":{"id":{"type":"string","title":"Id"},"order_id":{"type":"string","title":"Order Id"},"store_id":{"type":"string","title":"Store Id"},"refund_number":{"type":"string","title":"Refund Number"},"refund_type":{"type":"string","title":"Refund Type"},"status":{"type":"string","title":"Status"},"reason":{"type":"string","title":"Reason"},"reason_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason Note"},"amount":{"type":"integer","title":"Amount"},"currency":{"type":"string","title":"Currency"},"payment_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Provider"},"payment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Id"},"provider_refund_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Refund Id"},"requested_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested By"},"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"},"rejected_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejected By"},"processed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Processed At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"rejected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rejected At"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","order_id","store_id","refund_number","refund_type","status","reason","reason_note","amount","currency","payment_provider","payment_id","provider_refund_id","requested_by","approved_by","rejected_by","processed_at","completed_at","rejected_at","failure_reason","created_at","updated_at"],"title":"RefundResponse","description":"Refund response schema."},"RejectRefundRequest":{"properties":{"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason","description":"Reason for rejecting the refund"}},"type":"object","title":"RejectRefundRequest","description":"Reject refund request schema."},"RejectRequest":{"properties":{"reason":{"type":"string","maxLength":500,"minLength":3,"title":"Reason"}},"type":"object","required":["reason"],"title":"RejectRequest"},"RejectReturnRequest":{"properties":{"merchant_note":{"type":"string","maxLength":2000,"minLength":1,"title":"Merchant Note"}},"type":"object","required":["merchant_note"],"title":"RejectReturnRequest"},"RemoveExternalThemeRequest":{"properties":{"fallback_theme":{"type":"string","title":"Fallback Theme","description":"Built-in theme to revert to after removal","default":"modern"}},"type":"object","title":"RemoveExternalThemeRequest","description":"Request to remove an external theme and revert to built-in."},"RenameThemeRequest":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name","description":"New label"}},"type":"object","required":["name"],"title":"RenameThemeRequest","description":"Request to rename a theme installation (set its merchant label).","example":{"name":"Holiday draft"}},"ReorderBundlesRequest":{"properties":{"primary_product_id":{"type":"string","title":"Primary Product Id"},"ordered_bundle_ids":{"items":{"type":"string"},"type":"array","title":"Ordered Bundle Ids","description":"Bundle IDs in desired display order"}},"type":"object","required":["primary_product_id","ordered_bundle_ids"],"title":"ReorderBundlesRequest","description":"Reorder bundles for a primary product."},"ReorderPromotionRow":{"properties":{"promotion_id":{"type":"string","format":"uuid","title":"Promotion Id"},"priority":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Priority"}},"additionalProperties":false,"type":"object","required":["promotion_id","priority"],"title":"ReorderPromotionRow","description":"Single (id, priority) pair for the bulk-reorder endpoint."},"ReorderPromotionsRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReorderPromotionRow"},"type":"array","maxItems":200,"minItems":1,"title":"Items"}},"additionalProperties":false,"type":"object","required":["items"],"title":"ReorderPromotionsRequest","description":"Body of `PATCH /stores/{id}/promotions/reorder`.\n\nCaller sends the full set of (promotion_id, priority) pairs the\ndrag UI just produced. The endpoint sets each row's priority in a\nsingle transaction and bumps `version` on every touched row, so\nconcurrent edits from another tab still produce a deterministic\nfinal order rather than silently losing one side's changes."},"RepeatProfile":{"properties":{"customers":{"type":"integer","title":"Customers"},"repeat_customers":{"type":"integer","title":"Repeat Customers"},"repeat_rate_pct":{"type":"number","title":"Repeat Rate Pct"},"p_next_30d_pct":{"type":"number","title":"P Next 30D Pct"},"median_gap_days":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Median Gap Days"},"confidence":{"type":"string","title":"Confidence"}},"type":"object","required":["customers","repeat_customers","repeat_rate_pct","p_next_30d_pct","median_gap_days","confidence"],"title":"RepeatProfile"},"ReportBuilderResponse":{"properties":{"dimension":{"type":"string","title":"Dimension"},"rows":{"items":{"$ref":"#/components/schemas/ReportRow"},"type":"array","title":"Rows"},"totals":{"$ref":"#/components/schemas/ReportRow"}},"type":"object","required":["dimension","rows","totals"],"title":"ReportBuilderResponse"},"ReportRow":{"properties":{"label":{"type":"string","title":"Label"},"revenue_cents":{"type":"integer","title":"Revenue Cents"},"orders":{"type":"integer","title":"Orders"},"aov_cents":{"type":"integer","title":"Aov Cents"},"units":{"type":"integer","title":"Units"}},"type":"object","required":["label","revenue_cents","orders","aov_cents","units"],"title":"ReportRow"},"ResolveAutopilotExceptionRequest":{"properties":{"action":{"type":"string","title":"Action","default":"dismiss"}},"type":"object","title":"ResolveAutopilotExceptionRequest"},"ResolveAutopilotExceptionResponse":{"properties":{"resolved":{"type":"boolean","title":"Resolved"}},"type":"object","required":["resolved"],"title":"ResolveAutopilotExceptionResponse"},"ResolveMismatchRequest":{"properties":{"resolved":{"type":"boolean","title":"Resolved","default":true},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"ResolveMismatchRequest"},"ReturnLineItemResponse":{"properties":{"order_line_index":{"type":"integer","title":"Order Line Index"},"product_id":{"type":"string","title":"Product Id"},"variant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Variant Id"},"product_name":{"type":"string","title":"Product Name"},"quantity":{"type":"integer","title":"Quantity"},"unit_price":{"type":"integer","title":"Unit Price"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"customer_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Note"}},"type":"object","required":["order_line_index","product_id","product_name","quantity","unit_price"],"title":"ReturnLineItemResponse"},"ReturnResponse":{"properties":{"id":{"type":"string","title":"Id"},"order_id":{"type":"string","title":"Order Id"},"return_number":{"type":"string","title":"Return Number"},"status":{"type":"string","title":"Status"},"reason":{"type":"string","title":"Reason"},"customer_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Note"},"merchant_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Note"},"line_items":{"items":{"$ref":"#/components/schemas/ReturnLineItemResponse"},"type":"array","title":"Line Items"},"refund_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refund Id"},"requested_amount":{"type":"integer","title":"Requested Amount"},"currency":{"type":"string","title":"Currency"},"requested_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested At"},"approved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved At"},"received_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Received At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"rejected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejected At"},"canceled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canceled At"}},"type":"object","required":["id","order_id","return_number","status","reason","line_items","requested_amount","currency"],"title":"ReturnResponse"},"ReturnStatus":{"type":"string","enum":["requested","approved","rejected","received","completed","canceled"],"title":"ReturnStatus"},"RevenueBreakdownResponse":{"properties":{"gross_revenue":{"type":"integer","title":"Gross Revenue"},"discounts":{"type":"integer","title":"Discounts"},"shipping_collected":{"type":"integer","title":"Shipping Collected"},"refunds":{"type":"integer","title":"Refunds"},"net_revenue":{"type":"integer","title":"Net Revenue"},"tax_collected":{"type":"integer","title":"Tax Collected"},"tax_inclusive":{"type":"integer","title":"Tax Inclusive"},"tax_added":{"type":"integer","title":"Tax Added"},"tax_by_rate":{"items":{"$ref":"#/components/schemas/TaxByRateItem"},"type":"array","title":"Tax By Rate"},"coupon_usage":{"items":{"$ref":"#/components/schemas/CouponUsageItem"},"type":"array","title":"Coupon Usage"}},"type":"object","required":["gross_revenue","discounts","shipping_collected","refunds","net_revenue","tax_collected","tax_inclusive","tax_added","tax_by_rate","coupon_usage"],"title":"RevenueBreakdownResponse"},"RevenueDataPointResponse":{"properties":{"date":{"type":"string","title":"Date"},"revenue":{"type":"integer","title":"Revenue"},"orders":{"type":"integer","title":"Orders"},"visits":{"type":"integer","title":"Visits","default":0}},"type":"object","required":["date","revenue","orders"],"title":"RevenueDataPointResponse","description":"Revenue data point for chart."},"RevokeRequest":{"properties":{"client_id":{"type":"string","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret"},"token":{"type":"string","title":"Token"}},"type":"object","required":["client_id","client_secret","token"],"title":"RevokeRequest"},"SalesByLocationResponse":{"properties":{"location":{"type":"string","title":"Location"},"sales":{"type":"integer","title":"Sales"},"orders":{"type":"integer","title":"Orders"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["location","sales","orders","percentage"],"title":"SalesByLocationResponse","description":"Sales by location/governorate."},"SalesDataPointResponse":{"properties":{"date":{"type":"string","title":"Date"},"sales":{"type":"integer","title":"Sales"},"orders":{"type":"integer","title":"Orders"},"prev_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prev Date"},"prev_sales":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prev Sales"},"prev_orders":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Prev Orders"}},"type":"object","required":["date","sales","orders"],"title":"SalesDataPointResponse","description":"Sales data point for charts.\n\nThe ``prev_*`` fields are present only when the caller asked for a\ncomparison series (``?compare=previous_period|previous_year``); each\npoint carries the value of the SAME-POSITION bucket in the previous\nwindow, so charts can overlay the two series without re-aligning."},"SalesOverviewResponse":{"properties":{"total_sales":{"type":"integer","title":"Total Sales"},"total_orders":{"type":"integer","title":"Total Orders"},"avg_order_value":{"type":"integer","title":"Avg Order Value"},"sales_change_percent":{"type":"number","title":"Sales Change Percent"},"orders_change_percent":{"type":"number","title":"Orders Change Percent"},"collected_revenue":{"type":"integer","title":"Collected Revenue"},"collected_change_percent":{"type":"number","title":"Collected Change Percent"},"previous_total_sales":{"type":"integer","title":"Previous Total Sales"},"previous_total_orders":{"type":"integer","title":"Previous Total Orders"},"previous_collected_revenue":{"type":"integer","title":"Previous Collected Revenue"},"currency":{"type":"string","title":"Currency"}},"type":"object","required":["total_sales","total_orders","avg_order_value","sales_change_percent","orders_change_percent","collected_revenue","collected_change_percent","previous_total_sales","previous_total_orders","previous_collected_revenue","currency"],"title":"SalesOverviewResponse","description":"Sales overview statistics.\n\n``total_sales`` is BOOKED revenue — every order except cancelled/\nrefunded, including still-unpaid COD (the dominant payment method in\nEgypt: an order booked today is typically collected on delivery days\nlater). ``collected_revenue`` is the money actually received: paid\norders minus completed refunds — the Shopify-style gross/net split so\nmerchants see both realities side by side."},"SaveBostaCredentialsRequest":{"properties":{"api_key":{"type":"string","maxLength":500,"minLength":10,"title":"Api Key"},"business_id":{"type":"string","maxLength":100,"minLength":3,"title":"Business Id"},"webhook_secret":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Webhook Secret"},"auto_create_shipment":{"type":"boolean","title":"Auto Create Shipment","default":false}},"type":"object","required":["api_key","business_id"],"title":"SaveBostaCredentialsRequest","description":"Save Bosta shipping credentials for a store."},"SaveCarrierCredentialsRequest":{"properties":{"credentials":{"additionalProperties":{"type":"string"},"type":"object","title":"Credentials"},"auto_create_shipment":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Create Shipment"}},"type":"object","title":"SaveCarrierCredentialsRequest","description":"Credential values, keyed by the registry's ``credential_fields``.\n\nDeliberately a free-form map rather than named fields: the hub\ngenerates the form from the registry, so the payload shape follows\nwhatever that carrier declares."},"SaveFawaterakCredentialsRequest":{"properties":{"api_key":{"type":"string","maxLength":500,"minLength":10,"title":"Api Key"},"vendor_key":{"type":"string","maxLength":500,"minLength":10,"title":"Vendor Key"},"environment":{"type":"string","pattern":"^(staging|production)$","title":"Environment","default":"staging"}},"type":"object","required":["api_key","vendor_key"],"title":"SaveFawaterakCredentialsRequest","description":"Save Fawaterak gateway credentials for a store."},"SaveInstapayCredentialsRequest":{"properties":{"ipa":{"anyOf":[{"type":"string","maxLength":80,"minLength":3},{"type":"null"}],"title":"Ipa"},"ipa_display_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Ipa Display Name"},"fallback_phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Fallback Phone"},"auto_approve_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Approve Enabled"},"auto_approve_threshold_cents":{"type":"integer","maximum":10000000.0,"minimum":0.0,"title":"Auto Approve Threshold Cents","default":50000},"auto_approve_daily_cap_cents":{"type":"integer","maximum":100000000.0,"minimum":0.0,"title":"Auto Approve Daily Cap Cents","default":500000},"auto_approve_daily_count":{"type":"integer","maximum":1000.0,"minimum":0.0,"title":"Auto Approve Daily Count","default":10},"qr_link_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Qr Link Url"},"require_ocr_amount_match":{"type":"boolean","title":"Require Ocr Amount Match","default":false},"require_ocr_ipa_match":{"type":"boolean","title":"Require Ocr Ipa Match","default":false},"ocr_amount_tolerance_bps":{"type":"integer","maximum":5000.0,"minimum":0.0,"title":"Ocr Amount Tolerance Bps","default":100},"require_note_contains_reference":{"type":"boolean","title":"Require Note Contains Reference","default":false},"require_transaction_ref_match":{"type":"boolean","title":"Require Transaction Ref Match","default":false},"require_recipient_name_match":{"type":"boolean","title":"Require Recipient Name Match","default":false},"recipient_name_token":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Recipient Name Token"}},"type":"object","title":"SaveInstapayCredentialsRequest","description":"Save merchant InstaPay configuration.\n\nThe IPA (Instant Payment Address, e.g. ``merchant@cib``) is the\nprimary routing key and the one sensitive field — a leaked or\nswapped IPA lets someone impersonate the merchant on the\nproof-verification step. Phones are optional fallback display.\nThresholds are policy the merchant tunes.\n\n`ipa` is optional so merchants can update display/threshold\nfields without re-typing their address. When omitted, the handler\npreserves the currently-encrypted IPA. First-time saves must\ninclude it; the handler enforces that."},"SaveKashierCredentialsRequest":{"properties":{"merchant_id":{"type":"string","maxLength":100,"minLength":3,"title":"Merchant Id"},"api_key":{"type":"string","maxLength":500,"minLength":5,"title":"Api Key"},"secret_key":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Secret Key"},"apple_pay_enabled":{"type":"boolean","title":"Apple Pay Enabled","default":false},"mode":{"anyOf":[{"type":"string","enum":["live","test"]},{"type":"null"}],"title":"Mode"}},"type":"object","required":["merchant_id","api_key"],"title":"SaveKashierCredentialsRequest","description":"Save Kashier gateway credentials for a store."},"SaveMetaTrackingRequest":{"properties":{"pixel_id":{"type":"string","maxLength":32,"minLength":1,"title":"Pixel Id"},"pixel_enabled":{"type":"boolean","title":"Pixel Enabled"},"capi_enabled":{"type":"boolean","title":"Capi Enabled"},"capi_access_token":{"anyOf":[{"type":"string","maxLength":512,"minLength":20},{"type":"null"}],"title":"Capi Access Token"},"test_event_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Test Event Code"},"consent_required":{"type":"boolean","title":"Consent Required","default":false},"debug_mode":{"type":"boolean","title":"Debug Mode","default":false},"purchase_trigger":{"anyOf":[{"type":"string","enum":["confirmed","processing","shipped","delivered"]},{"type":"null"}],"title":"Purchase Trigger"},"lead_trigger":{"anyOf":[{"type":"string","enum":["confirmed","processing","shipped","delivered"]},{"type":"null"}],"title":"Lead Trigger"},"whatsapp_lead_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Whatsapp Lead Enabled"},"pixels":{"anyOf":[{"items":{"$ref":"#/components/schemas/PixelEntry"},"type":"array","maxItems":10},{"type":"null"}],"title":"Pixels"},"consent_settings":{"anyOf":[{"$ref":"#/components/schemas/ConsentSettings"},{"type":"null"}]},"ad_account_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Ad Account Id"},"page_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Page Id"},"domain_verification_token":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Domain Verification Token"}},"type":"object","required":["pixel_id","pixel_enabled","capi_enabled"],"title":"SaveMetaTrackingRequest","description":"Body for ``PUT /stores/{id}/settings/tracking/meta``."},"SaveMoyasarCredentialsRequest":{"properties":{"secret_key":{"type":"string","maxLength":500,"minLength":5,"title":"Secret Key"},"publishable_key":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Publishable Key"},"webhook_secret":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Webhook Secret"}},"type":"object","required":["secret_key"],"title":"SaveMoyasarCredentialsRequest","description":"Save Moyasar (KSA) gateway credentials for a store.\n\n- secret_key: server-side API key (sk_…), used for HTTP Basic auth.\n- publishable_key: client key (pk_…), optional.\n- webhook_secret: the shared ``secret_token`` configured on the Moyasar\n  webhook, used to authenticate inbound webhooks."},"SavePaymobCredentialsRequest":{"properties":{"secret_key":{"type":"string","maxLength":500,"minLength":10,"title":"Secret Key"},"public_key":{"type":"string","maxLength":500,"minLength":10,"title":"Public Key"},"hmac_secret":{"type":"string","maxLength":500,"minLength":10,"title":"Hmac Secret"},"card_integration_id":{"type":"string","maxLength":50,"minLength":1,"title":"Card Integration Id"},"wallet_integration_id":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Wallet Integration Id"},"apple_pay_integration_id":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Apple Pay Integration Id"}},"type":"object","required":["secret_key","public_key","hmac_secret","card_integration_id"],"title":"SavePaymobCredentialsRequest","description":"Save Paymob gateway credentials for a store."},"SaveTikTokTrackingRequest":{"properties":{"pixel_id":{"type":"string","maxLength":64,"minLength":1,"title":"Pixel Id"},"pixel_enabled":{"type":"boolean","title":"Pixel Enabled"},"api_enabled":{"type":"boolean","title":"Api Enabled"},"api_access_token":{"anyOf":[{"type":"string","maxLength":512,"minLength":10},{"type":"null"}],"title":"Api Access Token"},"test_event_code":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Test Event Code"},"consent_required":{"type":"boolean","title":"Consent Required","default":false},"debug_mode":{"type":"boolean","title":"Debug Mode","default":false},"purchase_trigger":{"anyOf":[{"type":"string","enum":["confirmed","processing","shipped","delivered"]},{"type":"null"}],"title":"Purchase Trigger"},"pixels":{"anyOf":[{"items":{"$ref":"#/components/schemas/TikTokPixelEntry"},"type":"array","maxItems":10},{"type":"null"}],"title":"Pixels"},"advertiser_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Advertiser Id"},"offline_event_set_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Offline Event Set Id"}},"type":"object","required":["pixel_id","pixel_enabled","api_enabled"],"title":"SaveTikTokTrackingRequest","description":"Body for ``PUT /stores/{id}/settings/tracking/tiktok``."},"SaveVodafoneCashCredentialsRequest":{"properties":{"wallet_number":{"anyOf":[{"type":"string","maxLength":20,"minLength":8},{"type":"null"}],"title":"Wallet Number"},"display_name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Display Name"},"fallback_phone":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Fallback Phone"},"auto_approve_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Approve Enabled"},"auto_approve_threshold_cents":{"type":"integer","maximum":10000000.0,"minimum":0.0,"title":"Auto Approve Threshold Cents","default":50000},"auto_approve_daily_cap_cents":{"type":"integer","maximum":100000000.0,"minimum":0.0,"title":"Auto Approve Daily Cap Cents","default":500000},"auto_approve_daily_count":{"type":"integer","maximum":1000.0,"minimum":0.0,"title":"Auto Approve Daily Count","default":10},"require_ocr_amount_match":{"type":"boolean","title":"Require Ocr Amount Match","default":false},"require_ocr_ipa_match":{"type":"boolean","title":"Require Ocr Ipa Match","default":false},"ocr_amount_tolerance_bps":{"type":"integer","maximum":5000.0,"minimum":0.0,"title":"Ocr Amount Tolerance Bps","default":300},"require_note_contains_reference":{"type":"boolean","title":"Require Note Contains Reference","default":false},"require_transaction_ref_match":{"type":"boolean","title":"Require Transaction Ref Match","default":false},"require_recipient_name_match":{"type":"boolean","title":"Require Recipient Name Match","default":false},"recipient_name_token":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Recipient Name Token"}},"type":"object","title":"SaveVodafoneCashCredentialsRequest","description":"Save merchant Vodafone Cash configuration.\n\nVodafone Cash is a *manual* rail on NUMU, exactly like InstaPay: the\nmerchant publishes a wallet number, the customer pushes funds from\ntheir own wallet (``*9#`` or the Ana Vodafone app), then uploads the\nconfirmation screenshot. There is no API key — Vodafone's merchant\nAPI needs a commercial partnership and an aggregator, which is a\ndifferent product from this one.\n\nSo the single sensitive field is the wallet number itself: swap it\nand you redirect a merchant's takings. Everything else is policy the\nmerchant tunes.\n\n`wallet_number` is optional so merchants can update display or\nthreshold fields without re-typing it (the UI shows it masked).\nFirst-time saves must include it; the handler enforces that."},"ScaffoldThemeRequest":{"properties":{"name":{"type":"string","maxLength":120,"title":"Name","default":"My Theme"},"theme_id":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Theme Id"},"source":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Source","description":"Bundled theme source to seed from (e.g. 'empire-v3'). When omitted, the store's active theme source is used, falling back to the generic starter."},"overwrite":{"type":"boolean","title":"Overwrite","description":"Wipe an existing workspace first","default":false}},"type":"object","title":"ScaffoldThemeRequest","description":"Seed a buildable starter theme into the workspace.","example":{"name":"My Theme","overwrite":false}},"ScaffoldThemeResponse":{"properties":{"file_count":{"type":"integer","title":"File Count"},"message":{"type":"string","title":"Message"}},"type":"object","required":["file_count","message"],"title":"ScaffoldThemeResponse"},"ScheduledSend":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"store_id":{"type":"string","format":"uuid","title":"Store Id"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"phone":{"type":"string","title":"Phone"},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Template Id"},"template_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Template Params"},"text_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Message"},"scheduled_for":{"type":"string","format":"date-time","title":"Scheduled For"},"status":{"type":"string","enum":["pending","sent","cancelled","skipped","failed"],"title":"Status"},"skip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skip Reason"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"related_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Related Order Id"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"dispatched_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dispatched At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"}},"type":"object","required":["id","store_id","phone","scheduled_for","status","created_at"],"title":"ScheduledSend","description":"A row returned by GET /whatsapp/scheduled-sends."},"ScheduledSendCreate":{"properties":{"phone":{"type":"string","title":"Phone","description":"Will be canonicalized to E.164."},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id"},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Template Id"},"template_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Template Params"},"text_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Message","description":"Free-form text. Only valid inside the 24h window — guard enforces at dispatch-time."},"scheduled_for":{"type":"string","format":"date-time","title":"Scheduled For"},"related_order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Related Order Id"}},"type":"object","required":["phone","scheduled_for"],"title":"ScheduledSendCreate","description":"Request body for POST /whatsapp/scheduled-sends."},"SchemaResponse":{"properties":{"theme_id":{"type":"string","title":"Theme Id"},"theme_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Slug"},"settings_schema":{"anyOf":[{"items":{},"type":"array"},{"additionalProperties":true,"type":"object"}],"title":"Settings Schema"},"section_schemas":{"additionalProperties":true,"type":"object","title":"Section Schemas"},"block_schemas":{"additionalProperties":true,"type":"object","title":"Block Schemas"},"theme_type":{"type":"string","title":"Theme Type","default":"internal"}},"type":"object","required":["theme_id"],"title":"SchemaResponse"},"SearchTermItem":{"properties":{"term":{"type":"string","title":"Term"},"searches":{"type":"integer","title":"Searches"},"sessions":{"type":"integer","title":"Sessions"},"zero_result_searches":{"type":"integer","title":"Zero Result Searches"}},"type":"object","required":["term","searches","sessions","zero_result_searches"],"title":"SearchTermItem"},"SearchTermsResponse":{"properties":{"total_searches":{"type":"integer","title":"Total Searches"},"unique_search_sessions":{"type":"integer","title":"Unique Search Sessions"},"search_conversion_rate":{"type":"number","title":"Search Conversion Rate"},"terms":{"items":{"$ref":"#/components/schemas/SearchTermItem"},"type":"array","title":"Terms"}},"type":"object","required":["total_searches","unique_search_sessions","search_conversion_rate","terms"],"title":"SearchTermsResponse","description":"Storefront search analytics — data exists since the /track\nstep-whitelist fix (before it, search events were collapsed to\npage_view and the query strings were lost)."},"SellerInfoRequest":{"properties":{"tax_id":{"type":"string","title":"Tax Id","description":"Tax registration number"},"name":{"type":"string","title":"Name","description":"Company name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar","description":"Arabic name"},"branch_id":{"type":"string","title":"Branch Id","description":"Branch code","default":"0"},"governorate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governorate","description":"Governorate"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City","description":"City"},"street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street","description":"Street name"},"building_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Building Number","description":"Building number"},"activity_code":{"type":"string","title":"Activity Code","description":"Business activity code","default":"4649"}},"type":"object","required":["tax_id","name"],"title":"SellerInfoRequest","description":"Seller information for invoice.","example":{"activity_code":"4649","branch_id":"0","building_number":"12","city":"Nasr City","governorate":"Cairo","name":"Nile Fashion LLC","name_ar":"نايل فاشن","street":"Abbas El-Akkad","tax_id":"123456789"}},"SellerInfoResponse":{"properties":{"tax_id":{"type":"string","title":"Tax Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"branch_id":{"type":"string","title":"Branch Id"},"country":{"type":"string","title":"Country","default":"EG"},"governorate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governorate"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street"},"building_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Building Number"},"activity_code":{"type":"string","title":"Activity Code"}},"type":"object","required":["tax_id","name","name_ar","branch_id","governorate","city","street","building_number","activity_code"],"title":"SellerInfoResponse","description":"Seller information response."},"SendMessageBodyDTO":{"properties":{"type":{"type":"string","title":"Type","default":"text"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"attachment_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attachment Type"},"attachment_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attachment Url"},"template_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"},"template_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Template Params"}},"type":"object","title":"SendMessageBodyDTO","description":"Body for POST /threads/{thread_id}/messages/send.\n\nMatches the hub composer's payload; the thread id comes from the\nroute path, not the body. Unknown fields (media_upload_id,\ntemplate_id, product_id) are ignored until those features land."},"SendMessageRequest":{"properties":{"text":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Text"},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Template Id"},"template_params":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Template Params"},"media_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Url"},"media_caption":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Caption"}},"type":"object","title":"SendMessageRequest","description":"Send a message in a conversation."},"SendMetaTestEventRequest":{"properties":{"test_event_code":{"type":"string","maxLength":64,"minLength":1,"title":"Test Event Code"}},"type":"object","required":["test_event_code"],"title":"SendMetaTestEventRequest","description":"Body for the test-event endpoint."},"SendMetaTestEventResponse":{"properties":{"enqueued":{"type":"boolean","title":"Enqueued"},"test_event_code":{"type":"string","title":"Test Event Code"},"queued_event_id":{"type":"string","title":"Queued Event Id"}},"type":"object","required":["enqueued","test_event_code","queued_event_id"],"title":"SendMetaTestEventResponse","description":"Synthetic-Purchase fan-out result (the actual CAPI POST is async)."},"SendPaymentLinkRequest":{"properties":{"thread_id":{"type":"string","format":"uuid","title":"Thread Id"},"note":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Note"}},"type":"object","required":["thread_id"],"title":"SendPaymentLinkRequest"},"SendPaymentLinkResponse":{"properties":{"message_id":{"type":"string","title":"Message Id"},"channel":{"type":"string","title":"Channel"},"pay_url":{"type":"string","title":"Pay Url"}},"type":"object","required":["message_id","channel","pay_url"],"title":"SendPaymentLinkResponse"},"SendRecoveryEmailResponse":{"properties":{"checkout_id":{"type":"string","format":"uuid","title":"Checkout Id"},"email":{"type":"string","title":"Email"},"sent_at":{"type":"string","format":"date-time","title":"Sent At"}},"type":"object","required":["checkout_id","email","sent_at"],"title":"SendRecoveryEmailResponse","description":"Result of a recovery-email send attempt."},"SendTestEmailRequest":{"properties":{"recipient":{"type":"string","format":"email","title":"Recipient"},"variables":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Variables"}},"type":"object","required":["recipient"],"title":"SendTestEmailRequest","description":"Body for ``POST /stores/{store_id}/email-templates/{id}/send-test``."},"SendTestEmailResponse":{"properties":{"sent":{"type":"boolean","title":"Sent"},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id"}},"type":"object","required":["sent"],"title":"SendTestEmailResponse","description":"Send-test outcome."},"SendTikTokTestEventRequest":{"properties":{"test_event_code":{"type":"string","maxLength":64,"minLength":1,"title":"Test Event Code"}},"type":"object","required":["test_event_code"],"title":"SendTikTokTestEventRequest","description":"Body for the TikTok test-event endpoint."},"SendTikTokTestEventResponse":{"properties":{"enqueued":{"type":"boolean","title":"Enqueued"},"test_event_code":{"type":"string","title":"Test Event Code"},"queued_event_id":{"type":"string","title":"Queued Event Id"}},"type":"object","required":["enqueued","test_event_code","queued_event_id"],"title":"SendTikTokTestEventResponse","description":"Synthetic-Purchase fan-out result (the actual POST is async)."},"SessionDetailResponse":{"properties":{"session_fingerprint":{"type":"string","title":"Session Fingerprint"},"device_type":{"type":"string","title":"Device Type"},"referrer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referrer"},"page_count":{"type":"integer","title":"Page Count"},"duration_seconds":{"type":"integer","title":"Duration Seconds"},"timeline":{"items":{"$ref":"#/components/schemas/TimelineEvent"},"type":"array","title":"Timeline"}},"type":"object","required":["session_fingerprint","device_type","referrer","page_count","duration_seconds","timeline"],"title":"SessionDetailResponse"},"SessionSummaryItem":{"properties":{"session_fingerprint":{"type":"string","title":"Session Fingerprint"},"page_count":{"type":"integer","title":"Page Count"},"duration_seconds":{"type":"integer","title":"Duration Seconds"},"started_at":{"type":"string","title":"Started At"},"device_type":{"type":"string","title":"Device Type"},"referrer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referrer"},"funnel_reached":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Funnel Reached"},"has_order":{"type":"boolean","title":"Has Order"}},"type":"object","required":["session_fingerprint","page_count","duration_seconds","started_at","device_type","referrer","funnel_reached","has_order"],"title":"SessionSummaryItem"},"SessionsOverview":{"properties":{"total_sessions":{"type":"integer","title":"Total Sessions"},"avg_duration_seconds":{"type":"integer","title":"Avg Duration Seconds"},"bounce_rate":{"type":"number","title":"Bounce Rate"},"sessions_with_order_pct":{"type":"number","title":"Sessions With Order Pct"}},"type":"object","required":["total_sessions","avg_duration_seconds","bounce_rate","sessions_with_order_pct"],"title":"SessionsOverview"},"SessionsResponse":{"properties":{"overview":{"$ref":"#/components/schemas/SessionsOverview"},"sessions":{"items":{"$ref":"#/components/schemas/SessionSummaryItem"},"type":"array","title":"Sessions"}},"type":"object","required":["overview","sessions"],"title":"SessionsResponse"},"SetAvatarRequest":{"properties":{"thread_id":{"type":"string","format":"uuid","title":"Thread Id"}},"type":"object","required":["thread_id"],"title":"SetAvatarRequest"},"SetAvatarResponse":{"properties":{"avatar_url":{"type":"string","title":"Avatar Url"}},"type":"object","required":["avatar_url"],"title":"SetAvatarResponse"},"SetImageAltRequest":{"properties":{"image_url":{"type":"string","title":"Image Url","description":"URL of the image to describe"},"alt":{"anyOf":[{"type":"string","maxLength":250},{"type":"null"}],"title":"Alt","description":"Alt text. Null or empty clears it."}},"type":"object","required":["image_url"],"title":"SetImageAltRequest","description":"Set alt text for one product image.","example":{"alt":"Navy blue sponge hijab, folded","image_url":"https://cdn.numu.com/products/img-001.jpg"}},"SetLevelRequest":{"properties":{"available":{"type":"integer","minimum":0.0,"title":"Available"}},"type":"object","required":["available"],"title":"SetLevelRequest"},"ShipmentListItemResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"order_id":{"type":"string","format":"uuid","title":"Order Id"},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number"},"tracking_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Url"},"awb_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Awb Url"},"carrier":{"type":"string","title":"Carrier"},"status":{"type":"string","title":"Status"},"shipment_type":{"type":"string","title":"Shipment Type"},"shipping_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipping Method"},"cod_amount":{"type":"integer","title":"Cod Amount","default":0},"cod_collected":{"type":"boolean","title":"Cod Collected","default":false},"delivery_attempts":{"type":"integer","title":"Delivery Attempts","default":0},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"shipped_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Shipped At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"}},"type":"object","required":["id","order_id","carrier","status","shipment_type"],"title":"ShipmentListItemResponse","description":"Summary shipment for list views."},"ShipmentResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"store_id":{"type":"string","format":"uuid","title":"Store Id"},"order_id":{"type":"string","format":"uuid","title":"Order Id"},"carrier":{"type":"string","title":"Carrier"},"carrier_shipment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Carrier Shipment Id"},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number"},"tracking_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Url"},"awb_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Awb Url"},"status":{"type":"string","title":"Status"},"shipment_type":{"type":"string","title":"Shipment Type"},"parent_shipment_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Shipment Id"},"shipping_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipping Method"},"shipping_cost":{"type":"integer","title":"Shipping Cost","default":0},"cod_amount":{"type":"integer","title":"Cod Amount","default":0},"cod_collected":{"type":"boolean","title":"Cod Collected","default":false},"cod_collected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cod Collected At"},"delivery_attempts":{"type":"integer","title":"Delivery Attempts","default":0},"status_history":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Status History","default":[]},"shipped_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Shipped At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"},"cancelled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cancelled At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","store_id","order_id","carrier","status","shipment_type"],"title":"ShipmentResponse","description":"Full shipment detail response."},"ShipmentStatsResponse":{"properties":{"total":{"type":"integer","title":"Total","default":0},"by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Status","default":{}},"cod_total":{"type":"integer","title":"Cod Total","default":0},"cod_collected":{"type":"integer","title":"Cod Collected","default":0},"cod_pending":{"type":"integer","title":"Cod Pending","default":0}},"type":"object","title":"ShipmentStatsResponse","description":"Dashboard stats for shipments."},"ShippingCarrierStatus":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"is_configured":{"type":"boolean","title":"Is Configured","default":false},"last_configured":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Configured"}},"type":"object","title":"ShippingCarrierStatus","description":"Individual shipping carrier status."},"ShippingOptionResponse":{"properties":{"rate_id":{"type":"string","format":"uuid","title":"Rate Id"},"label":{"type":"string","title":"Label"},"label_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label Ar"},"amount_cents":{"type":"integer","title":"Amount Cents"},"currency":{"type":"string","title":"Currency"},"estimated_days_min":{"type":"integer","title":"Estimated Days Min"},"estimated_days_max":{"type":"integer","title":"Estimated Days Max"},"cod_supported":{"type":"boolean","title":"Cod Supported"},"rate_type":{"$ref":"#/components/schemas/RateType"}},"type":"object","required":["rate_id","label","label_ar","amount_cents","currency","estimated_days_min","estimated_days_max","cod_supported","rate_type"],"title":"ShippingOptionResponse"},"ShippingOptionsResponse":{"properties":{"options":{"items":{"$ref":"#/components/schemas/ShippingOptionResponse"},"type":"array","title":"Options"},"free_shipping_progress":{"anyOf":[{"$ref":"#/components/schemas/FreeShippingProgressResponse"},{"type":"null"}]},"unavailable_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unavailable Reason"}},"type":"object","required":["options"],"title":"ShippingOptionsResponse"},"ShippingSettingsResponse":{"properties":{"carriers":{"additionalProperties":{"$ref":"#/components/schemas/ShippingCarrierStatus"},"type":"object","title":"Carriers","default":{}},"aramex":{"$ref":"#/components/schemas/ShippingCarrierStatus"},"bosta":{"$ref":"#/components/schemas/ShippingCarrierStatus"},"mylerz":{"$ref":"#/components/schemas/ShippingCarrierStatus"},"manual":{"$ref":"#/components/schemas/ShippingCarrierStatus"},"zones":{"items":{"$ref":"#/components/schemas/ShippingZone"},"type":"array","title":"Zones","default":[]},"free_shipping_threshold":{"type":"number","title":"Free Shipping Threshold","default":0},"restrict_to_zones":{"type":"boolean","title":"Restrict To Zones","default":false}},"type":"object","required":["aramex","bosta","mylerz","manual"],"title":"ShippingSettingsResponse","description":"Shipping settings response."},"ShippingZone":{"properties":{"id":{"type":"string","title":"Id"},"zone":{"type":"string","title":"Zone"},"governorates":{"type":"string","title":"Governorates"},"rate":{"type":"number","title":"Rate"},"estimated_days":{"type":"string","title":"Estimated Days"}},"type":"object","required":["id","zone","governorates","rate","estimated_days"],"title":"ShippingZone","description":"Shipping zone configuration."},"SignalItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"kind":{"type":"string","title":"Kind"},"rule_id":{"type":"string","title":"Rule Id"},"severity":{"type":"string","title":"Severity"},"title":{"type":"string","title":"Title"},"action":{"type":"string","title":"Action"},"expected_impact_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Impact Cents"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","kind","rule_id","severity","title","action","expected_impact_cents","created_at"],"title":"SignalItem"},"SignalsResponse":{"properties":{"signals":{"items":{"$ref":"#/components/schemas/SignalItem"},"type":"array","title":"Signals"}},"type":"object","required":["signals"],"title":"SignalsResponse"},"SimilarProof":{"properties":{"proof_id":{"type":"string","format":"uuid","title":"Proof Id"},"order_id":{"type":"string","format":"uuid","title":"Order Id"},"order_number":{"type":"string","title":"Order Number"},"status":{"type":"string","title":"Status"},"transaction_ref":{"type":"string","title":"Transaction Ref"},"declared_amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Declared Amount Cents"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"signed_image_url":{"type":"string","title":"Signed Image Url"},"hamming_distance":{"type":"integer","title":"Hamming Distance"}},"type":"object","required":["proof_id","order_id","order_number","status","transaction_ref","declared_amount_cents","created_at","signed_image_url","hamming_distance"],"title":"SimilarProof","description":"One match on the per-store pHash neighbour scan.\n\nMirrors the shape ``PaymentProofResponse`` exposes so the merchant\nreview pane can reuse the same image-streaming path; the extra\n``order_number`` + ``hamming_distance`` fields drive the\n\"Possibly related submissions\" UI."},"SocialConnectionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Connection UUID"},"platform":{"type":"string","title":"Platform"},"handle":{"type":"string","title":"Handle"},"followers":{"type":"integer","title":"Followers"},"posts_count":{"type":"integer","title":"Posts Count"},"status":{"type":"string","title":"Status"},"last_synced_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Synced At"}},"type":"object","required":["id","platform","handle","followers","posts_count","status"],"title":"SocialConnectionResponse","description":"Response for a social connection."},"SocialPostResponse":{"properties":{"platform_post_id":{"type":"string","title":"Platform Post Id"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"caption":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caption"},"likes":{"type":"integer","title":"Likes","default":0},"comments":{"type":"integer","title":"Comments","default":0},"posted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Posted At"},"imported":{"type":"boolean","title":"Imported","default":false},"suggested_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Name"},"suggested_name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Name Ar"},"suggested_price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Suggested Price"}},"type":"object","required":["platform_post_id"],"title":"SocialPostResponse","description":"Response for a social post."},"SocialPostsListResponse":{"properties":{"posts":{"items":{"$ref":"#/components/schemas/SocialPostResponse"},"type":"array","title":"Posts"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["posts"],"title":"SocialPostsListResponse","description":"Response for listing social posts."},"SocialProfileResponse":{"properties":{"kind":{"type":"string","title":"Kind"},"id":{"type":"string","title":"Id"},"channel":{"type":"string","title":"Channel"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message At"},"last_message_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message Preview"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"inbox_path":{"type":"string","title":"Inbox Path"}},"type":"object","required":["kind","id","channel","name","avatar_url","phone","last_message_at","last_message_preview","status","inbox_path"],"title":"SocialProfileResponse","description":"One linked conversation, shaped for the customer profile page."},"SocialProfilesResponse":{"properties":{"profiles":{"items":{"$ref":"#/components/schemas/SocialProfileResponse"},"type":"array","title":"Profiles"}},"type":"object","required":["profiles"],"title":"SocialProfilesResponse"},"StandardFieldSetting":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":true},"required":{"type":"boolean","title":"Required","default":false}},"type":"object","title":"StandardFieldSetting"},"StepTimingResponse":{"properties":{"from_step":{"type":"string","title":"From Step"},"to_step":{"type":"string","title":"To Step"},"avg_minutes":{"type":"number","title":"Avg Minutes"}},"type":"object","required":["from_step","to_step","avg_minutes"],"title":"StepTimingResponse"},"StockAdjustmentRequest":{"properties":{"product_id":{"type":"string","title":"Product Id"},"adjustment":{"type":"integer","title":"Adjustment"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["product_id","adjustment"],"title":"StockAdjustmentRequest","description":"Stock adjustment request."},"StockAdjustmentResponse":{"properties":{"product_id":{"type":"string","title":"Product Id"},"previous_quantity":{"type":"integer","title":"Previous Quantity"},"new_quantity":{"type":"integer","title":"New Quantity"},"adjustment":{"type":"integer","title":"Adjustment"}},"type":"object","required":["product_id","previous_quantity","new_quantity","adjustment"],"title":"StockAdjustmentResponse","description":"Stock adjustment response."},"StockoutPrediction":{"properties":{"product_id":{"type":"string","title":"Product Id"},"name":{"type":"string","title":"Name"},"quantity":{"type":"integer","title":"Quantity"},"velocity_per_day":{"type":"number","title":"Velocity Per Day"},"days_left":{"type":"number","title":"Days Left"},"run_out_date":{"type":"string","title":"Run Out Date"},"early_date":{"type":"string","title":"Early Date"},"late_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Late Date"},"urgent":{"type":"boolean","title":"Urgent"},"confidence":{"type":"string","title":"Confidence"},"suggested_reorder_qty":{"type":"integer","title":"Suggested Reorder Qty"}},"type":"object","required":["product_id","name","quantity","velocity_per_day","days_left","run_out_date","early_date","late_date","urgent","confidence","suggested_reorder_qty"],"title":"StockoutPrediction"},"StoreInstalledThemesResponse":{"properties":{"installations":{"items":{"$ref":"#/components/schemas/StoreThemeInstallationResponse"},"type":"array","title":"Installations"},"active_installation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Installation Id"}},"type":"object","required":["installations"],"title":"StoreInstalledThemesResponse","description":"List of all theme installations for a store."},"StoreSettingsResponse":{"properties":{"payment":{"$ref":"#/components/schemas/PaymentSettingsResponse"},"shipping":{"$ref":"#/components/schemas/ShippingSettingsResponse"},"whatsapp":{"$ref":"#/components/schemas/WhatsAppSettingsResponse"}},"type":"object","required":["payment","shipping","whatsapp"],"title":"StoreSettingsResponse","description":"Combined store settings response."},"StoreThemeInstallationResponse":{"properties":{"id":{"type":"string","title":"Id"},"store_id":{"type":"string","title":"Store Id"},"theme_id":{"type":"string","title":"Theme Id"},"theme_version_id":{"type":"string","title":"Theme Version Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"theme_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Slug"},"theme_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Name"},"theme_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Type"},"theme_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Version"},"theme_thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Thumbnail Url"},"bundle_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bundle Url"},"css_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Css Url"},"is_active":{"type":"boolean","title":"Is Active"},"has_draft_changes":{"type":"boolean","title":"Has Draft Changes"},"customization":{"additionalProperties":true,"type":"object","title":"Customization"},"draft_customization":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Draft Customization"},"installed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Installed At"},"activated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activated At"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","store_id","theme_id","theme_version_id","is_active","has_draft_changes","customization","created_at","updated_at"],"title":"StoreThemeInstallationResponse","description":"Full store theme installation detail.","example":{"activated_at":"2026-04-11T00:01:00Z","created_at":"2026-04-11T00:00:00Z","customization":{},"has_draft_changes":false,"id":"install-uuid","installed_at":"2026-04-11T00:00:00Z","is_active":true,"store_id":"store-uuid","theme_id":"theme-uuid","theme_name":"Modern","theme_slug":"modern","theme_type":"internal","theme_version":"1.0.0","updated_at":"2026-04-11T00:01:00Z"}},"StoreThemeListItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"nameAr":{"type":"string","title":"Namear"},"layout":{"type":"string","title":"Layout"},"description":{"type":"string","title":"Description"},"is_external":{"type":"boolean","title":"Is External","default":false},"bundle_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bundle Url"},"css_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Css Url"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"source_repo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Repo"},"settings_schema":{"anyOf":[{"items":{},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Settings Schema"},"section_schemas":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Section Schemas"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}},"type":"object","required":["id","name","nameAr","layout","description"],"title":"StoreThemeListItem","description":"A single theme entry for the merchant dashboard themes list."},"StoreThemesListResponse":{"properties":{"themes":{"items":{"$ref":"#/components/schemas/StoreThemeListItem"},"type":"array","title":"Themes"},"active_theme_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Theme Id"}},"type":"object","required":["themes"],"title":"StoreThemesListResponse","description":"Response with all themes available to a store (built-in + external)."},"StorefrontPasswordResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"has_password":{"type":"boolean","title":"Has Password"},"billing_locked":{"type":"boolean","title":"Billing Locked","default":false},"billing_lock_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Lock Reason"},"billing_lock_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Lock Password"}},"type":"object","required":["enabled","has_password"],"title":"StorefrontPasswordResponse"},"SubmitExternalThemeRequest":{"properties":{"github_url":{"type":"string","pattern":"^https://github\\.com/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+/?$","title":"Github Url","description":"Public GitHub repository URL (e.g., https://github.com/user/my-numu-theme)"},"branch":{"type":"string","title":"Branch","description":"Branch to build from","default":"main"}},"type":"object","required":["github_url"],"title":"SubmitExternalThemeRequest","description":"Request to submit an external theme from a GitHub repository."},"SubmitInvoiceResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"invoice_id":{"type":"string","format":"uuid","title":"Invoice Id"},"invoice_number":{"type":"string","title":"Invoice Number"},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"eta_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Uuid"},"eta_long_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Long Id"},"eta_portal_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Portal Url"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["success","invoice_id","invoice_number","status"],"title":"SubmitInvoiceResponse","description":"Response after submitting invoice to ETA."},"SuccessResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse","description":"Success response wrapper for single items."},"SuccessResponse_AbandonedCheckoutListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/AbandonedCheckoutListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[AbandonedCheckoutListResponse]"},"SuccessResponse_AbandonedCheckoutResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/AbandonedCheckoutResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[AbandonedCheckoutResponse]"},"SuccessResponse_AbandonedCheckoutSummaryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/AbandonedCheckoutSummaryResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[AbandonedCheckoutSummaryResponse]"},"SuccessResponse_ActivateThemeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ActivateThemeResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ActivateThemeResponse]"},"SuccessResponse_AnalyticsEraseResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/AnalyticsEraseResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[AnalyticsEraseResponse]"},"SuccessResponse_AnnotationsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/AnnotationsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[AnnotationsResponse]"},"SuccessResponse_ApiKeyInfoResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ApiKeyInfoResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ApiKeyInfoResponse]"},"SuccessResponse_AppInstallation_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/AppInstallation"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[AppInstallation]"},"SuccessResponse_AudienceEstimate_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/AudienceEstimate"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[AudienceEstimate]"},"SuccessResponse_AutopilotExceptionListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/AutopilotExceptionListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[AutopilotExceptionListResponse]"},"SuccessResponse_AutosaveDraftResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/AutosaveDraftResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[AutosaveDraftResponse]"},"SuccessResponse_BalancesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/BalancesResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[BalancesResponse]"},"SuccessResponse_BenchmarksResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/BenchmarksResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[BenchmarksResponse]"},"SuccessResponse_BostaCredentialsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/BostaCredentialsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[BostaCredentialsResponse]"},"SuccessResponse_BulkShipmentResultResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/BulkShipmentResultResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[BulkShipmentResultResponse]"},"SuccessResponse_BulkUpdateOrderStatusResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/BulkUpdateOrderStatusResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[BulkUpdateOrderStatusResponse]"},"SuccessResponse_BundleResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/BundleResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[BundleResponse]"},"SuccessResponse_CampaignRecipientsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CampaignRecipientsListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CampaignRecipientsListResponse]"},"SuccessResponse_CategoryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CategoryResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CategoryResponse]"},"SuccessResponse_CodAutopilotResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CodAutopilotResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CodAutopilotResponse]"},"SuccessResponse_CodRejectionStatsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CodRejectionStatsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CodRejectionStatsResponse]"},"SuccessResponse_CodSummaryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CodSummaryResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CodSummaryResponse]"},"SuccessResponse_CodTrustResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CodTrustResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CodTrustResponse]"},"SuccessResponse_ConversationListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ConversationListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ConversationListResponse]"},"SuccessResponse_ConversationSummary_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ConversationSummary"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ConversationSummary]"},"SuccessResponse_ConversionStatsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ConversionStatsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ConversionStatsResponse]"},"SuccessResponse_CouponResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CouponResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CouponResponse]"},"SuccessResponse_CoverageResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CoverageResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CoverageResponse]"},"SuccessResponse_CustomerAnalyticsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CustomerAnalyticsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CustomerAnalyticsResponse]"},"SuccessResponse_CustomerHealthResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CustomerHealthResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CustomerHealthResponse]"},"SuccessResponse_CustomerResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CustomerResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CustomerResponse]"},"SuccessResponse_CustomerSegmentsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CustomerSegmentsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CustomerSegmentsResponse]"},"SuccessResponse_CustomerTrustStatsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CustomerTrustStatsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CustomerTrustStatsResponse]"},"SuccessResponse_CustomizationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/CustomizationResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CustomizationResponse]"},"SuccessResponse_DefaultTemplateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/DefaultTemplateResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[DefaultTemplateResponse]"},"SuccessResponse_DigestContent_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/DigestContent"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[DigestContent]"},"SuccessResponse_DigestSettings_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/DigestSettings"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[DigestSettings]"},"SuccessResponse_DiscardDraftResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/DiscardDraftResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[DiscardDraftResponse]"},"SuccessResponse_EmailTemplateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/EmailTemplateResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[EmailTemplateResponse]"},"SuccessResponse_EmbeddedSignupConfig_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/EmbeddedSignupConfig"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[EmbeddedSignupConfig]"},"SuccessResponse_EmbeddedSignupResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/EmbeddedSignupResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[EmbeddedSignupResponse]"},"SuccessResponse_ExecutiveResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ExecutiveResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ExecutiveResponse]"},"SuccessResponse_ExternalThemeInfoResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ExternalThemeInfoResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ExternalThemeInfoResponse]"},"SuccessResponse_FawaterakCredentialsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/FawaterakCredentialsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[FawaterakCredentialsResponse]"},"SuccessResponse_ForecastResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ForecastResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ForecastResponse]"},"SuccessResponse_FunnelResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/src__api__v1__routes__stores__analytics__FunnelResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[FunnelResponse]"},"SuccessResponse_GatewayBreakdownResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/GatewayBreakdownResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[GatewayBreakdownResponse]"},"SuccessResponse_GiftCardResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/GiftCardResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[GiftCardResponse]"},"SuccessResponse_HealthScoreResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/HealthScoreResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[HealthScoreResponse]"},"SuccessResponse_ImportFromUrlResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ImportFromUrlResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ImportFromUrlResponse]"},"SuccessResponse_ImportPostsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ImportPostsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ImportPostsResponse]"},"SuccessResponse_ImportResultResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ImportResultResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ImportResultResponse]"},"SuccessResponse_InsightsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/InsightsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[InsightsResponse]"},"SuccessResponse_InstapayCredentialsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/InstapayCredentialsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[InstapayCredentialsResponse]"},"SuccessResponse_InventoryAnalyticsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/InventoryAnalyticsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[InventoryAnalyticsResponse]"},"SuccessResponse_InventoryLevelResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/InventoryLevelResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[InventoryLevelResponse]"},"SuccessResponse_InventoryStatsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/InventoryStatsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[InventoryStatsResponse]"},"SuccessResponse_InvoiceResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/src__api__v1__schemas__tenant__invoice__InvoiceResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[InvoiceResponse]"},"SuccessResponse_InvoiceSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/InvoiceSettingsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[InvoiceSettingsResponse]"},"SuccessResponse_IssuedGiftCardResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/IssuedGiftCardResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[IssuedGiftCardResponse]"},"SuccessResponse_JourneyResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/JourneyResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[JourneyResponse]"},"SuccessResponse_KashierCredentialsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/KashierCredentialsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[KashierCredentialsResponse]"},"SuccessResponse_LocationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/LocationResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[LocationResponse]"},"SuccessResponse_LtvByChannelResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/LtvByChannelResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[LtvByChannelResponse]"},"SuccessResponse_MarketingAttributionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MarketingAttributionResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MarketingAttributionResponse]"},"SuccessResponse_MenuResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MenuResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MenuResponse]"},"SuccessResponse_MessageBubble_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MessageBubble"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MessageBubble]"},"SuccessResponse_MessageListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MessageListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MessageListResponse]"},"SuccessResponse_MetaMatchQualityResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MetaMatchQualityResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MetaMatchQualityResponse]"},"SuccessResponse_MetaTrackingResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MetaTrackingResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MetaTrackingResponse]"},"SuccessResponse_MetaTrackingStatusResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MetaTrackingStatusResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MetaTrackingStatusResponse]"},"SuccessResponse_MetricTargetsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MetricTargetsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MetricTargetsResponse]"},"SuccessResponse_MismatchSummary_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MismatchSummary"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MismatchSummary]"},"SuccessResponse_MoyasarCredentialsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MoyasarCredentialsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MoyasarCredentialsResponse]"},"SuccessResponse_MultiTouchAttributionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/MultiTouchAttributionResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[MultiTouchAttributionResponse]"},"SuccessResponse_NotificationSettings_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/src__api__v1__schemas__stores__whatsapp__NotificationSettings"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[NotificationSettings]"},"SuccessResponse_OnboardingResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/OnboardingResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[OnboardingResponse]"},"SuccessResponse_OrderActivitiesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/OrderActivitiesResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[OrderActivitiesResponse]"},"SuccessResponse_OrderActivityResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/OrderActivityResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[OrderActivityResponse]"},"SuccessResponse_OrderResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/OrderResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[OrderResponse]"},"SuccessResponse_OrderStreakResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/OrderStreakResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[OrderStreakResponse]"},"SuccessResponse_OrderTimelineResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/OrderTimelineResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[OrderTimelineResponse]"},"SuccessResponse_OrdersBreakdownResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/OrdersBreakdownResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[OrdersBreakdownResponse]"},"SuccessResponse_PageResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PageResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PageResponse]"},"SuccessResponse_PaginatedListResponse_CouponResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PaginatedListResponse_CouponResponse_"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PaginatedListResponse[CouponResponse]]"},"SuccessResponse_PaginatedListResponse_CustomerResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PaginatedListResponse_CustomerResponse_"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PaginatedListResponse[CustomerResponse]]"},"SuccessResponse_PaginatedListResponse_EmailTemplateResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PaginatedListResponse_EmailTemplateResponse_"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PaginatedListResponse[EmailTemplateResponse]]"},"SuccessResponse_PaginatedListResponse_InvoiceListResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PaginatedListResponse_InvoiceListResponse_"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PaginatedListResponse[InvoiceListResponse]]"},"SuccessResponse_PaginatedListResponse_OrderListItemResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PaginatedListResponse_OrderListItemResponse_"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PaginatedListResponse[OrderListItemResponse]]"},"SuccessResponse_PaginatedListResponse_ProductResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PaginatedListResponse_ProductResponse_"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PaginatedListResponse[ProductResponse]]"},"SuccessResponse_PaginatedListResponse_RefundListItemResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PaginatedListResponse_RefundListItemResponse_"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PaginatedListResponse[RefundListItemResponse]]"},"SuccessResponse_PartialAcceptanceResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PartialAcceptanceResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PartialAcceptanceResponse]"},"SuccessResponse_PaymentProofResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PaymentProofResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PaymentProofResponse]"},"SuccessResponse_PaymentSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PaymentSettingsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PaymentSettingsResponse]"},"SuccessResponse_PaymobCredentialsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PaymobCredentialsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PaymobCredentialsResponse]"},"SuccessResponse_PendingVerificationPage_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PendingVerificationPage"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PendingVerificationPage]"},"SuccessResponse_PredictionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PredictionsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PredictionsResponse]"},"SuccessResponse_PresetResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PresetResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PresetResponse]"},"SuccessResponse_PreviewEmailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PreviewEmailResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PreviewEmailResponse]"},"SuccessResponse_ProductLabelsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ProductLabelsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ProductLabelsResponse]"},"SuccessResponse_ProductPerformanceResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ProductPerformanceResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ProductPerformanceResponse]"},"SuccessResponse_ProductResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ProductResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ProductResponse]"},"SuccessResponse_PromotionAnalyticsOutput_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PromotionAnalyticsOutput"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PromotionAnalyticsOutput]"},"SuccessResponse_PromotionListOutput_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PromotionListOutput"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PromotionListOutput]"},"SuccessResponse_PromotionOutput_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PromotionOutput"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PromotionOutput]"},"SuccessResponse_PublishResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/PublishResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PublishResponse]"},"SuccessResponse_RateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/RateResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[RateResponse]"},"SuccessResponse_RealtimeGeoResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/RealtimeGeoResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[RealtimeGeoResponse]"},"SuccessResponse_RealtimeSnapshotResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/RealtimeSnapshotResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[RealtimeSnapshotResponse]"},"SuccessResponse_RecordedPaymentResult_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/RecordedPaymentResult"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[RecordedPaymentResult]"},"SuccessResponse_RefundResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/RefundResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[RefundResponse]"},"SuccessResponse_ReportBuilderResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ReportBuilderResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ReportBuilderResponse]"},"SuccessResponse_ResolveAutopilotExceptionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ResolveAutopilotExceptionResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ResolveAutopilotExceptionResponse]"},"SuccessResponse_ReturnResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ReturnResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ReturnResponse]"},"SuccessResponse_RevenueBreakdownResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/RevenueBreakdownResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[RevenueBreakdownResponse]"},"SuccessResponse_SalesOverviewResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SalesOverviewResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SalesOverviewResponse]"},"SuccessResponse_ScaffoldThemeResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ScaffoldThemeResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ScaffoldThemeResponse]"},"SuccessResponse_SchemaResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SchemaResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SchemaResponse]"},"SuccessResponse_SearchTermsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SearchTermsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SearchTermsResponse]"},"SuccessResponse_SendMetaTestEventResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SendMetaTestEventResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SendMetaTestEventResponse]"},"SuccessResponse_SendPaymentLinkResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SendPaymentLinkResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SendPaymentLinkResponse]"},"SuccessResponse_SendRecoveryEmailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SendRecoveryEmailResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SendRecoveryEmailResponse]"},"SuccessResponse_SendTestEmailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SendTestEmailResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SendTestEmailResponse]"},"SuccessResponse_SendTikTokTestEventResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SendTikTokTestEventResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SendTikTokTestEventResponse]"},"SuccessResponse_SessionDetailResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SessionDetailResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SessionDetailResponse]"},"SuccessResponse_SessionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SessionsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SessionsResponse]"},"SuccessResponse_SetAvatarResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SetAvatarResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SetAvatarResponse]"},"SuccessResponse_ShipmentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ShipmentResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ShipmentResponse]"},"SuccessResponse_ShipmentStatsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ShipmentStatsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ShipmentStatsResponse]"},"SuccessResponse_ShippingOptionsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ShippingOptionsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ShippingOptionsResponse]"},"SuccessResponse_ShippingSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ShippingSettingsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ShippingSettingsResponse]"},"SuccessResponse_ShippingZone_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ShippingZone"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ShippingZone]"},"SuccessResponse_SignalsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SignalsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SignalsResponse]"},"SuccessResponse_SocialPostsListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SocialPostsListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SocialPostsListResponse]"},"SuccessResponse_SocialProfilesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SocialProfilesResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SocialProfilesResponse]"},"SuccessResponse_StockAdjustmentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/StockAdjustmentResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[StockAdjustmentResponse]"},"SuccessResponse_StoreInstalledThemesResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/StoreInstalledThemesResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[StoreInstalledThemesResponse]"},"SuccessResponse_StoreSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/StoreSettingsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[StoreSettingsResponse]"},"SuccessResponse_StoreThemeInstallationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/StoreThemeInstallationResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[StoreThemeInstallationResponse]"},"SuccessResponse_StoreThemesListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/StoreThemesListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[StoreThemesListResponse]"},"SuccessResponse_StorefrontPasswordResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/StorefrontPasswordResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[StorefrontPasswordResponse]"},"SuccessResponse_SubmitInvoiceResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/SubmitInvoiceResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[SubmitInvoiceResponse]"},"SuccessResponse_TemplateListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/TemplateListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TemplateListResponse]"},"SuccessResponse_TemplateResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/TemplateResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TemplateResponse]"},"SuccessResponse_ThemeBuildResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ThemeBuildResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ThemeBuildResponse]"},"SuccessResponse_ThemeBuildStatusResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ThemeBuildStatusResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ThemeBuildStatusResponse]"},"SuccessResponse_ThemeExportResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ThemeExportResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ThemeExportResponse]"},"SuccessResponse_ThemeFileContentResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ThemeFileContentResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ThemeFileContentResponse]"},"SuccessResponse_ThemeFileListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ThemeFileListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ThemeFileListResponse]"},"SuccessResponse_ThemeValidationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ThemeValidationResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ThemeValidationResponse]"},"SuccessResponse_TikTokReplayResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/TikTokReplayResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TikTokReplayResponse]"},"SuccessResponse_TikTokReportResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/TikTokReportResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TikTokReportResponse]"},"SuccessResponse_TikTokShopStatusResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/TikTokShopStatusResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TikTokShopStatusResponse]"},"SuccessResponse_TikTokTrackingResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/TikTokTrackingResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TikTokTrackingResponse]"},"SuccessResponse_TikTokTrackingStatusResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/TikTokTrackingStatusResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TikTokTrackingStatusResponse]"},"SuccessResponse_TrackingSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/TrackingSettingsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TrackingSettingsResponse]"},"SuccessResponse_TransferResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/TransferResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TransferResponse]"},"SuccessResponse_TriggerReconciliationResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/TriggerReconciliationResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TriggerReconciliationResponse]"},"SuccessResponse_UndoEntryResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/UndoEntryResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[UndoEntryResponse]"},"SuccessResponse_UnreadCountResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/UnreadCountResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[UnreadCountResponse]"},"SuccessResponse_UploadedImageResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/UploadedImageResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[UploadedImageResponse]"},"SuccessResponse_UpsellRuleResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/UpsellRuleResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[UpsellRuleResponse]"},"SuccessResponse_UserResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/UserResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[UserResponse]"},"SuccessResponse_VerifyConnectionResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/VerifyConnectionResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[VerifyConnectionResponse]"},"SuccessResponse_VersionListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/VersionListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[VersionListResponse]"},"SuccessResponse_VersionPayloadResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/VersionPayloadResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[VersionPayloadResponse]"},"SuccessResponse_VodafoneCashCredentialsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/VodafoneCashCredentialsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[VodafoneCashCredentialsResponse]"},"SuccessResponse_WhatsAppAnalytics_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/WhatsAppAnalytics"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[WhatsAppAnalytics]"},"SuccessResponse_WhatsAppConnectionStatus_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/WhatsAppConnectionStatus"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[WhatsAppConnectionStatus]"},"SuccessResponse_WhatsAppMessageLogList_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/WhatsAppMessageLogList"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[WhatsAppMessageLogList]"},"SuccessResponse_WhatsAppSettingsResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/WhatsAppSettingsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[WhatsAppSettingsResponse]"},"SuccessResponse_WizardConfigResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/WizardConfigResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[WizardConfigResponse]"},"SuccessResponse_ZoneResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/ZoneResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[ZoneResponse]"},"SuccessResponse_dict_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"additionalProperties":true,"type":"object","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[dict]"},"SuccessResponse_dict_str__Any__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"additionalProperties":true,"type":"object","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[dict[str, Any]]"},"SuccessResponse_dict_str__int__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"additionalProperties":{"type":"integer"},"type":"object","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[dict[str, int]]"},"SuccessResponse_dict_str__str__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"additionalProperties":{"type":"string"},"type":"object","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[dict[str, str]]"},"SuccessResponse_list_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list]"},"SuccessResponse_list_AnalyticsTopProductResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/AnalyticsTopProductResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[AnalyticsTopProductResponse]]"},"SuccessResponse_list_AppCatalogEntry__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/AppCatalogEntry"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[AppCatalogEntry]]"},"SuccessResponse_list_AppInstallation__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/AppInstallation"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[AppInstallation]]"},"SuccessResponse_list_BundleResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/BundleResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[BundleResponse]]"},"SuccessResponse_list_CategoryResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/CategoryResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[CategoryResponse]]"},"SuccessResponse_list_DashboardTopProductResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/DashboardTopProductResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[DashboardTopProductResponse]]"},"SuccessResponse_list_EmailEventResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/EmailEventResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[EmailEventResponse]]"},"SuccessResponse_list_GiftCardResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/GiftCardResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[GiftCardResponse]]"},"SuccessResponse_list_GiftCardTransactionResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/GiftCardTransactionResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[GiftCardTransactionResponse]]"},"SuccessResponse_list_InventoryItemResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/InventoryItemResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[InventoryItemResponse]]"},"SuccessResponse_list_InventoryLevelResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/InventoryLevelResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[InventoryLevelResponse]]"},"SuccessResponse_list_LocationResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/LocationResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[LocationResponse]]"},"SuccessResponse_list_MenuResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/MenuResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[MenuResponse]]"},"SuccessResponse_list_MetaEventLogEntry__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/MetaEventLogEntry"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[MetaEventLogEntry]]"},"SuccessResponse_list_MismatchSummary__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/MismatchSummary"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[MismatchSummary]]"},"SuccessResponse_list_PageResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/PageResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[PageResponse]]"},"SuccessResponse_list_PaymentProofResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/PaymentProofResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[PaymentProofResponse]]"},"SuccessResponse_list_ReconciliationRunSummary__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/ReconciliationRunSummary"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[ReconciliationRunSummary]]"},"SuccessResponse_list_ReturnResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/ReturnResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[ReturnResponse]]"},"SuccessResponse_list_RevenueDataPointResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/RevenueDataPointResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[RevenueDataPointResponse]]"},"SuccessResponse_list_SalesByLocationResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/SalesByLocationResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[SalesByLocationResponse]]"},"SuccessResponse_list_SalesDataPointResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/SalesDataPointResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[SalesDataPointResponse]]"},"SuccessResponse_list_ShipmentListItemResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/ShipmentListItemResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[ShipmentListItemResponse]]"},"SuccessResponse_list_SimilarProof__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/SimilarProof"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[SimilarProof]]"},"SuccessResponse_list_SocialConnectionResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/SocialConnectionResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[SocialConnectionResponse]]"},"SuccessResponse_list_StockAdjustmentResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/StockAdjustmentResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[StockAdjustmentResponse]]"},"SuccessResponse_list_TikTokEventLogEntry__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/TikTokEventLogEntry"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[TikTokEventLogEntry]]"},"SuccessResponse_list_TrafficSourceResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/TrafficSourceResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[TrafficSourceResponse]]"},"SuccessResponse_list_TransactionResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/TransactionResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[TransactionResponse]]"},"SuccessResponse_list_TransferResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/TransferResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[TransferResponse]]"},"SuccessResponse_list_UndoEntryResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/UndoEntryResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[UndoEntryResponse]]"},"SuccessResponse_list_UpsellRuleResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/UpsellRuleResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[UpsellRuleResponse]]"},"SuccessResponse_list_ZoneResponse__":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/ZoneResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[ZoneResponse]]"},"TargetKind":{"type":"string","enum":["audience","product","category","customer_tag","geo"],"title":"TargetKind","description":"Audience / catalog dimension that a target rule applies to."},"TaxByRateItem":{"properties":{"rate_pct":{"type":"number","title":"Rate Pct"},"orders":{"type":"integer","title":"Orders"},"tax_cents":{"type":"integer","title":"Tax Cents"}},"type":"object","required":["rate_pct","orders","tax_cents"],"title":"TaxByRateItem"},"TaxLineResponse":{"properties":{"tax_type":{"type":"string","title":"Tax Type"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount"},"rate":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Rate"},"sub_type":{"type":"string","title":"Sub Type","default":"V009"}},"type":"object","required":["tax_type","amount","rate"],"title":"TaxLineResponse","description":"Tax line response."},"TemplateButton":{"properties":{"type":{"type":"string","title":"Type"},"text":{"type":"string","title":"Text"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"}},"type":"object","required":["type","text"],"title":"TemplateButton","description":"Template button definition."},"TemplateCategory":{"type":"string","enum":["UTILITY","MARKETING","AUTHENTICATION"],"title":"TemplateCategory"},"TemplateCreate":{"properties":{"name":{"type":"string","maxLength":512,"minLength":1,"pattern":"^[a-z0-9_]+$","title":"Name"},"language":{"type":"string","maxLength":10,"title":"Language","default":"ar"},"category":{"$ref":"#/components/schemas/TemplateCategory","default":"UTILITY"},"header_type":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Header Type"},"header_content":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Header Content"},"body_text":{"type":"string","maxLength":1024,"minLength":1,"title":"Body Text"},"footer_text":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Footer Text"},"buttons":{"items":{"$ref":"#/components/schemas/TemplateButton"},"type":"array","title":"Buttons","default":[]}},"type":"object","required":["name","body_text"],"title":"TemplateCreate","description":"Create a new WhatsApp message template."},"TemplateListResponse":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/TemplateResponse"},"type":"array","title":"Templates"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["templates","total"],"title":"TemplateListResponse","description":"List of templates."},"TemplateResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"store_id":{"type":"string","format":"uuid","title":"Store Id"},"meta_template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Meta Template Id"},"name":{"type":"string","title":"Name"},"language":{"type":"string","title":"Language"},"category":{"$ref":"#/components/schemas/TemplateCategory"},"status":{"$ref":"#/components/schemas/TemplateStatus"},"header_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header Type"},"header_content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header Content"},"body_text":{"type":"string","title":"Body Text"},"footer_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Footer Text"},"buttons":{"items":{"$ref":"#/components/schemas/TemplateButton"},"type":"array","title":"Buttons","default":[]},"is_system":{"type":"boolean","title":"Is System","default":false},"submitted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Submitted At"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"rejection_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejection Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","store_id","name","language","category","status","body_text","created_at","updated_at"],"title":"TemplateResponse","description":"WhatsApp template details."},"TemplateStatus":{"type":"string","enum":["PENDING","APPROVED","REJECTED","PAUSED"],"title":"TemplateStatus"},"TenantInfoResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"subdomain":{"type":"string","title":"Subdomain"},"plan":{"type":"string","title":"Plan"},"lifecycle_state":{"type":"string","title":"Lifecycle State"},"is_demo":{"type":"boolean","title":"Is Demo"},"is_on_trial":{"type":"boolean","title":"Is On Trial"},"is_read_only":{"type":"boolean","title":"Is Read Only"},"is_writable":{"type":"boolean","title":"Is Writable"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"days_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Remaining"},"trial_started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trial Started At"},"demo_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Demo Email"},"feature_flags":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Feature Flags","default":{}},"founder_cohort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Founder Cohort"}},"type":"object","required":["id","name","subdomain","plan","lifecycle_state","is_demo","is_on_trial","is_read_only","is_writable"],"title":"TenantInfoResponse","description":"Lightweight tenant info embedded in the /auth/me response.\n\nGives the merchant hub enough info to show demo banners,\ntrial countdowns, and read-only warnings without a separate API call."},"ThemeBuildResponse":{"properties":{"build_id":{"type":"string","title":"Build Id"},"status":{"$ref":"#/components/schemas/ThemeBuildStatus"},"message":{"type":"string","title":"Message"}},"type":"object","required":["build_id","status","message"],"title":"ThemeBuildResponse","description":"Response after submitting a theme for building."},"ThemeBuildStatus":{"type":"string","enum":["queued","cloning","validating","building","uploading","complete","failed"],"title":"ThemeBuildStatus","description":"Status of an external theme build."},"ThemeBuildStatusResponse":{"properties":{"build_id":{"type":"string","title":"Build Id"},"status":{"$ref":"#/components/schemas/ThemeBuildStatus"},"theme_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Theme Id"},"bundle_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bundle Url"},"css_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Css Url"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["build_id","status"],"title":"ThemeBuildStatusResponse","description":"Response for checking build status."},"ThemeExportResponse":{"properties":{"format":{"type":"string","title":"Format"},"version":{"type":"integer","title":"Version"},"exported_at":{"type":"string","title":"Exported At"},"theme":{"additionalProperties":true,"type":"object","title":"Theme"},"customization":{"additionalProperties":true,"type":"object","title":"Customization"},"customization_v3":{"additionalProperties":true,"type":"object","title":"Customization V3"}},"type":"object","required":["format","version","exported_at","theme","customization","customization_v3"],"title":"ThemeExportResponse","description":"Portable JSON export of an installation's theme + customization."},"ThemeFileContentResponse":{"properties":{"path":{"type":"string","title":"Path"},"content":{"type":"string","title":"Content"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["path","content"],"title":"ThemeFileContentResponse","description":"A single file with its full content."},"ThemeFileListResponse":{"properties":{"files":{"items":{"$ref":"#/components/schemas/ThemeFileMeta"},"type":"array","title":"Files"},"has_workspace":{"type":"boolean","title":"Has Workspace"}},"type":"object","required":["files","has_workspace"],"title":"ThemeFileListResponse","description":"The store's whole theme workspace as a flat file list."},"ThemeFileMeta":{"properties":{"path":{"type":"string","title":"Path"},"size":{"type":"integer","title":"Size"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["path","size"],"title":"ThemeFileMeta","description":"A file in the workspace without its content (for the file tree)."},"ThemeValidationResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"errors":{"items":{"$ref":"#/components/schemas/ValidationErrorModel"},"type":"array","title":"Errors"},"warnings":{"items":{"$ref":"#/components/schemas/ValidationErrorModel"},"type":"array","title":"Warnings"},"contract_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract Version"}},"type":"object","required":["valid","errors","warnings"],"title":"ThemeValidationResponse"},"TikTokEventLogEntry":{"properties":{"id":{"type":"string","title":"Id"},"event_id":{"type":"string","title":"Event Id"},"event_name":{"type":"string","title":"Event Name"},"event_time":{"type":"string","format":"date-time","title":"Event Time"},"pixel_id":{"type":"string","title":"Pixel Id"},"response_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Response Status"},"response_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Response Code"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"},"attempt_count":{"type":"integer","title":"Attempt Count","default":1},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"channel":{"type":"string","enum":["browser","server","both"],"title":"Channel","default":"server"},"request_payload_redacted":{"additionalProperties":true,"type":"object","title":"Request Payload Redacted"}},"type":"object","required":["id","event_id","event_name","event_time","pixel_id","created_at","request_payload_redacted"],"title":"TikTokEventLogEntry","description":"One row from the merchant dashboard's \"Recent events\" table.\n\nThe ``request_payload.user`` sub-object is dropped by the route layer;\nonly boolean presence indicators survive."},"TikTokPixelEntry":{"properties":{"pixel_id":{"type":"string","maxLength":64,"minLength":1,"title":"Pixel Id"},"pixel_enabled":{"type":"boolean","title":"Pixel Enabled","default":true},"api_enabled":{"type":"boolean","title":"Api Enabled","default":true},"label":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Label"},"role":{"anyOf":[{"type":"string","enum":["primary","retargeting","agency"]},{"type":"null"}],"title":"Role"}},"type":"object","required":["pixel_id"],"title":"TikTokPixelEntry","description":"One pixel in a store's multi-pixel TikTok configuration."},"TikTokReplayResponse":{"properties":{"queued":{"type":"integer","title":"Queued","default":0},"window_hours":{"type":"integer","title":"Window Hours","default":24}},"type":"object","title":"TikTokReplayResponse","description":"Result of queueing a replay of failed Events API deliveries."},"TikTokReportResponse":{"properties":{"connected":{"type":"boolean","title":"Connected"},"advertiser_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Advertiser Id"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"spend":{"type":"number","title":"Spend","default":0.0},"impressions":{"type":"integer","title":"Impressions","default":0},"clicks":{"type":"integer","title":"Clicks","default":0},"conversions":{"type":"number","title":"Conversions","default":0.0},"cost_per_conversion":{"type":"number","title":"Cost Per Conversion","default":0.0},"ctr":{"type":"number","title":"Ctr","default":0.0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["connected"],"title":"TikTokReportResponse","description":"Aggregated TikTok Marketing report for the hub reporting card.\n\n``connected`` is False when the store has no ``advertiser_id`` on file (or\nno OAuth-scoped token) — the UI then renders a \"Connect with TikTok to see\nad performance\" empty state instead of a zero-filled table."},"TikTokShopStatusResponse":{"properties":{"connected":{"type":"boolean","title":"Connected"},"shop_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shop Id"},"shop_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shop Name"},"region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Region"},"seller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seller Name"},"connected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Connected At"}},"type":"object","required":["connected"],"title":"TikTokShopStatusResponse","description":"Connection status for the hub's TikTok Shop card."},"TikTokTrackingResponse":{"properties":{"pixel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pixel Id"},"pixel_enabled":{"type":"boolean","title":"Pixel Enabled","default":false},"api_enabled":{"type":"boolean","title":"Api Enabled","default":false},"mode":{"type":"string","enum":["off","pixel_only","capi_only","both"],"title":"Mode","default":"off"},"api_access_token_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Access Token Masked"},"has_token":{"type":"boolean","title":"Has Token","default":false},"test_event_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Test Event Code"},"consent_required":{"type":"boolean","title":"Consent Required","default":false},"debug_mode":{"type":"boolean","title":"Debug Mode","default":false},"debug_mode_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Debug Mode Expires At"},"last_validated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Validated At"},"status":{"type":"string","enum":["disabled","configured_no_events","connected","failing","pending","browser_only"],"title":"Status","default":"disabled"},"purchase_trigger":{"anyOf":[{"type":"string","enum":["confirmed","processing","shipped","delivered"]},{"type":"null"}],"title":"Purchase Trigger"},"pixels":{"anyOf":[{"items":{"$ref":"#/components/schemas/TikTokPixelEntry"},"type":"array"},{"type":"null"}],"title":"Pixels"},"advertiser_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Advertiser Id"},"offline_event_set_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Offline Event Set Id"}},"type":"object","title":"TikTokTrackingResponse","description":"Shape returned by GET, PUT, DELETE on the tiktok-tracking endpoints.\n\nNEVER includes the raw Events API access token — only the masked form."},"TikTokTrackingStatusResponse":{"properties":{"status":{"type":"string","enum":["disabled","configured_no_events","connected","failing","pending","browser_only"],"title":"Status"},"mode":{"type":"string","enum":["off","pixel_only","capi_only","both"],"title":"Mode"},"last_validated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Validated At"},"recent_failure_rate":{"type":"number","title":"Recent Failure Rate","default":0.0},"recent_event_count":{"type":"integer","title":"Recent Event Count","default":0}},"type":"object","required":["status","mode"],"title":"TikTokTrackingStatusResponse","description":"Live status badge for the dashboard header."},"TimelineEvent":{"properties":{"type":{"type":"string","title":"Type"},"path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Path"},"step_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Step Data"},"timestamp":{"type":"string","title":"Timestamp"}},"type":"object","required":["type","timestamp"],"title":"TimelineEvent"},"TodayOrdersBand":{"properties":{"predicted":{"type":"integer","title":"Predicted"},"lower":{"type":"integer","title":"Lower"},"upper":{"type":"integer","title":"Upper"}},"type":"object","required":["predicted","lower","upper"],"title":"TodayOrdersBand"},"TokenRequest":{"properties":{"client_id":{"type":"string","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret"},"code":{"type":"string","title":"Code"},"grant_type":{"type":"string","title":"Grant Type","default":"authorization_code"}},"type":"object","required":["client_id","client_secret","code"],"title":"TokenRequest"},"TopPageItem":{"properties":{"path":{"type":"string","title":"Path"},"views":{"type":"integer","title":"Views"}},"type":"object","required":["path","views"],"title":"TopPageItem"},"TrackingSettingsResponse":{"properties":{"meta":{"$ref":"#/components/schemas/MetaTrackingResponse"},"tiktok":{"anyOf":[{"$ref":"#/components/schemas/TikTokTrackingResponse"},{"type":"null"}]}},"type":"object","required":["meta"],"title":"TrackingSettingsResponse","description":"Shape returned by GET /stores/{id}/settings/tracking — wrapper for\nthe per-channel tracking configs. ``meta`` and ``tiktok`` today; Google\nAds will land here later."},"TrafficSourceResponse":{"properties":{"source":{"type":"string","title":"Source"},"orders":{"type":"integer","title":"Orders"},"revenue":{"type":"integer","title":"Revenue"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["source","orders","revenue","percentage"],"title":"TrafficSourceResponse","description":"Traffic source attribution from UTM parameters."},"TransactionResponse":{"properties":{"id":{"type":"string","title":"Id"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"amount_cents":{"type":"integer","title":"Amount Cents"},"currency":{"type":"string","title":"Currency"},"status":{"type":"string","title":"Status"},"payment_method":{"type":"string","title":"Payment Method"},"gateway":{"type":"string","title":"Gateway"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"created_at":{"type":"string","title":"Created At"},"reference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Id"}},"type":"object","required":["id","order_id","amount_cents","currency","status","payment_method","gateway","customer_name","customer_email","created_at","reference_id"],"title":"TransactionResponse"},"TransferLineInput":{"properties":{"variant_id":{"type":"string","format":"uuid","title":"Variant Id"},"quantity":{"type":"integer","minimum":1.0,"title":"Quantity"}},"type":"object","required":["variant_id","quantity"],"title":"TransferLineInput"},"TransferLineResponse":{"properties":{"variant_id":{"type":"string","title":"Variant Id"},"quantity":{"type":"integer","title":"Quantity"}},"type":"object","required":["variant_id","quantity"],"title":"TransferLineResponse"},"TransferResponse":{"properties":{"id":{"type":"string","title":"Id"},"from_location_id":{"type":"string","title":"From Location Id"},"to_location_id":{"type":"string","title":"To Location Id"},"status":{"type":"string","title":"Status"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"carrier_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Carrier Reference"},"lines":{"items":{"$ref":"#/components/schemas/TransferLineResponse"},"type":"array","title":"Lines"},"requested_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested At"},"shipped_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipped At"},"received_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Received At"},"canceled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canceled At"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","from_location_id","to_location_id","status","lines","created_at","updated_at"],"title":"TransferResponse"},"TransferStatus":{"type":"string","enum":["draft","requested","in_transit","received","canceled"],"title":"TransferStatus"},"TransitionRequest":{"properties":{"target":{"$ref":"#/components/schemas/TransferStatus"}},"type":"object","required":["target"],"title":"TransitionRequest"},"TriggerReconciliationResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["run_id","status","message"],"title":"TriggerReconciliationResponse"},"UndoEntryRequest":{"properties":{"theme_id":{"type":"string","maxLength":64,"minLength":1,"title":"Theme Id"},"action_label":{"type":"string","maxLength":128,"minLength":1,"title":"Action Label"},"forward":{"additionalProperties":true,"type":"object","title":"Forward"},"inverse":{"additionalProperties":true,"type":"object","title":"Inverse"}},"type":"object","required":["theme_id","action_label"],"title":"UndoEntryRequest"},"UndoEntryResponse":{"properties":{"id":{"type":"string","title":"Id"},"theme_id":{"type":"string","title":"Theme Id"},"action_label":{"type":"string","title":"Action Label"},"forward":{"additionalProperties":true,"type":"object","title":"Forward"},"inverse":{"additionalProperties":true,"type":"object","title":"Inverse"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","theme_id","action_label","forward","inverse","created_at"],"title":"UndoEntryResponse"},"UnmarkPaidRequest":{"properties":{"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason"}},"type":"object","title":"UnmarkPaidRequest"},"UnreadCountResponse":{"properties":{"unread_count":{"type":"integer","title":"Unread Count","default":0}},"type":"object","title":"UnreadCountResponse","description":"Unread conversation count for sidebar badge."},"UpdateAssetMetaRequest":{"properties":{"key":{"type":"string","maxLength":1024,"minLength":1,"title":"Key"},"alt":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Alt"},"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"transform":{"anyOf":[{"$ref":"#/components/schemas/AssetTransform"},{"type":"null"}]}},"type":"object","required":["key"],"title":"UpdateAssetMetaRequest","description":"Update an uploaded asset's library metadata.\n\nOnly the friendly display *name*, *alt text* and a default focal/zoom\n*transform* are editable — the object key (and therefore the public URL)\nis immutable, because that URL may already be embedded in a published\nsection's settings. Renaming the object would silently break those\nreferences, so ``name`` here is a label stored in metadata, not a key\nchange."},"UpdateBundleRequest":{"properties":{"discount_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discount Type"},"discount_value":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Discount Value"},"position":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Position"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"section_title_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Title En"},"section_title_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Section Title Ar"}},"type":"object","title":"UpdateBundleRequest","description":"Partial update for a bundle."},"UpdateCarrierSettingsRequest":{"properties":{"auto_create_shipment":{"type":"boolean","title":"Auto Create Shipment"}},"type":"object","required":["auto_create_shipment"],"title":"UpdateCarrierSettingsRequest"},"UpdateCategoryRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Category name"},"slug":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Slug","description":"URL slug"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Category description"},"image_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Image Url","description":"Category image URL"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"Parent category UUID"},"position":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Position","description":"Sort position"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Whether the category is visible"},"seo_title":{"anyOf":[{"type":"string","maxLength":70},{"type":"null"}],"title":"Seo Title","description":"SEO page title for the collection page."},"robots_noindex":{"type":"boolean","title":"Robots Noindex","description":"Keep this page out of search results.","default":false},"canonical_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Canonical Url","description":"Absolute URL this page should credit as the original."},"sitemap_exclude":{"type":"boolean","title":"Sitemap Exclude","description":"Leave this page out of sitemap.xml.","default":false},"seo_description":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Seo Description","description":"SEO meta description for the collection page."},"social_image_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Social Image Url","description":"OG/Twitter card image for the collection page."},"template_suffix":{"anyOf":[{"type":"string","maxLength":32,"pattern":"^[a-z0-9][a-z0-9-]{0,31}$"},{"type":"null"}],"title":"Template Suffix","description":"Alternate template variant suffix (Shopify-style); null = base template."},"extra_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Data","description":"Extra metadata (e.g. name_ar, description_ar)"}},"type":"object","title":"UpdateCategoryRequest","description":"Update category request schema."},"UpdateCodAutopilotRequest":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"digest_hour":{"anyOf":[{"type":"integer","maximum":23.0,"minimum":0.0},{"type":"null"}],"title":"Digest Hour"},"delivery_check_delay_days":{"anyOf":[{"type":"integer","maximum":7.0,"minimum":1.0},{"type":"null"}],"title":"Delivery Check Delay Days"},"delivery_check_retry_days":{"anyOf":[{"type":"integer","maximum":7.0,"minimum":1.0},{"type":"null"}],"title":"Delivery Check Retry Days"},"delivery_check_max_attempts":{"anyOf":[{"type":"integer","maximum":3.0,"minimum":1.0},{"type":"null"}],"title":"Delivery Check Max Attempts"},"assumed_delivered_days":{"anyOf":[{"type":"integer","maximum":30.0,"minimum":5.0},{"type":"null"}],"title":"Assumed Delivered Days"}},"type":"object","title":"UpdateCodAutopilotRequest","description":"Update COD Autopilot settings (all fields optional)."},"UpdateCodTrustRequest":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"threshold":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Threshold"},"min_confidence":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}],"title":"Min Confidence"},"action":{"anyOf":[{"type":"string","enum":["block","warn","recover"]},{"type":"null"}],"title":"Action"},"recovery_promo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recovery Promo"},"auto_rto_disabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Rto Disabled"},"auto_rto_days":{"anyOf":[{"type":"integer","maximum":60.0,"minimum":7.0},{"type":"null"}],"title":"Auto Rto Days"}},"type":"object","title":"UpdateCodTrustRequest","description":"Update COD trust network settings (all fields optional)."},"UpdateCouponRequest":{"properties":{"code":{"anyOf":[{"type":"string","maxLength":50,"minLength":1},{"type":"null"}],"title":"Code","description":"Coupon code"},"coupon_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coupon Type","description":"Discount type: percentage, fixed, or free_shipping"},"value":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Value","description":"Discount value"},"min_order_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Min Order Amount","description":"Minimum order subtotal"},"max_discount_amount":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Max Discount Amount","description":"Maximum discount cap"},"usage_limit":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Usage Limit","description":"Total usage limit"},"valid_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Valid From","description":"Validity start"},"valid_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Valid Until","description":"Validity end"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Enable or disable the coupon"},"applicable_product_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Applicable Product Ids","description":"Product UUIDs this coupon applies to (null = all)"},"applicable_category_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Applicable Category Ids","description":"Category UUIDs this coupon applies to (null = all)"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Type-specific config for buy_x_get_y / tiered"}},"type":"object","title":"UpdateCouponRequest","description":"Update coupon request schema.","example":{"is_active":false,"value":"30.00"}},"UpdateCustomizationRequest":{"properties":{"customization_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customization Mode"},"identity":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Identity"},"theme":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Theme"},"header":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Header"},"hero":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Hero"},"products":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Products"},"footer":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Footer"},"navigation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Navigation"},"labels":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Labels"},"layout":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Layout"},"schema_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Schema Version"},"templates":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Templates"},"external_theme_merchant_settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"External Theme Merchant Settings"}},"type":"object","title":"UpdateCustomizationRequest","description":"Update customization settings request. All fields optional for partial updates.\n\nSupports both v1 (flat sections) and v2 (section engine) formats.\nWhen schema_version=2, the ``templates`` field holds per-page TemplateConfig objects.\nV1 fields (hero, products, layout, etc.) are still accepted for backwards compat."},"UpdateEmailTemplateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"subject":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Subject"},"html_body":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Html Body"},"is_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Enabled"},"from_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"From Name"},"reply_to":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Reply To"},"extra_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra Data"}},"type":"object","title":"UpdateEmailTemplateRequest","description":"Body for ``PUT /stores/{store_id}/email-templates/{id}``.\n\nAll fields are optional — ``None`` means *unchanged*."},"UpdateInvoiceRequest":{"properties":{"buyer":{"anyOf":[{"$ref":"#/components/schemas/BuyerInfoRequest"},{"type":"null"}]},"line_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/InvoiceLineItemRequest"},"type":"array"},{"type":"null"}],"title":"Line Items"},"extra_discount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Extra Discount"},"shipping_fee":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Shipping Fee"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"notes_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes Ar"}},"type":"object","title":"UpdateInvoiceRequest","description":"Update invoice request (only for draft invoices)."},"UpdateInvoiceSettingsRequest":{"properties":{"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"branch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch Id"},"activity_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activity Code"},"governorate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Governorate"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street"},"building_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Building Number"}},"type":"object","title":"UpdateInvoiceSettingsRequest","description":"Update invoice/tax settings."},"UpdateLinesRequest":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/TransferLineInput"},"type":"array","title":"Lines"}},"type":"object","title":"UpdateLinesRequest"},"UpdateMenuRequest":{"properties":{"title":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Title"},"items":{"anyOf":[{"items":{"$ref":"#/components/schemas/MenuItemSchema"},"type":"array"},{"type":"null"}],"title":"Items"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"UpdateMenuRequest","description":"Partial update of a menu (PUT by handle — upserts if absent)."},"UpdateNotificationSettingsRequest":{"properties":{"order_confirmation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Order Confirmation"},"payment_received":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Payment Received"},"shipping_update":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Shipping Update"},"delivery_confirmation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Delivery Confirmation"},"abandoned_cart":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Abandoned Cart"}},"type":"object","title":"UpdateNotificationSettingsRequest","description":"Update notification toggles (partial update). Field names match\nNotificationSettings exactly — only the supplied keys are written;\nomitted keys keep their current value."},"UpdateOrderRequest":{"properties":{"shipping_address":{"anyOf":[{"$ref":"#/components/schemas/OrderAddressRequest"},{"type":"null"}],"description":"Updated shipping address"},"billing_address":{"anyOf":[{"$ref":"#/components/schemas/OrderAddressRequest"},{"type":"null"}],"description":"Updated billing address"},"shipping_cost":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Shipping Cost","description":"Shipping cost in cents"},"tax_amount":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Tax Amount","description":"Tax amount in cents"},"discount_amount":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Discount Amount","description":"Discount in cents"},"payment_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Method","description":"Payment method"},"shipping_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipping Method","description":"Shipping method"},"tracking_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tracking Number","description":"Shipment tracking number"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Internal notes for the merchant"},"customer_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Notes","description":"Notes from the customer"}},"type":"object","title":"UpdateOrderRequest","description":"Update order request schema.","example":{"notes":"Called customer to confirm delivery time","tracking_number":"BOSTA-12345"}},"UpdatePageRequest":{"properties":{"title":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Body"},"seo":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Seo"},"is_published":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Published"},"template":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Template"},"template_suffix":{"anyOf":[{"type":"string","maxLength":32,"pattern":"^[a-z0-9][a-z0-9-]{0,31}$"},{"type":"null"}],"title":"Template Suffix","description":"Alternate template variant suffix (Shopify-style); null = base template."}},"type":"object","title":"UpdatePageRequest","description":"Partial update of a page (PUT by handle — upserts if absent)."},"UpdatePaymentSettingsRequest":{"properties":{"cod_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cod Enabled"},"fawry_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Fawry Enabled"},"fawaterak_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Fawaterak Enabled"},"paymob_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Paymob Enabled"},"kashier_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Kashier Enabled"},"instapay_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Instapay Enabled"},"moyasar_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Moyasar Enabled"},"vodafone_cash_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Vodafone Cash Enabled"},"we_pay_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"We Pay Enabled"},"orange_cash_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Orange Cash Enabled"},"bank_transfer_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Bank Transfer Enabled"},"cod_deposit_policy":{"anyOf":[{"$ref":"#/components/schemas/CodDepositPolicy"},{"type":"null"}]}},"type":"object","title":"UpdatePaymentSettingsRequest","description":"Update payment settings (only toggles, not API keys)."},"UpdateProductLabelsRequest":{"properties":{"labels":{"items":{"$ref":"#/components/schemas/ProductLabelDef"},"type":"array","maxItems":50,"title":"Labels"}},"type":"object","title":"UpdateProductLabelsRequest","description":"Replace the store's custom product-label list (full replace —\nthe hub always sends the complete list)."},"UpdatePromotionInput":{"properties":{"version":{"type":"integer","title":"Version"},"name":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Name"},"status":{"anyOf":[{"$ref":"#/components/schemas/PromotionStatus"},{"type":"null"}]},"coupon_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Coupon Id"},"discount_rule":{"anyOf":[{"$ref":"#/components/schemas/DiscountRule"},{"type":"null"}]},"content":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/DiscountCodeContent"},{"$ref":"#/components/schemas/AutomaticContent"},{"$ref":"#/components/schemas/AnnouncementBarContent"},{"$ref":"#/components/schemas/PopupContent"},{"$ref":"#/components/schemas/FloatingWidgetContent"},{"$ref":"#/components/schemas/CookieBannerContent"}],"discriminator":{"propertyName":"surface","mapping":{"announcement_bar":"#/components/schemas/AnnouncementBarContent","automatic":"#/components/schemas/AutomaticContent","cookie_banner":"#/components/schemas/CookieBannerContent","discount_code":"#/components/schemas/DiscountCodeContent","floating_widget":"#/components/schemas/FloatingWidgetContent","popup":"#/components/schemas/PopupContent"}}},{"type":"null"}],"title":"Content"},"translations":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/LocalizedPromotionContent"},"type":"object"},{"type":"null"}],"title":"Translations"},"displays":{"anyOf":[{"items":{"$ref":"#/components/schemas/PromotionDisplayInput"},"type":"array"},{"type":"null"}],"title":"Displays"},"targets":{"anyOf":[{"items":{"$ref":"#/components/schemas/PromotionTargetInput"},"type":"array"},{"type":"null"}],"title":"Targets"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"},"starts_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Starts At"},"ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ends At"},"usage_limit_total":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Usage Limit Total"},"usage_limit_per_customer":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Usage Limit Per Customer"}},"additionalProperties":false,"type":"object","required":["version"],"title":"UpdatePromotionInput","description":"Payload for `PATCH /stores/{id}/promotions/{pid}`.\n\nEvery field is optional. `version` is required for optimistic\nlocking — clients echo the version they read."},"UpdateRateRequest":{"properties":{"label":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Label"},"label_ar":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Label Ar"},"config":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/RateConfigFlat"},{"$ref":"#/components/schemas/RateConfigFreeOver"},{"$ref":"#/components/schemas/RateConfigWeightBand"},{"$ref":"#/components/schemas/RateConfigCarrierApi"}],"discriminator":{"propertyName":"type","mapping":{"carrier_api":"#/components/schemas/RateConfigCarrierApi","flat":"#/components/schemas/RateConfigFlat","free_over":"#/components/schemas/RateConfigFreeOver","weight_band":"#/components/schemas/RateConfigWeightBand"}}},{"type":"null"}],"title":"Config"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"sort_order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sort Order"}},"additionalProperties":false,"type":"object","title":"UpdateRateRequest"},"UpdateShippingSettingsRequest":{"properties":{"carriers":{"anyOf":[{"additionalProperties":{"type":"boolean"},"type":"object"},{"type":"null"}],"title":"Carriers"},"aramex_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Aramex Enabled"},"bosta_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Bosta Enabled"},"mylerz_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Mylerz Enabled"},"manual_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Manual Enabled"},"free_shipping_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Free Shipping Threshold"},"restrict_to_zones":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Restrict To Zones"}},"type":"object","title":"UpdateShippingSettingsRequest","description":"Update shipping settings.\n\nSend toggles via ``carriers`` — it works for every registered carrier,\nincluding J&T, which the legacy per-carrier fields below never\ncovered. Those fields still work and are applied first, so an\nexplicit ``carriers`` entry wins over a conflicting legacy one."},"UpdateShippingZoneRequest":{"properties":{"zone":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Zone"},"governorates":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"Governorates"},"rate":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Rate"},"estimated_days":{"anyOf":[{"type":"string","maxLength":50,"minLength":1},{"type":"null"}],"title":"Estimated Days"}},"type":"object","title":"UpdateShippingZoneRequest","description":"Update shipping zone request."},"UpdateStorefrontPasswordRequest":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"password":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Password"}},"type":"object","required":["enabled"],"title":"UpdateStorefrontPasswordRequest"},"UpdateUpsellRuleRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name","description":"Rule display name"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Whether the rule is active"},"trigger_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Type","description":"Trigger type"},"trigger_product_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Trigger Product Ids","description":"Product UUIDs that trigger this upsell"},"trigger_category_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Trigger Category Ids","description":"Category UUIDs that trigger this upsell"},"trigger_min_cart_value":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Trigger Min Cart Value","description":"Minimum cart value in cents"},"offer_product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Offer Product Id","description":"UUID of the product to upsell"},"discount_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discount Type","description":"Discount type"},"discount_value":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Discount Value","description":"Discount value"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority","description":"Priority"},"max_uses":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Max Uses","description":"Maximum uses"},"headline_ar":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Headline Ar","description":"Arabic headline"},"headline_en":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Headline En","description":"English headline"},"description_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description Ar","description":"Arabic description"},"description_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description En","description":"English description"}},"type":"object","title":"UpdateUpsellRuleRequest","description":"Update upsell rule request schema.","example":{"discount_value":30,"is_active":false}},"UpdateVariantRequest":{"properties":{"option_values":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Option Values"},"price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Price"},"price_currency":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Price Currency"},"compare_at_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Compare At Price"},"cost_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Cost Price"},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sku"},"barcode":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Barcode"},"inventory_quantity":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Inventory Quantity"},"image_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Image Url"},"weight_g":{"anyOf":[{"type":"number","minimum":0.0},{"type":"null"}],"title":"Weight G"},"position":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Position"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"fulfillment_type":{"anyOf":[{"$ref":"#/components/schemas/FulfillmentType"},{"type":"null"}]},"requires_shipping":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Requires Shipping"},"track_inventory":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Track Inventory"}},"type":"object","title":"UpdateVariantRequest","description":"PATCH body. Every field optional — only those explicitly set\nare applied. `Field(None)` sentinels distinguish \"not sent\" from\n\"set to null\"; for nullable columns the explicit-null clear is\nintentional (e.g. clearing a SKU)."},"UpdateWhatsAppSettingsRequest":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"notifications":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Notifications"}},"type":"object","title":"UpdateWhatsAppSettingsRequest","description":"Update WhatsApp settings."},"UpdateZoneRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"name_ar":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name Ar"},"governorate_codes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Governorate Codes","description":"If provided, replaces zone membership atomically."},"estimated_days_min":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":0.0},{"type":"null"}],"title":"Estimated Days Min"},"estimated_days_max":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":0.0},{"type":"null"}],"title":"Estimated Days Max"},"cod_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cod Enabled"},"cod_fee_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Cod Fee Cents"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"sort_order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sort Order"}},"additionalProperties":false,"type":"object","title":"UpdateZoneRequest"},"UploadedImageResponse":{"properties":{"url":{"type":"string","title":"Url","description":"Public URL of the uploaded image"},"key":{"type":"string","title":"Key","description":"Storage key / path"},"size":{"type":"integer","title":"Size","description":"File size in bytes"},"content_type":{"type":"string","title":"Content Type","description":"MIME type (e.g. image/jpeg)"},"product_id":{"type":"string","title":"Product Id","description":"Associated product UUID"},"variant_urls":{"additionalProperties":{"type":"string"},"type":"object","title":"Variant Urls","description":"URLs for resized variants (thumbnail, etc.)"}},"type":"object","required":["url","key","size","content_type","product_id"],"title":"UploadedImageResponse","description":"Uploaded image response schema.","example":{"content_type":"image/jpeg","key":"products/img-001.jpg","product_id":"550e8400-e29b-41d4-a716-446655440000","size":204800,"url":"https://cdn.numu.com/products/img-001.jpg","variant_urls":{"thumbnail":"https://cdn.numu.com/products/img-001_thumb.jpg"}}},"UpsellRuleResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Rule UUID"},"store_id":{"type":"string","title":"Store Id","description":"Owning store UUID"},"name":{"type":"string","title":"Name","description":"Rule display name"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the rule is active"},"trigger_type":{"type":"string","title":"Trigger Type","description":"Trigger type"},"trigger_product_ids":{"items":{"type":"string"},"type":"array","title":"Trigger Product Ids","description":"Trigger product UUIDs"},"trigger_category_ids":{"items":{"type":"string"},"type":"array","title":"Trigger Category Ids","description":"Trigger category UUIDs"},"trigger_min_cart_value":{"type":"integer","title":"Trigger Min Cart Value","description":"Minimum cart value in cents"},"offer_product_id":{"type":"string","title":"Offer Product Id","description":"Offer product UUID"},"discount_type":{"type":"string","title":"Discount Type","description":"Discount type"},"discount_value":{"type":"integer","title":"Discount Value","description":"Discount value"},"priority":{"type":"integer","title":"Priority","description":"Priority"},"max_uses":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Uses","description":"Maximum uses"},"uses_count":{"type":"integer","title":"Uses Count","description":"Current usage count"},"headline_ar":{"type":"string","title":"Headline Ar","description":"Arabic headline"},"headline_en":{"type":"string","title":"Headline En","description":"English headline"},"description_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description Ar","description":"Arabic description"},"description_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description En","description":"English description"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","title":"Updated At","description":"ISO 8601 last-update timestamp"}},"type":"object","required":["id","store_id","name","is_active","trigger_type","trigger_product_ids","trigger_category_ids","trigger_min_cart_value","offer_product_id","discount_type","discount_value","priority","max_uses","uses_count","headline_ar","headline_en","description_ar","description_en","created_at","updated_at"],"title":"UpsellRuleResponse","description":"Upsell rule response schema."},"UrlImportResultResponse":{"properties":{"url":{"type":"string","title":"Url"},"product_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Id"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"images_count":{"type":"integer","title":"Images Count","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["url"],"title":"UrlImportResultResponse","description":"Result for a single URL import."},"UserResponse":{"properties":{"id":{"type":"string","title":"Id","description":"User UUID"},"email":{"type":"string","title":"Email","description":"User email"},"first_name":{"type":"string","title":"First Name","description":"First name"},"last_name":{"type":"string","title":"Last Name","description":"Last name"},"full_name":{"type":"string","title":"Full Name","description":"Concatenated full name"},"role":{"type":"string","title":"Role","description":"User role: merchant, admin"},"status":{"type":"string","title":"Status","description":"Account status: active, suspended, pending"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Phone number"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url","description":"Profile avatar URL"},"is_verified":{"type":"boolean","title":"Is Verified","description":"Whether email is verified"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"},"updated_at":{"type":"string","title":"Updated At","description":"ISO 8601 last-update timestamp"},"trial_ends_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trial Ends At","description":"Trial period end date"},"tenant":{"anyOf":[{"$ref":"#/components/schemas/TenantInfoResponse"},{"type":"null"}],"description":"Tenant lifecycle state. Present when user owns a tenant."}},"type":"object","required":["id","email","first_name","last_name","full_name","role","status","phone","avatar_url","is_verified","created_at","updated_at"],"title":"UserResponse","description":"User response schema.","example":{"created_at":"2025-01-01T00:00:00Z","email":"yousef@numu.com","first_name":"Yousef","full_name":"Yousef Yahia","id":"550e8400-e29b-41d4-a716-446655440000","is_verified":true,"last_name":"Yahia","phone":"+201001234567","role":"merchant","status":"active","updated_at":"2025-01-01T00:00:00Z"}},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValidationErrorModel":{"properties":{"file":{"type":"string","title":"File"},"message":{"type":"string","title":"Message"},"severity":{"type":"string","title":"Severity"}},"type":"object","required":["file","message","severity"],"title":"ValidationErrorModel"},"VariantInput":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Id"},"position":{"type":"integer","minimum":0.0,"title":"Position","default":0},"option_values":{"additionalProperties":{"type":"string"},"type":"object","title":"Option Values"},"price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Price"},"price_currency":{"type":"string","maxLength":3,"title":"Price Currency","default":"EGP"},"compare_at_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Compare At Price"},"cost_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Cost Price"},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sku"},"barcode":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Barcode"},"inventory_quantity":{"type":"integer","minimum":0.0,"title":"Inventory Quantity","default":0},"image_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Image Url"},"weight":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight"}},"type":"object","required":["price"],"title":"VariantInput","description":"One purchasable variant on the create/update payload.\n\nOn create, `id` is omitted; on update, an existing id preserves the\nrow (otherwise a fresh variant is created and any variant whose id\nisn't present in the request gets soft-deleted via FK cascade when\nits product changes)."},"VariantResponse":{"properties":{"id":{"type":"string","title":"Id"},"product_id":{"type":"string","title":"Product Id"},"position":{"type":"integer","title":"Position"},"option_values":{"additionalProperties":{"type":"string"},"type":"object","title":"Option Values"},"price":{"type":"string","title":"Price"},"price_currency":{"type":"string","title":"Price Currency"},"compare_at_price":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compare At Price"},"cost_price":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cost Price"},"sku":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sku"},"barcode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Barcode"},"inventory_quantity":{"type":"integer","title":"Inventory Quantity"},"is_in_stock":{"type":"boolean","title":"Is In Stock"},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"},"weight_g":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight G"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"fulfillment_type":{"$ref":"#/components/schemas/FulfillmentType"},"requires_shipping":{"type":"boolean","title":"Requires Shipping"},"track_inventory":{"type":"boolean","title":"Track Inventory"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["id","product_id","position","option_values","price","price_currency","compare_at_price","cost_price","sku","barcode","inventory_quantity","is_in_stock","image_url","weight_g","metadata","fulfillment_type","requires_shipping","track_inventory","created_at","updated_at"],"title":"VariantResponse","description":"Single-variant response. Field names + types intentionally\nmirror the frontend's `Variant` interface so no client-side\ntransformation is needed."},"VerifyConnectionResponse":{"properties":{"verified":{"type":"boolean","title":"Verified"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"platform":{"type":"string","enum":["meta","tiktok"],"title":"Platform"}},"type":"object","required":["verified","platform"],"title":"VerifyConnectionResponse","description":"Result of asking the provider whether a pixel is real and reachable.\n\nThis is the answer a regex can never give. Our validation rules only catch\npaste errors; whether ``1712515290084839`` is a dataset that exists, is\nactive, and that this token may write to is a question only Meta / TikTok\ncan answer. A typo'd-but-well-formed ID used to validate fine and then\nsilently never deliver — that entire failure class disappears once the\nmerchant can press a button and see the dataset's real name.\n\n``verified=False`` with ``error`` set means the provider answered and said\nno; ``verified=False`` with ``error`` describing a missing prerequisite\nmeans we could not ask. The two are deliberately not conflated: \"Meta says\nthis pixel doesn't exist\" and \"add a token so we can check\" need different\nactions from the merchant."},"VersionListItem":{"properties":{"id":{"type":"string","title":"Id"},"theme_id":{"type":"string","title":"Theme Id"},"change_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Summary"},"is_published":{"type":"boolean","title":"Is Published"},"is_autosave":{"type":"boolean","title":"Is Autosave"},"version_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Label"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"}},"type":"object","required":["id","theme_id","is_published","is_autosave"],"title":"VersionListItem"},"VersionListResponse":{"properties":{"versions":{"items":{"$ref":"#/components/schemas/VersionListItem"},"type":"array","title":"Versions"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"}},"type":"object","required":["versions","page","per_page"],"title":"VersionListResponse"},"VersionPayloadResponse":{"properties":{"payload":{"additionalProperties":true,"type":"object","title":"Payload"}},"type":"object","required":["payload"],"title":"VersionPayloadResponse","description":"A single version's full settings blob — read-only, for the pre-publish /\nversion diff views. The editor's PrePublishDiffDialog fetches the newest\npublished version's payload to diff against the current draft; without this\nendpoint that fetch 404s and the dialog can't compute a diff (which used to\nblock Publish)."},"VodafoneCashCredentialsResponse":{"properties":{"is_configured":{"type":"boolean","title":"Is Configured"},"enabled":{"type":"boolean","title":"Enabled","default":false},"wallet_number_masked":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wallet Number Masked"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"fallback_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fallback Phone"},"auto_approve_enabled":{"type":"boolean","title":"Auto Approve Enabled","default":false},"auto_approve_threshold_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Approve Threshold Cents"},"auto_approve_daily_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Approve Daily Cap Cents"},"auto_approve_daily_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Approve Daily Count"},"last_configured":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Configured"},"ocr_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ocr Provider"},"require_ocr_amount_match":{"type":"boolean","title":"Require Ocr Amount Match","default":false},"require_ocr_ipa_match":{"type":"boolean","title":"Require Ocr Ipa Match","default":false},"ocr_amount_tolerance_bps":{"type":"integer","title":"Ocr Amount Tolerance Bps","default":300},"require_note_contains_reference":{"type":"boolean","title":"Require Note Contains Reference","default":false},"require_transaction_ref_match":{"type":"boolean","title":"Require Transaction Ref Match","default":false},"require_recipient_name_match":{"type":"boolean","title":"Require Recipient Name Match","default":false},"recipient_name_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recipient Name Token"}},"type":"object","required":["is_configured"],"title":"VodafoneCashCredentialsResponse","description":"Masked Vodafone Cash config (the wallet number is the only secret)."},"VoidPaymentRequest":{"properties":{"reason":{"type":"string","maxLength":500,"minLength":3,"title":"Reason"}},"type":"object","required":["reason"],"title":"VoidPaymentRequest"},"VoidRequest":{"properties":{"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note"}},"type":"object","title":"VoidRequest"},"WaybillRequest":{"properties":{"shipment_ids":{"items":{"type":"string","format":"uuid"},"type":"array","minItems":1,"title":"Shipment Ids"},"format":{"type":"string","title":"Format","default":"roll"}},"type":"object","required":["shipment_ids"],"title":"WaybillRequest"},"WeightBand":{"properties":{"max_weight_g":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Max Weight G"},"amount_cents":{"type":"integer","minimum":0.0,"title":"Amount Cents"},"per_extra_kg_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Per Extra Kg Cents"}},"additionalProperties":false,"type":"object","required":["amount_cents"],"title":"WeightBand","description":"One band of a weight-band table.\n\n`max_weight_g = None` represents the final open-ended band.\nWithin an open-ended band, `per_extra_kg_cents` adds the given\namount for every started kilogram above the previous band's max."},"WhatsAppAccessRequestBody":{"properties":{"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note","description":"Merchant's use-case / why they want WhatsApp."},"contact_phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Contact Phone"},"expected_volume":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Expected Volume","description":"Free-text expected monthly message volume (e.g. '1-500')."}},"type":"object","title":"WhatsAppAccessRequestBody","description":"Body for POST /whatsapp/access/request (merchant submits the form)."},"WhatsAppAccessState":{"properties":{"status":{"type":"string","enum":["none","pending","awaiting_payment","approved","rejected","disabled","expired"],"title":"Status","default":"none"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"expected_volume":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Volume"},"requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Requested At"},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At"},"review_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Reason","description":"Admin's reason on reject/disable; safe to show the merchant."},"amount_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Cents","description":"What this store pays per period, in piasters."},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"billing_cycle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Cycle"},"active_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Until","description":"Access runs until this instant. None = no expiry."},"message_allowance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Message Allowance","description":"Template messages included per period. None = uncapped."},"messages_used":{"type":"integer","title":"Messages Used","description":"Template messages sent in the current period.","default":0},"payment_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Status","description":"Open bill: awaiting_proof, or under_review once a receipt is in."},"payment_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Payment Expires At"},"payment_reference":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Reference","description":"Put this in the transfer note so OCR can match it."},"payment_destination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Destination","description":"InstaPay address the merchant sends to."},"payment_intent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Intent Id"},"can_send":{"type":"boolean","title":"Can Send","description":"Whether WhatsApp will actually send for this store right now.","default":false},"blocked_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Blocked Reason","description":"Why sending is off: awaiting_payment, expired, allowance_exhausted…"},"can_request":{"type":"boolean","title":"Can Request","description":"True when the merchant may (re)submit a request — i.e. there is no row yet, or the previous request was rejected.","default":true}},"type":"object","title":"WhatsAppAccessState","description":"Current WhatsApp access-gate state for a store (GET /whatsapp/access)."},"WhatsAppAnalytics":{"properties":{"period":{"type":"string","title":"Period"},"total_sent":{"type":"integer","title":"Total Sent","default":0},"total_delivered":{"type":"integer","title":"Total Delivered","default":0},"total_read":{"type":"integer","title":"Total Read","default":0},"total_failed":{"type":"integer","title":"Total Failed","default":0},"delivery_rate":{"type":"number","title":"Delivery Rate","default":0.0},"read_rate":{"type":"number","title":"Read Rate","default":0.0},"active_conversations":{"type":"integer","title":"Active Conversations","default":0},"avg_response_time_minutes":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Response Time Minutes"},"daily_stats":{"items":{"$ref":"#/components/schemas/WhatsAppDayStat"},"type":"array","title":"Daily Stats","default":[]},"by_template":{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object","title":"By Template","default":{}}},"type":"object","required":["period"],"title":"WhatsAppAnalytics","description":"Aggregated WhatsApp analytics."},"WhatsAppConnectionStatus":{"properties":{"connected":{"type":"boolean","title":"Connected","default":false},"connection_type":{"$ref":"#/components/schemas/ConnectionType","default":"shared"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"phone_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Display Name"},"waba_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waba Id"},"quality_rating":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quality Rating"},"messaging_limit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Messaging Limit"},"connected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected At"}},"type":"object","title":"WhatsAppConnectionStatus","description":"WhatsApp connection status for the store."},"WhatsAppDayStat":{"properties":{"date":{"type":"string","title":"Date"},"sent":{"type":"integer","title":"Sent","default":0},"delivered":{"type":"integer","title":"Delivered","default":0},"read":{"type":"integer","title":"Read","default":0},"failed":{"type":"integer","title":"Failed","default":0}},"type":"object","required":["date"],"title":"WhatsAppDayStat","description":"Stats for a single day."},"WhatsAppMessageLogItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"phone":{"type":"string","title":"Phone"},"direction":{"type":"string","title":"Direction"},"template_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","phone","direction","status","created_at"],"title":"WhatsAppMessageLogItem","description":"A single sent/received WhatsApp message for the activity feed.\n\nSourced from ``message_logs`` — unlike conversations, this includes\nevery automated order-lifecycle notification (order confirmation,\npayment, shipping, delivery) even when the customer never replied, so\nthe merchant sees the full record of what actually went out."},"WhatsAppMessageLogList":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/WhatsAppMessageLogItem"},"type":"array","title":"Messages","default":[]},"total":{"type":"integer","title":"Total","default":0}},"type":"object","title":"WhatsAppMessageLogList","description":"Paginated message-log feed for a store."},"WhatsAppMode":{"type":"string","enum":["platform_managed","byo"],"title":"WhatsAppMode","description":"Per-store WhatsApp operating mode (FR-019)."},"WhatsAppNotifications":{"properties":{"order_confirmation":{"$ref":"#/components/schemas/NotificationTemplate"},"order_shipped":{"$ref":"#/components/schemas/NotificationTemplate"},"order_delivered":{"$ref":"#/components/schemas/NotificationTemplate"},"abandoned_cart":{"$ref":"#/components/schemas/NotificationTemplate"},"low_stock":{"$ref":"#/components/schemas/NotificationTemplate"}},"type":"object","required":["order_confirmation","order_shipped","order_delivered","abandoned_cart","low_stock"],"title":"WhatsAppNotifications","description":"WhatsApp notification templates."},"WhatsAppSettingsResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"is_configured":{"type":"boolean","title":"Is Configured","default":false},"last_configured":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Configured"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"notifications":{"$ref":"#/components/schemas/WhatsAppNotifications"},"messages_today":{"type":"integer","title":"Messages Today","default":0},"delivery_rate":{"type":"number","title":"Delivery Rate","default":0},"api_quota":{"type":"integer","title":"Api Quota","default":1000}},"type":"object","required":["notifications"],"title":"WhatsAppSettingsResponse","description":"WhatsApp settings response."},"WhatsAppSettingsUpdate":{"properties":{"message_language":{"anyOf":[{"type":"string","enum":["auto","ar","en"]},{"type":"null"}],"title":"Message Language"},"confirm_order_delay_minutes":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Confirm Order Delay Minutes"}},"type":"object","title":"WhatsAppSettingsUpdate","description":"Body for PATCH /whatsapp/settings — partial update of store-level\nWhatsApp preferences that are not per-message toggles."},"WhatsAppStatus":{"properties":{"mode":{"$ref":"#/components/schemas/WhatsAppMode"},"connected":{"type":"boolean","title":"Connected"},"phone_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Display Name"},"display_phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Phone Number"},"quality_rating":{"anyOf":[{"type":"string","enum":["GREEN","YELLOW","RED","UNKNOWN"]},{"type":"null"}],"title":"Quality Rating"},"waba_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Waba Id","description":"Exposed only for BYO mode; null for platform_managed."},"last_validated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Validated At"},"credential_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credential Error","description":"Set when last send failed with a credential-class Meta error; cleared on next successful validation."},"message_language":{"type":"string","enum":["auto","ar","en"],"title":"Message Language","description":"Language for automated order notifications. 'auto' follows the store default language; 'ar'/'en' force that language.","default":"auto"},"confirm_order_delay_minutes":{"type":"integer","minimum":0.0,"title":"Confirm Order Delay Minutes","description":"Delay before the COD confirm-order request is sent. 0 = send immediately on order creation; >0 schedules it that many minutes later via the WhatsApp scheduled-send queue.","default":0},"notifications":{"$ref":"#/components/schemas/src__api__v1__schemas__stores__whatsapp_connection__NotificationSettings"}},"type":"object","required":["mode","connected","notifications"],"title":"WhatsAppStatus","description":"Per-store WhatsApp connection status (GET /whatsapp/status)."},"WizardConfigRequest":{"properties":{"business_type":{"type":"string","title":"Business Type","description":"fashion, electronics, beauty, home, food, accessories, other"},"country":{"type":"string","maxLength":2,"title":"Country","default":"EG"},"shipping_preference":{"type":"string","title":"Shipping Preference","description":"bosta, manual, both"},"payment_methods":{"items":{"type":"string"},"type":"array","title":"Payment Methods","description":"e.g. ['cod', 'paymob_card']"},"store_language":{"type":"string","title":"Store Language","description":"ar or en","default":"ar"},"sells_where_today":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Sells Where Today","description":"instagram, shopify, zid, salla, own_site, offline, nowhere, other"},"monthly_orders_band":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Monthly Orders Band","description":"0, 1-50, 51-200, 201-1000, 1000+"},"city":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"City"}},"type":"object","required":["business_type","shipping_preference","payment_methods"],"title":"WizardConfigRequest","description":"Smart onboarding wizard configuration."},"WizardConfigResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"settings_applied":{"items":{"type":"string"},"type":"array","title":"Settings Applied"}},"type":"object","required":["configured","settings_applied"],"title":"WizardConfigResponse","description":"Result of auto-configuration."},"WriteThemeFileRequest":{"properties":{"content":{"type":"string","title":"Content","description":"Full file content"}},"type":"object","required":["content"],"title":"WriteThemeFileRequest","description":"Create or overwrite one file."},"ZoneResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"store_id":{"type":"string","format":"uuid","title":"Store Id"},"name":{"type":"string","title":"Name"},"name_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name Ar"},"governorate_codes":{"items":{"type":"string"},"type":"array","title":"Governorate Codes"},"estimated_days_min":{"type":"integer","title":"Estimated Days Min"},"estimated_days_max":{"type":"integer","title":"Estimated Days Max"},"cod_enabled":{"type":"boolean","title":"Cod Enabled"},"cod_fee_cents":{"type":"integer","title":"Cod Fee Cents"},"is_active":{"type":"boolean","title":"Is Active"},"sort_order":{"type":"integer","title":"Sort Order"},"rates":{"items":{"$ref":"#/components/schemas/RateResponse"},"type":"array","title":"Rates"}},"type":"object","required":["id","store_id","name","name_ar","governorate_codes","estimated_days_min","estimated_days_max","cod_enabled","cod_fee_cents","is_active","sort_order"],"title":"ZoneResponse"},"src__api__responses__base__SuccessResponse_CampaignListResponse___2":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/src__api__v1__schemas__stores__whatsapp__CampaignListResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CampaignListResponse]"},"src__api__responses__base__SuccessResponse_CampaignResponse___2":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/src__api__v1__schemas__stores__whatsapp__CampaignResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[CampaignResponse]"},"src__api__responses__base__SuccessResponse_DashboardStatsResponse___2":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/src__api__v1__routes__stores__dashboard__DashboardStatsResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[DashboardStatsResponse]"},"src__api__responses__base__SuccessResponse_PreviewTokenResponse___1":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/src__api__v1__routes__stores__promotions__PreviewTokenResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[PreviewTokenResponse]"},"src__api__responses__base__SuccessResponse_TokenResponse___2":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"$ref":"#/components/schemas/src__api__v1__routes__app_oauth__TokenResponse"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[TokenResponse]"},"src__api__responses__base__SuccessResponse_list_InvoiceResponse____1":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"items":{"$ref":"#/components/schemas/src__api__v1__routes__stores__payments__InvoiceResponse"},"type":"array","title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["data"],"title":"SuccessResponse[list[InvoiceResponse]]"},"src__api__v1__routes__app_oauth__TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"store_id":{"type":"string","format":"uuid","title":"Store Id"}},"type":"object","required":["access_token","scopes","store_id"],"title":"TokenResponse"},"src__api__v1__routes__stores__analytics__CampaignItem":{"properties":{"campaign":{"type":"string","title":"Campaign"},"visits":{"type":"integer","title":"Visits"},"orders":{"type":"integer","title":"Orders"},"revenue":{"type":"integer","title":"Revenue"}},"type":"object","required":["campaign","visits","orders","revenue"],"title":"CampaignItem"},"src__api__v1__routes__stores__analytics__FunnelResponse":{"properties":{"steps":{"items":{"$ref":"#/components/schemas/FunnelStepResponse"},"type":"array","title":"Steps"},"overall_conversion_pct":{"type":"number","title":"Overall Conversion Pct"},"trend":{"items":{"$ref":"#/components/schemas/FunnelTrendPoint"},"type":"array","title":"Trend"},"step_timings":{"items":{"$ref":"#/components/schemas/StepTimingResponse"},"type":"array","title":"Step Timings"},"cart_abandonment":{"$ref":"#/components/schemas/CartAbandonmentResponse"}},"type":"object","required":["steps","overall_conversion_pct","trend","step_timings","cart_abandonment"],"title":"FunnelResponse"},"src__api__v1__routes__stores__apps__UpdateSettingsRequest":{"properties":{"settings":{"additionalProperties":true,"type":"object","title":"Settings"},"replace":{"type":"boolean","title":"Replace","default":false}},"type":"object","required":["settings"],"title":"UpdateSettingsRequest"},"src__api__v1__routes__stores__dashboard__DashboardStatsResponse":{"properties":{"total_revenue":{"type":"integer","title":"Total Revenue"},"revenue_change_percent":{"type":"number","title":"Revenue Change Percent"},"avg_order_value":{"type":"integer","title":"Avg Order Value"},"currency":{"type":"string","title":"Currency"},"total_orders":{"type":"integer","title":"Total Orders"},"pending_orders":{"type":"integer","title":"Pending Orders"},"confirmed_orders":{"type":"integer","title":"Confirmed Orders"},"processing_orders":{"type":"integer","title":"Processing Orders"},"shipped_orders":{"type":"integer","title":"Shipped Orders"},"completed_orders":{"type":"integer","title":"Completed Orders"},"cancelled_orders":{"type":"integer","title":"Cancelled Orders"},"total_customers":{"type":"integer","title":"Total Customers"},"new_customers":{"type":"integer","title":"New Customers"},"total_products":{"type":"integer","title":"Total Products"},"low_stock_count":{"type":"integer","title":"Low Stock Count"},"total_profit":{"type":"integer","title":"Total Profit"},"total_cogs":{"type":"integer","title":"Total Cogs"},"products_with_cost":{"type":"integer","title":"Products With Cost"},"period_start":{"type":"string","title":"Period Start"},"period_end":{"type":"string","title":"Period End"}},"type":"object","required":["total_revenue","revenue_change_percent","avg_order_value","currency","total_orders","pending_orders","confirmed_orders","processing_orders","shipped_orders","completed_orders","cancelled_orders","total_customers","new_customers","total_products","low_stock_count","total_profit","total_cogs","products_with_cost","period_start","period_end"],"title":"DashboardStatsResponse","description":"Dashboard statistics response."},"src__api__v1__routes__stores__payments__InvoiceResponse":{"properties":{"id":{"type":"string","title":"Id"},"service":{"type":"string","title":"Service"},"amount_cents":{"type":"integer","title":"Amount Cents"},"currency":{"type":"string","title":"Currency"},"payment_status":{"type":"string","title":"Payment Status"},"approved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved At"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","service","amount_cents","currency","payment_status","approved_at","created_at"],"title":"InvoiceResponse"},"src__api__v1__routes__stores__promotions__PreviewTokenResponse":{"properties":{"token":{"type":"string","title":"Token","description":"Signed preview JWT (5-minute TTL)."},"expires_at":{"type":"string","title":"Expires At","description":"ISO-8601 expiry of the token."},"ttl_seconds":{"type":"integer","title":"Ttl Seconds","description":"Lifetime of the token in seconds — handy for the merchant hub to schedule a silent refresh before expiry."}},"type":"object","required":["token","expires_at","ttl_seconds"],"title":"PreviewTokenResponse","description":"Short-lived JWT that unlocks draft-state preview on the storefront.\n\nThe merchant hub appends `?_npt=<token>` to the storefront URL when\nopening the builder iframe; the storefront forwards the token as\n`X-Preview-Token` on its server-side promotions fetch."},"src__api__v1__routes__stores__reconciliation__TriggerReconciliationRequest":{"properties":{"target_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Target Date"}},"type":"object","title":"TriggerReconciliationRequest"},"src__api__v1__schemas__stores__whatsapp__CampaignListResponse":{"properties":{"campaigns":{"items":{"$ref":"#/components/schemas/src__api__v1__schemas__stores__whatsapp__CampaignResponse"},"type":"array","title":"Campaigns"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["campaigns","total"],"title":"CampaignListResponse","description":"List of campaigns."},"src__api__v1__schemas__stores__whatsapp__CampaignResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"store_id":{"type":"string","format":"uuid","title":"Store Id"},"name":{"type":"string","title":"Name"},"template_id":{"type":"string","format":"uuid","title":"Template Id"},"template_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Name"},"audience_filter":{"$ref":"#/components/schemas/AudienceFilter"},"status":{"$ref":"#/components/schemas/CampaignStatus-Output"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"total_recipients":{"type":"integer","title":"Total Recipients","default":0},"sent_count":{"type":"integer","title":"Sent Count","default":0},"delivered_count":{"type":"integer","title":"Delivered Count","default":0},"read_count":{"type":"integer","title":"Read Count","default":0},"failed_count":{"type":"integer","title":"Failed Count","default":0},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","store_id","name","template_id","audience_filter","status","created_at","updated_at"],"title":"CampaignResponse","description":"Campaign details."},"src__api__v1__schemas__stores__whatsapp__NotificationSettings":{"properties":{"order_confirmation":{"$ref":"#/components/schemas/NotificationToggle"},"payment_received":{"$ref":"#/components/schemas/NotificationToggle"},"shipping_update":{"$ref":"#/components/schemas/NotificationToggle"},"delivery_confirmation":{"$ref":"#/components/schemas/NotificationToggle"},"abandoned_cart":{"$ref":"#/components/schemas/NotificationToggle"}},"type":"object","title":"NotificationSettings","description":"All notification toggles.\n\nField names MUST match the canonical keys under\n``store.settings.whatsapp_notifications`` (the same keys the backend\nhandlers read via ``_resolve_send_context.notification_pref_key``).\nThe merchant-hub TS interface uses these field names verbatim.\n\n``abandoned_cart`` is exposed but the v1 merchant-hub doesn't render\nit (US3 hasn't shipped the scheduled-send dispatcher). The field\nlives here so US3 can light up the UI without an API contract bump."},"src__api__v1__schemas__stores__whatsapp_connection__NotificationSettings":{"properties":{"order_confirmation":{"type":"boolean","title":"Order Confirmation","default":true},"payment_received":{"type":"boolean","title":"Payment Received","default":true},"shipping_update":{"type":"boolean","title":"Shipping Update","default":true},"delivery_confirmation":{"type":"boolean","title":"Delivery Confirmation","default":true},"abandoned_cart":{"type":"boolean","title":"Abandoned Cart","default":true},"marketing":{"type":"boolean","title":"Marketing","default":false},"require_order_confirmation":{"type":"boolean","title":"Require Order Confirmation","default":false}},"additionalProperties":true,"type":"object","title":"NotificationSettings","description":"Per-message-type WhatsApp notification toggles (FR-019a)."},"src__api__v1__schemas__tenant__invoice__InvoiceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Invoice UUID"},"store_id":{"type":"string","format":"uuid","title":"Store Id","description":"Store UUID"},"order_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Order Id","description":"Associated order UUID"},"customer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Customer Id","description":"Customer UUID"},"invoice_number":{"type":"string","title":"Invoice Number","description":"Human-readable invoice number"},"internal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Internal Id","description":"Internal reference ID"},"invoice_type":{"$ref":"#/components/schemas/InvoiceType","description":"I=Invoice, C=Credit, D=Debit"},"status":{"$ref":"#/components/schemas/InvoiceStatus","description":"Invoice status"},"date_issued":{"type":"string","format":"date-time","title":"Date Issued","description":"Invoice issue date"},"seller":{"$ref":"#/components/schemas/SellerInfoResponse","description":"Seller information"},"buyer":{"$ref":"#/components/schemas/BuyerInfoResponse","description":"Buyer information"},"currency":{"type":"string","title":"Currency","description":"ISO 4217 currency code"},"line_items":{"items":{"$ref":"#/components/schemas/InvoiceLineItemResponse"},"type":"array","title":"Line Items","description":"Line items"},"prices_include_vat":{"type":"boolean","title":"Prices Include Vat","description":"True when product prices already include VAT","default":true},"vat_rate":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Vat Rate","description":"VAT rate percentage","default":"14.00"},"subtotal":{"type":"integer","title":"Subtotal","description":"VAT-inclusive subtotal in cents"},"vat_amount":{"type":"integer","title":"Vat Amount","description":"VAT extracted from subtotal in cents (already included)","default":0},"net_amount_before_vat":{"type":"integer","title":"Net Amount Before Vat","description":"Subtotal minus VAT in cents","default":0},"total_discount":{"type":"integer","title":"Total Discount","description":"Line-level discount in cents"},"total_taxes":{"type":"integer","title":"Total Taxes","description":"Total VAT in cents (== vat_amount)"},"extra_discount":{"type":"integer","title":"Extra Discount","description":"Invoice-level discount in cents"},"shipping_fee":{"type":"integer","title":"Shipping Fee","description":"Shipping fee in cents","default":0},"grand_total":{"type":"integer","title":"Grand Total","description":"Customer-facing grand total in cents","default":0},"total":{"type":"integer","title":"Total","description":"Grand total in cents (alias of grand_total)"},"subtotal_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtotal Formatted","description":"Formatted subtotal"},"vat_amount_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vat Amount Formatted","description":"Formatted VAT amount (already included)"},"shipping_fee_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shipping Fee Formatted","description":"Formatted shipping fee"},"grand_total_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Grand Total Formatted","description":"Formatted grand total"},"total_formatted":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Total Formatted","description":"Formatted total"},"eta_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Uuid","description":"ETA submission UUID"},"eta_long_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Long Id","description":"ETA long ID"},"eta_status_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Status Code","description":"ETA status code"},"eta_status_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Status Message","description":"ETA status message"},"eta_portal_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eta Portal Url","description":"Link to ETA portal"},"qr_code_data":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qr Code Data","description":"QR code raw data"},"qr_code_image":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qr Code Image","description":"QR code base64 image"},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Url","description":"PDF download URL"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes","description":"Notes in English"},"notes_ar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes Ar","description":"Notes in Arabic"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","store_id","order_id","customer_id","invoice_number","internal_id","invoice_type","status","date_issued","seller","buyer","currency","line_items","subtotal","total_discount","total_taxes","extra_discount","total","eta_uuid","eta_long_id","eta_status_code","eta_status_message","qr_code_data","qr_code_image","notes","notes_ar","created_at","updated_at"],"title":"InvoiceResponse","description":"Invoice response (VAT-inclusive pricing).","example":{"created_at":"2025-01-20T09:00:00Z","currency":"EGP","extra_discount":0,"grand_total":15000,"id":"bb0e8400-e29b-41d4-a716-446655440000","invoice_number":"INV-2025-0001","invoice_type":"I","net_amount_before_vat":8772,"prices_include_vat":true,"shipping_fee":5000,"status":"submitted","store_id":"660e8400-e29b-41d4-a716-446655440000","subtotal":10000,"total":15000,"total_discount":0,"total_formatted":"150.00 EGP","updated_at":"2025-01-20T09:00:00Z","vat_amount":1228,"vat_rate":"14.00"}},"src__api__v1__schemas__tenant__order__UpdateOrderStatusRequest":{"properties":{"status":{"type":"string","title":"Status","description":"New order status"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason for status change"}},"type":"object","required":["status"],"title":"UpdateOrderStatusRequest","description":"Update order status request schema.","example":{"reason":"Items picked and handed to Bosta courier","status":"shipped"}},"src__api__v1__schemas__tenant__product__UpdateProductRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name","description":"Product display name"},"slug":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Slug","description":"URL-friendly slug"},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Sku","description":"Stock Keeping Unit identifier"},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Description","description":"Full product description"},"short_description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Short Description","description":"Brief description for listings"},"price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Price","description":"Product price in the store currency"},"compare_at_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Compare At Price","description":"Original price before discount"},"cost_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Cost Price","description":"Cost of goods for profit calculation"},"quantity":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Quantity","description":"Available stock quantity"},"low_stock_threshold":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Low Stock Threshold","description":"Threshold to trigger low-stock alerts"},"images":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Images","description":"Product image URLs"},"category_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Category Id","description":"Category UUID"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Tags","description":"Searchable tags"},"attributes":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Attributes","description":"Arbitrary key-value attributes"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Product status: active, draft, or archived"},"brand":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Brand","description":"Manufacturer/brand name"},"robots_noindex":{"type":"boolean","title":"Robots Noindex","description":"Keep this page out of search results.","default":false},"canonical_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Canonical Url","description":"Absolute URL this page should credit as the original."},"sitemap_exclude":{"type":"boolean","title":"Sitemap Exclude","description":"Leave this page out of sitemap.xml.","default":false},"seo_title":{"anyOf":[{"type":"string","maxLength":70},{"type":"null"}],"title":"Seo Title","description":"SEO page title"},"seo_description":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}],"title":"Seo Description","description":"SEO meta description"},"template_suffix":{"anyOf":[{"type":"string","maxLength":32,"pattern":"^[a-z0-9][a-z0-9-]{0,31}$"},{"type":"null"}],"title":"Template Suffix","description":"Alternate template variant suffix (Shopify-style); null = base template."},"meta_catalog_id":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Meta Catalog Id","description":"Meta Commerce Catalog product ID. When set, the storefront uses this as `content_ids` on Pixel/CAPI events so Meta dynamic ads match conversions back to a catalog row."},"options":{"anyOf":[{"items":{"$ref":"#/components/schemas/ProductOptionInput"},"type":"array","maxItems":3},{"type":"null"}],"title":"Options","description":"Replace option axes (None = no change)"},"variants":{"anyOf":[{"items":{"$ref":"#/components/schemas/VariantInput"},"type":"array"},{"type":"null"}],"title":"Variants","description":"Replace variant matrix (None = no change)"},"weight":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Weight","description":"Shipping weight in kg"},"requires_shipping":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Requires Shipping","description":"False for digital goods — checkout then collects no address and charges no shipping. Omit to leave unchanged."},"tax_exempt":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tax Exempt","description":"True for zero-rated goods — the line is excluded from the taxable base. Omit to leave unchanged."},"sale_price":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Sale Price","description":"Scheduled sale price. Send the sale fields together: with a price to start or change a sale, without one to end it."},"sale_starts_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sale Starts At","description":"Sale window opens. Null = already open."},"sale_ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sale Ends At","description":"Sale window closes. Null = runs until removed."},"related_product_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":24},{"type":"null"}],"title":"Related Product Ids","description":"Curated similar products, replacing the automatic list. Send [] to fall back to automatic; omit to leave unchanged."}},"type":"object","title":"UpdateProductRequest","description":"Update product request schema — all fields optional (partial update).","example":{"price":"275.00","quantity":80,"status":"active"}},"src__api__v1__schemas__tenant__theme_v2__InstallThemeRequest":{"properties":{"theme_id":{"type":"string","title":"Theme Id","description":"UUID of the theme to install"},"version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version Id","description":"Specific version UUID. Defaults to the latest version."}},"type":"object","required":["theme_id"],"title":"InstallThemeRequest","description":"Request to install a theme on a store.","example":{"theme_id":"uuid"}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A personal access token (`numu_pat_...`)."}}}}