{"openapi":"3.1.0","info":{"title":"Cypher Store Reseller API","version":"1.0","description":"Shared-wallet automatic product delivery. Always retain external_order_id for paid request retries."},"servers":[{"url":"https://cypherstorebot.com"}],"security":[{"resellerKey":[]}],"components":{"securitySchemes":{"resellerKey":{"type":"http","scheme":"bearer","description":"Private reseller API key generated in account settings."}},"schemas":{"Error":{"type":"object","required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"string"},"message":{"type":"string"}}},"Product":{"type":"object","required":["product_id","title","price","base_price","flash","bulk_tiers","stock"],"properties":{"product_id":{"type":"string","format":"uuid"},"title":{"type":"string"},"price":{"type":"number","minimum":0,"description":"Current one-item price in USDT."},"base_price":{"type":"number","minimum":0},"flash":{"type":"boolean"},"bulk_tiers":{"type":"array","items":{"type":"object","properties":{"min":{"type":"integer","minimum":1},"price":{"type":"number","minimum":0}}}},"stock":{"type":"integer","minimum":0}}},"Catalog":{"type":"object","required":["ok","products"],"properties":{"ok":{"const":true},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}},"Balance":{"type":"object","required":["ok","balance","currency"],"properties":{"ok":{"const":true},"balance":{"type":"number"},"currency":{"const":"USDT"}}},"OrderRequest":{"type":"object","required":["product_id","quantity"],"properties":{"product_id":{"type":"string","format":"uuid"},"quantity":{"type":"integer","minimum":1,"maximum":1000},"external_order_id":{"type":"string","maxLength":200,"description":"Recommended for safe retries; unique per account/logical purchase. Keep product and quantity identical on retry."}}},"OrderReceipt":{"type":"object","required":["ok","order_id","status","cost","delivery"],"properties":{"ok":{"const":true},"order_id":{"type":"string","format":"uuid","description":"API order UUID; distinct from CY- website references."},"status":{"const":"delivered"},"cost":{"type":"number","minimum":0,"description":"Total USDT charged."},"delivery":{"type":"array","items":{"type":"string"},"description":"Private delivery content. Store securely."},"duplicate":{"type":"boolean","description":"True on saved-receipt replay."},"balance":{"type":["number","null"],"description":"Included on initial success; omitted on replay."}}}}},"paths":{"/api/reseller":{"get":{"summary":"Read product catalog or wallet balance","parameters":[{"in":"query","name":"action","required":true,"schema":{"type":"string","enum":["products","balance"]}}],"responses":{"200":{"description":"Catalog or wallet balance selected by action.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Catalog"},{"$ref":"#/components/schemas/Balance"}]}}}},"400":{"description":"Invalid action/request or purchase rejected; inspect error/message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, revoked or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Reference conflict or processing; retain the same request reference.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds to wait."}}},"500":{"description":"Server error; preserve the reference.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable; preserve the reference.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Place an automatic-delivery order","description":"Spends real wallet funds. Reuse the same external_order_id/product_id/quantity after interruptions. Telegram wallet approval cannot be bypassed.","parameters":[{"in":"query","name":"action","required":true,"schema":{"type":"string","const":"order"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}}},"responses":{"200":{"description":"Saved receipt; replay includes duplicate=true and omits a new balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderReceipt"}}}},"400":{"description":"Invalid action/request or purchase rejected; inspect error/message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing, revoked or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Account unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Reference conflict or processing; retain the same request reference.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request limit reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"integer","minimum":1},"description":"Seconds to wait."}}},"500":{"description":"Server error; preserve the reference.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable; preserve the reference.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}