{"openapi":"3.1.0","info":{"title":"Lotto263 Partner API","version":"1.0.0","description":"Distribution and payment-partner API for Lotto263. Money values are integer minor units (cents). Every write takes an Idempotency-Key. A ticket bought through a partner is paid automatically to the account that funded it; the payout destination cannot be changed. Webhooks are signed: headers `x-lotto263-timestamp: <unix seconds>` and `x-lotto263-signature: v1=<hex HMAC-SHA256(webhookSecret, timestamp + \".\" + rawBody)>`; reject deliveries older than 5 minutes and de-duplicate on `x-lotto263-event-id`."},"servers":[{"url":"/api/partner/v1"}],"security":[{"bearer":[]}],"paths":{"/catalog":{"get":{"summary":"Open draws and pools with rules","x-scope":"catalog:read","responses":{"200":{"description":"Catalog","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"draws":{"type":"array","items":{"$ref":"#/components/schemas/Draw"}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/draws/{id}":{"get":{"summary":"One draw or pool","x-scope":"catalog:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Draw id"}],"responses":{"200":{"description":"Draw","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draw"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/results":{"get":{"summary":"Certified results","x-scope":"results:read","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","maximum":100}}],"responses":{"200":{"description":"Results","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object"}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts":{"post":{"summary":"Register a verified customer funding account (tokenised)","x-scope":"accounts:write","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["customerRef","accountToken","maskedAccount"],"properties":{"customerRef":{"type":"string"},"accountToken":{"type":"string","description":"Opaque token for the verified account; never a raw account number"},"maskedAccount":{"type":"string"},"payoutCapable":{"type":"boolean"}}}}}},"responses":{"201":{"description":"Account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders":{"post":{"summary":"Quote an order (validates lines, generates Quick Picks server-side)","x-scope":"orders:write","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}}},"responses":{"201":{"description":"Quoted order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Sales closed or idempotency conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid selection or funding account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}":{"get":{"summary":"Order status (by id or reference)","x-scope":"orders:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Order id or reference"}],"responses":{"200":{"description":"Order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/orders/{id}/confirm":{"post":{"summary":"Confirm the quoted total with customer consent; collection starts from the bound account","x-scope":"orders:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Order id"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["acceptedTotal","consentRef"],"properties":{"acceptedTotal":{"type":"integer"},"consentRef":{"type":"string"}}}}}},"responses":{"200":{"description":"Order (status awaiting_payment, issued or declined). Repeating the call returns the same outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tickets/{id}":{"get":{"summary":"Ticket detail, awards and payouts","x-scope":"orders:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Ticket id or serial"}],"responses":{"200":{"description":"Ticket","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ticket"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/payouts":{"get":{"summary":"Automatic payouts to your customers","x-scope":"payouts:read","parameters":[{"name":"customerRef","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Payouts","content":{"application/json":{"schema":{"type":"object","properties":{"payouts":{"type":"array","items":{"$ref":"#/components/schemas/Payout"}}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events":{"get":{"summary":"Event feed (replay of webhooks) after a sequence cursor","x-scope":"events:read","parameters":[{"name":"after","in":"query","schema":{"type":"integer"}},{"name":"limit","in":"query","schema":{"type":"integer","maximum":500}}],"responses":{"200":{"description":"Events","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"next":{"type":"integer"}}}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/payments/{reference}":{"get":{"summary":"Payment partner: status of a collection or refund instruction","x-scope":"payments:read","parameters":[{"name":"reference","in":"path","required":true,"schema":{"type":"string"},"description":"Instruction key, provider reference or order reference"}],"responses":{"200":{"description":"Payment","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/reconciliation":{"get":{"summary":"Daily reconciliation CSV (Africa/Harare business date)","x-scope":"orders:read or payments:read","parameters":[{"name":"date","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"CSV","content":{"text/csv":{"schema":{"type":"string"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"event":{"post":{"summary":"Signed event delivery: draw.opened, draw.suspended, draw.cancelled, draw.certified, ticket.issued, payment.changed, payout.changed, settlement.ready","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Acknowledge; non-2xx is retried with backoff"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"keyId.secret issued by the operator"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}},"Draw":{"type":"object","properties":{"id":{"type":"string"},"game":{"type":"string"},"kind":{"enum":["number","sports"]},"name":{"type":"string"},"number":{"type":"integer"},"status":{"type":"string"},"currency":{"type":"string"},"cutoffAt":{"type":"string","format":"date-time"},"drawAt":{"type":"string","format":"date-time"},"estimatedJackpot":{"type":["integer","null"]},"ruleVersion":{"type":"integer"},"rules":{"type":"object"},"fixtures":{"type":"array","items":{"type":"object"}}}},"Account":{"type":"object","properties":{"id":{"type":"string"},"customerRef":{"type":"string"},"maskedAccount":{"type":"string"},"payoutCapable":{"type":"boolean"},"status":{"type":"string"}}},"Line":{"type":"object","properties":{"main":{"type":"array","items":{"type":"integer"}},"special":{"type":"array","items":{"type":"integer"}},"quickPick":{"type":"boolean"},"picks":{"type":"object","additionalProperties":{"enum":["H","D","A"]},"description":"Sports: fixtureId → H/D/A"}}},"QuoteRequest":{"type":"object","required":["drawId","lines","customerRef","accountToken"],"properties":{"drawId":{"type":"string"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/Line"}},"customerRef":{"type":"string"},"accountToken":{"type":"string"}}},"Order":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"status":{"enum":["quoted","awaiting_payment","issued","declined","expired","refund_pending","refunded"]},"paymentStatus":{"type":"string"},"total":{"type":"integer"},"currency":{"type":"string"},"quoteExpiresAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object"}},"ticket":{"type":["object","null"]},"simulated":{"type":"boolean"}}},"Ticket":{"type":"object","properties":{"id":{"type":"string"},"serial":{"type":"string"},"status":{"type":"string"},"payoutRoute":{"const":"partner_account"},"maskedAccount":{"type":"string"},"lines":{"type":"array","items":{"type":"object"}},"awards":{"type":"array","items":{"type":"object"}},"payouts":{"type":"array","items":{"$ref":"#/components/schemas/Payout"}}}},"Payout":{"type":"object","properties":{"reference":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"enum":["queued","held","submitted","unknown","confirmed","failed","exception","reversed"]},"providerReference":{"type":["string","null"]}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"seq":{"type":"integer"},"type":{"type":"string"},"data":{"type":"object"},"created_at":{"type":"string"}}}}}}