{"openapi":"3.1.0","info":{"title":"QR Integration API","description":"Asynchronous QR orders and payment status for a single authenticated partner.","version":"1.0.0"},"paths":{"/orders":{"post":{"tags":["Orders"],"summary":"Create or recover an idempotent asynchronous order","operationId":"create_order_orders_post","security":[{"PartnerAPIKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderBody"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicOrder"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Not Found"},"408":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Request Timeout"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Service Unavailable"}}},"get":{"tags":["Orders"],"summary":"List this partner’s orders","operationId":"list_orders_orders_get","security":[{"PartnerAPIKey":[]}],"parameters":[{"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/PublicOrders"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Not Found"},"408":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Request Timeout"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Service Unavailable"}}}},"/orders/{order_id}":{"get":{"tags":["Orders"],"summary":"Read the canonical order and payment status","operationId":"get_order_orders__order_id__get","security":[{"PartnerAPIKey":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicOrder"}}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Not Found"},"408":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Request Timeout"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Service Unavailable"}}}},"/orders/{order_id}/qr":{"get":{"tags":["Orders"],"summary":"Download the current order QR as PNG","operationId":"get_qr_orders__order_id__qr_get","security":[{"PartnerAPIKey":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Authenticated QR image","content":{"application/json":{"schema":{}},"image/png":{}}},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Not Found"},"408":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Request Timeout"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Conflict"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Request Entity Too Large"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Unprocessable Entity"},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Too Many Requests"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}},"description":"Service Unavailable"}}}},"/rate":{"get":{"tags":["Reference"],"summary":"Read the current trader rate","operationId":"rate_rate_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRate"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"408":{"description":"Request Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}}},"security":[{"PartnerAPIKey":[]}]}},"/balance":{"get":{"tags":["Reference"],"summary":"Read this partner’s USDT settlement totals","operationId":"balance_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicBalance"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"408":{"description":"Request Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"413":{"description":"Request Entity Too Large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIErrorResponse"}}}}},"security":[{"PartnerAPIKey":[]}]}}},"components":{"schemas":{"APIErrorBody":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"}},"type":"object","required":["code","message"],"title":"APIErrorBody"},"APIErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/APIErrorBody"}},"type":"object","required":["error"],"title":"APIErrorResponse"},"CreateOrderBody":{"properties":{"external_id":{"type":"string","maxLength":128,"minLength":1,"title":"External Id","description":"Your stable order identifier, unique within this partner."},"full_name":{"type":"string","maxLength":200,"minLength":1,"title":"Full Name","description":"Actual payer full name: surname, given name, patronymic."},"bank":{"type":"string","maxLength":100,"minLength":2,"title":"Bank"},"amount_rub":{"type":"string","pattern":"^[0-9]{1,5}(?:\\.[0-9]{1,2})?$","title":"Amount Rub","description":"Decimal RUB string from 50 to 35000, for example 1000.50."}},"additionalProperties":false,"type":"object","required":["external_id","full_name","bank","amount_rub"],"title":"CreateOrderBody"},"PublicBalance":{"properties":{"expected_usdt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Usdt"},"expected_usdt_known_amount":{"type":"string","title":"Expected Usdt Known Amount"},"expected_usdt_missing_orders":{"type":"integer","title":"Expected Usdt Missing Orders"},"paid_usdt":{"type":"string","title":"Paid Usdt"},"payable_usdt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payable Usdt"},"payable_usdt_known_amount":{"type":"string","title":"Payable Usdt Known Amount"},"balance_usdt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Balance Usdt"},"overpaid_usdt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Overpaid Usdt"},"total_orders":{"type":"integer","title":"Total Orders"},"successful_orders":{"type":"integer","title":"Successful Orders"},"successful_amount_kopeks":{"type":"integer","title":"Successful Amount Kopeks"},"conflict_orders":{"type":"integer","title":"Conflict Orders"},"complete":{"type":"boolean","title":"Complete"}},"type":"object","required":["expected_usdt","expected_usdt_known_amount","expected_usdt_missing_orders","paid_usdt","payable_usdt","payable_usdt_known_amount","balance_usdt","overpaid_usdt","total_orders","successful_orders","successful_amount_kopeks","conflict_orders","complete"],"title":"PublicBalance"},"PublicOrder":{"properties":{"id":{"type":"string","pattern":"^[a-f0-9]{20}$","title":"Id"},"external_id":{"type":"string","title":"External Id"},"status":{"type":"string","enum":["creating","ready","paid","cancelled","expired","failed","needs_review"],"title":"Status"},"generation_status":{"type":"string","enum":["draft","queued","processing","submitting","ready","delivered","needs_review","failed","cancelled"],"title":"Generation Status"},"payment_status":{"type":"string","enum":["pending","paid","cancelled","expired","needs_review"],"title":"Payment Status"},"amount_rub":{"type":"string","title":"Amount Rub"},"trader_rate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trader Rate"},"expected_usdt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected Usdt"},"created_at":{"type":"number","title":"Created At"},"updated_at":{"type":"number","title":"Updated At"},"expires_at":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Expires At"},"payment_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Url"},"qr_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qr Url"}},"type":"object","required":["id","external_id","status","generation_status","payment_status","amount_rub","created_at","updated_at"],"title":"PublicOrder"},"PublicOrders":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PublicOrder"},"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":"PublicOrders"},"PublicRate":{"properties":{"trader_rate":{"type":"string","title":"Trader Rate"},"factor":{"type":"string","title":"Factor"},"observed_at":{"type":"number","title":"Observed At"},"valid_until":{"type":"number","title":"Valid Until"},"stale":{"type":"boolean","title":"Stale"},"min_amount_rub":{"type":"string","title":"Min Amount Rub","default":"50"},"max_amount_rub":{"type":"string","title":"Max Amount Rub","default":"35000"}},"type":"object","required":["trader_rate","factor","observed_at","valid_until","stale"],"title":"PublicRate"}},"securitySchemes":{"PartnerAPIKey":{"type":"http","description":"Server-side partner API key. Never expose this key in browser JavaScript.","scheme":"bearer"}}},"servers":[{"url":"/api/v1"}]}