{
  "openapi": "3.1.0",
  "info": {
    "title": "barriers Partner API",
    "version": "2.4.1",
    "summary": "Brokerage as a Service: onboard your clients under KYC reliance and trade on their behalf under our MiFID licence.",
    "description": "Revision 5 (2026-09-03). HEAD is answered wherever GET is (at the edge as a body-less GET); the edge body cap is 11.5 MiB (413 code 4130) so an 8 MB document fits after base64; webhook URLs must point at a public host (loopback, private, link-local, multicast and unroutable addresses refused at registration and before every delivery), redirects are never followed, at most 16 KiB of a failure body is read, the signature timestamp is taken per delivery, the notification sweep re-reads the last 30 seconds so a late-written item is still forwarded. Revision 4: Idempotency-Key is at most once: the key is claimed before the request runs, a concurrent request with the same key waits up to 5 s for the stored answer and replays it, else answers 409 code 4092 (a request with this Idempotency-Key is still in progress); the money routes are idempotent on partnerRef (a reuse for the same client answers the original row with 200, for another client 409 code 4092); the withdrawal and collateral gates run under the client lock and count the implied risk state; finance's approval re-runs the money-out gate; the custody model changes only on a partner with nothing standing. Revision 3: one channel per client: a client you onboard is serviced through your integration only (our own portal, password routes, direct client API and money desk answer 403 code 4038 PARTNER_CHANNEL to it; nothing on these routes changes). Every request carries `Authorization: Bearer pbk_...` (or `X-Partner-Key: pbk_...`). Success answers are `{code: 0, data}`; error answers `{code, msg, error, data?}`. Routes marked (bare) delegate to client API routes that predate the envelope and keep that route's own body shape. Codes: 4000 validation or a refused action (`data.errors` is a dotted-path map on the onboarding and MiFID writes; 413 for a body over the size cap), 4004 unknown client or object, 4010 unauthenticated (no, unknown or revoked key, a CLOSED partner, a source address outside the allowlist), 4030 verification required (`data.missingBlocks`), 4034 outside the key's scope, 4036 RELIANCE_NOT_APPROVED, 4037 PARTNER_SUSPENDED, 4090 e-mail in use, 4091 stale leverage hint, 4092 conflict (an Idempotency-Key reused for another request, a partnerClientRef or partnerRef reused, a stale test version, a locked section, a state that does not allow the action, a BROKER-custody money route used by a PARTNER-custody partner and the reverse, a collateral withdrawal refused for an economic reason with the REFUSED report in data, a settlement item reported FAILED after SETTLED; 4090 also on a leverage change that would breach the margin without force), 4290 rate limited or appropriateness retake too early (`data.retakeAt`), 5020 venue unavailable, 5030 service unavailable. The responses 401 (4010), 403 (4034, 4037) and 429 (4290) can occur on every route and are listed once under components. POST and PUT routes that create or move money honour `Idempotency-Key` (1 to 128 characters, the first answer replayed byte for byte for 24 h, at most one execution per key). Money is a decimal string in the currency's scale; timestamps are Unix milliseconds UTC. Custody models (revision 2): a BROKER-custody partner funds its clients through deposit notices and withdrawal requests confirmed by our finance desk; a PARTNER-custody partner holds the client money itself as a USD stablecoin valued 1:1 to USDC, reports collateral movements on /collateral (booked at once), and settles every economic event with its client from the settlement items we produce (custody tag). The full reference is docs/11-partner-api.md.",
    "contact": { "name": "PM MTF Ltd, brokerage (barriers)" }
  },
  "servers": [
    { "url": "https://dev.brokerage.perpetuals.com", "description": "Development (sandbox): the Kronos X development venue; sandbox partners settle money instantly" }
  ],
  "security": [ { "partnerKey": [] } ],
  "tags": [
    { "name": "partner", "description": "Partner-level reads" },
    { "name": "onboarding", "description": "Onboarding under KYC reliance, KYC revisions, documents" },
    { "name": "mifid", "description": "The MiFID appropriateness assessment (assessed by us) and the MiFID blocks" },
    { "name": "market-data", "description": "Public market data (the same handlers as the client API)" },
    { "name": "barriers", "description": "Barrier contracts by RFQ" },
    { "name": "staking", "description": "Staking swaps" },
    { "name": "orders", "description": "Orders on perpetual and spot markets, positions, fills" },
    { "name": "account", "description": "Balances, account figures, ledger, notifications" },
    { "name": "statements", "description": "Stored statements" },
    { "name": "money", "description": "Deposit notices, withdrawal requests (BROKER custody), the settlement report (both custody models)" },
    { "name": "custody", "description": "PARTNER custody: collateral reports, settlement items and their reports, the settlement summary with the interfirm block, the interfirm records" },
    { "name": "webhooks", "description": "The partner webhook endpoint and its delivery log" }
  ],
  "paths": {
    "/partner/v1/me": {
      "get": {
        "tags": [ "partner" ], "operationId": "getMe", "summary": "The partner profile, reliance status, limits, the calling key and the webhook state",
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/Me" } } } } } } }
      }
    },
    "/partner/v1/clients": {
      "get": {
        "tags": [ "partner" ], "operationId": "listClients", "summary": "The partner's clients, newest first",
        "parameters": [
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } },
          { "$ref": "#/components/parameters/before" },
          { "name": "q", "in": "query", "schema": { "type": "string" }, "description": "Case-insensitive text filter over e-mail, display name and partnerClientRef" },
          { "name": "state", "in": "query", "schema": { "type": "string" }, "description": "A lifecycle state (KYC_PENDING, ACTIVE, RESTRICTED, KYC_REJECTED, CLOSED)" },
          { "name": "level", "in": "query", "schema": { "type": "string", "enum": [ "NONE", "MICA", "MICA_MIFID" ] } }
        ],
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/ClientsPage" } } } } } },
          "400": { "$ref": "#/components/responses/BadRequest" }
        }
      },
      "post": {
        "tags": [ "onboarding" ], "operationId": "onboardClient", "summary": "Onboard a client under KYC reliance (the six MiCA blocks, the identity check record, the attestation)",
        "description": "Scope TRADE, reliance APPROVED. Creates the client, approves the six MiCA blocks under the partner's attestation, records the identity session, stores the KYC package (revision 1), runs OUR screening and grants level MICA through the compliance decision path. On a screening hit the client stays KYC_PENDING with status PENDING_REVIEW and a compliance case. A partnerClientRef that names a client whose reliance was REJECTED (level NONE, latest package REJECTED) answers 409 code 4092 pointing at PUT /partner/v1/clients/{clientId}/kyc, the re-onboarding, with data {clientId, clientUid, kycPackageStatus, reonboardWith}; nothing is created. Body cap 256 KB.",
        "parameters": [ { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OnboardRequest" } } } },
        "responses": {
          "201": { "description": "Created (status ACTIVE or PENDING_REVIEW)", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/OnboardResult" } } } } } },
          "400": { "$ref": "#/components/responses/ValidationError" },
          "403": { "$ref": "#/components/responses/RelianceNotApproved" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "413": { "$ref": "#/components/responses/PayloadTooLarge" }
        }
      }
    },
    "/partner/v1/clients/by-ref/{partnerClientRef}": {
      "get": {
        "tags": [ "partner" ], "operationId": "getClientByRef", "summary": "Resolve a client by the partner's own reference",
        "parameters": [ { "name": "partnerClientRef", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 } } ],
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/ClientRow" } } } } } },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/partner/v1/clients/{clientId}": {
      "get": {
        "tags": [ "partner" ], "operationId": "getClient", "summary": "One client row",
        "parameters": [ { "$ref": "#/components/parameters/clientId" } ],
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/ClientRow" } } } } } },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/partner/v1/summary": {
      "get": {
        "tags": [ "partner" ], "operationId": "getSummary", "summary": "Clients by state and level, client cash per currency, open barriers and swaps, pending deposits, withdrawals and reviews",
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/Summary" } } } } } } }
      }
    },
    "/partner/v1/clients/{clientId}/kyc": {
      "put": {
        "tags": [ "onboarding" ], "operationId": "updateKyc", "summary": "A new KYC package revision (the sections present are re-approved under reliance; a changed identity is re-screened); after a REJECTED package the full re-onboarding",
        "description": "Ordinary revision: at least one MiCA section plus the attestation; a changed name, date of birth or set of citizenships re-runs OUR screening (a hit RESTRICTS the client pending review), refreshes the display name and rebuilds our RTS 22 identifier record (a changed identification or tax residency block rebuilds it too). Re-onboarding: when the client sits at level NONE with its latest package REJECTED, the body must carry all six MiCA sections, the identityCheck record and the attestation (400 with the field map otherwise); the call stores the next revision, re-approves every block, records the new identity session, runs OUR screening and re-runs the MiCA grant exactly like POST /clients, answering reonboarded true with grant ACTIVE | PENDING_REVIEW, review and requirements.",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/KycUpdateRequest" } } } },
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/KycUpdateResult" } } } } } },
          "400": { "$ref": "#/components/responses/ValidationError" },
          "403": { "$ref": "#/components/responses/RelianceNotApproved" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "413": { "$ref": "#/components/responses/PayloadTooLarge" }
        }
      },
      "get": {
        "tags": [ "onboarding" ], "operationId": "getKyc", "summary": "The latest KYC package (payload, attestation, status, review note)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" } ],
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/KycPackage" } } } } } },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/partner/v1/clients/{clientId}/documents": {
      "post": {
        "tags": [ "onboarding" ], "operationId": "uploadDocument", "summary": "Upload a document on request (JPEG, PNG or PDF, at most 8 MB, at most 20 live partner documents per client)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DocumentUpload" } } } },
        "responses": {
          "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/DocumentUploadResult" } } } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "413": { "$ref": "#/components/responses/PayloadTooLarge" }
        }
      },
      "get": {
        "tags": [ "onboarding" ], "operationId": "listDocuments", "summary": "The client's documents, ours and yours (metadata only)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" } ],
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "documents": { "type": "array", "items": { "$ref": "#/components/schemas/Document" } } } } } } } } },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/partner/v1/appropriateness-test": {
      "get": {
        "tags": [ "mifid" ], "operationId": "getAppropriatenessTest", "summary": "The current appropriateness questionnaire in client view (versioned, no points or thresholds)",
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/AppropriatenessTest" } } } } } } }
      }
    },
    "/partner/v1/clients/{clientId}/appropriateness": {
      "post": {
        "tags": [ "mifid" ], "operationId": "answerAppropriateness", "summary": "Score the client's answers (attempts, cooldown, PASS | WARN | FAIL); the MiFID grant runs when the blocks are in place",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppropriatenessAnswers" } } } },
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/AppropriatenessResult" } } } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "429": { "$ref": "#/components/responses/RetakeTooEarly" }
        }
      }
    },
    "/partner/v1/clients/{clientId}/appropriateness/acknowledge": {
      "post": {
        "tags": [ "mifid" ], "operationId": "acknowledgeAppropriateness", "summary": "Acknowledge a WARN result (the partner attests the warning text was shown and accepted)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AcknowledgeRequest" } } } },
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/AcknowledgeResult" } } } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "$ref": "#/components/responses/Conflict" }
        }
      }
    },
    "/partner/v1/clients/{clientId}/mifid": {
      "put": {
        "tags": [ "mifid" ], "operationId": "putMifid", "summary": "The four MiFID blocks under the partner's attestation; the level becomes MICA_MIFID once the assessment is complete",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MifidRequest" } } } },
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/MifidResult" } } } } } },
          "400": { "$ref": "#/components/responses/ValidationError" },
          "403": { "$ref": "#/components/responses/RelianceNotApproved" },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/partner/v1/clients/{clientId}/verification": {
      "get": {
        "tags": [ "mifid" ], "operationId": "getVerification", "summary": "The verification overview (level, lifecycle, blocks, requirements, appropriateness, the package summary)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" } ],
        "responses": {
          "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/VerificationView" } } } } } },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      }
    },
    "/partner/v1/instruments": {
      "get": { "tags": [ "market-data" ], "operationId": "getInstruments", "summary": "The tradable instruments (bare)", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Instruments" } } } }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/ticker": {
      "get": { "tags": [ "market-data" ], "operationId": "getTicker", "summary": "The venue ticker of one market", "parameters": [ { "$ref": "#/components/parameters/symbol" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Ticker" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/tickers": {
      "get": { "tags": [ "market-data" ], "operationId": "getTickers", "summary": "One ticker row per listed market (bare)", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Tickers" } } } }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/klines": {
      "get": {
        "tags": [ "market-data" ], "operationId": "getKlines", "summary": "Candles, oldest first",
        "parameters": [
          { "$ref": "#/components/parameters/symbol" },
          { "name": "interval", "in": "query", "schema": { "type": "string", "enum": [ "1m", "5m", "15m", "30m", "1h", "4h", "1d" ], "default": "1m" } },
          { "name": "from", "in": "query", "schema": { "type": "integer" }, "description": "Inclusive lower bound on the bucket open, Unix ms" },
          { "name": "to", "in": "query", "schema": { "type": "integer" }, "description": "Exclusive upper bound on the bucket open, Unix ms" },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 1000, "default": 200 } }
        ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Klines" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/orderbook": {
      "get": { "tags": [ "market-data" ], "operationId": "getOrderBook", "summary": "The order book of one market, best level first (bare)", "parameters": [ { "$ref": "#/components/parameters/symbol" }, { "name": "depth", "in": "query", "schema": { "type": "integer", "default": 25 }, "description": "Levels per side: 1, 5, 25 or 100" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrderBook" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/market-trades": {
      "get": { "tags": [ "market-data" ], "operationId": "getMarketTrades", "summary": "Recent public trades of one market (bare)", "parameters": [ { "$ref": "#/components/parameters/symbol" }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 50 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketTrades" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/index-price": {
      "get": { "tags": [ "market-data" ], "operationId": "getIndexPrice", "summary": "The index price of one market (bare)", "parameters": [ { "$ref": "#/components/parameters/symbol" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IndexPrice" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/funding": {
      "get": { "tags": [ "market-data" ], "operationId": "getFunding", "summary": "The current funding of one market (bare)", "parameters": [ { "$ref": "#/components/parameters/symbol" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Funding" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/market-info": {
      "get": { "tags": [ "market-data" ], "operationId": "getMarketInfo", "summary": "The full specification of one market (bare)", "parameters": [ { "$ref": "#/components/parameters/symbol" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketInfo" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/trading-status": {
      "get": { "tags": [ "market-data" ], "operationId": "getTradingStatus", "summary": "Standing trading halts", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/TradingStatus" } } } } } } } }
    },
    "/partner/v1/currencies": {
      "get": { "tags": [ "market-data" ], "operationId": "getCurrencies", "summary": "The client currency registry (bare)", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Currencies" } } } } } }
    },
    "/partner/v1/staking/markets": {
      "get": { "tags": [ "staking" ], "operationId": "getStakingMarkets", "summary": "The staking swap markets with the unsecured-writer disclosure", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/StakingMarkets" } } } } } }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/staking/offers": {
      "get": { "tags": [ "staking" ], "operationId": "getStakingOffers", "summary": "The anonymous offers board", "parameters": [ { "name": "asset", "in": "query", "schema": { "type": "string" }, "description": "Only offers in this asset" }, { "name": "symbol", "in": "query", "schema": { "type": "string" }, "description": "Only offers on this market" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/StakingOffers" } } } } } }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/clients/{clientId}/rfq": {
      "post": {
        "tags": [ "barriers" ], "operationId": "createRfq", "summary": "Open a barrier RFQ",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RfqRequest" } } } },
        "responses": {
          "200": { "description": "The request (state OPEN, or ACCEPTED when the auto-accept already opened the contract)", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/Rfq" } } } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "403": { "$ref": "#/components/responses/VerificationRequired" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "502": { "$ref": "#/components/responses/VenueUnavailable" },
          "503": { "$ref": "#/components/responses/ServiceUnavailable" }
        }
      },
      "get": {
        "tags": [ "barriers" ], "operationId": "listRfqs", "summary": "The client's live requests with their quotes",
        "parameters": [ { "$ref": "#/components/parameters/clientId" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "rfqs": { "type": "array", "items": { "$ref": "#/components/schemas/Rfq" } } } } } } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/rfq/preview": {
      "post": {
        "tags": [ "barriers" ], "operationId": "previewRfq", "summary": "Preview a barrier RFQ (nothing written)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RfqRequest" } } } },
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/RfqPreview" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/VerificationRequired" }, "404": { "$ref": "#/components/responses/NotFound" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/rfq/{rfqId}": {
      "get": {
        "tags": [ "barriers" ], "operationId": "getRfq", "summary": "One request with its quotes",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/rfqId" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/Rfq" } } } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/rfq/{rfqId}/accept": {
      "post": {
        "tags": [ "barriers" ], "operationId": "acceptRfqQuote", "summary": "Accept a quote (opens the contract)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/rfqId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "quoteId" ], "properties": { "quoteId": { "type": "integer", "format": "int64" } } } } } },
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/RfqAcceptResult" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/rfq/{rfqId}/cancel": {
      "post": {
        "tags": [ "barriers" ], "operationId": "cancelRfq", "summary": "Cancel a request",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/rfqId" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "rfqId": { "type": "integer", "format": "int64" }, "state": { "type": "string", "const": "CANCELLED" } } } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/barriers": {
      "get": {
        "tags": [ "barriers" ], "operationId": "listBarriers", "summary": "The client's barrier contracts (open, valued live, or history)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "state", "in": "query", "schema": { "type": "string", "enum": [ "open", "history" ], "default": "open" } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 } }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "barriers": { "type": "array", "items": { "$ref": "#/components/schemas/BarrierContract" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] }, "currency": { "type": "string" } } } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/barriers/{contractId}/close": {
      "post": {
        "tags": [ "barriers" ], "operationId": "closeBarrier", "summary": "Request an early close by RFQ (settles EARLY_CLOSE at the accepted quote)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "contractId", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BarrierCloseRequest" } } } },
        "responses": { "200": { "description": "The close request (an Rfq with closeContractId and contractEntry set)", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/Rfq" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/staking/{offerId}/accept": {
      "post": {
        "tags": [ "staking" ], "operationId": "acceptStakingOffer", "summary": "Take a staking offer (opens the swap)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "offerId", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "qty" ], "properties": { "qty": { "type": "string", "description": "The size to take, in the market's asset, on the lot grid" } } } } } },
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/Swap" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/VerificationRequired" }, "404": { "$ref": "#/components/responses/NotFound" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/staking/swaps": {
      "get": {
        "tags": [ "staking" ], "operationId": "listSwaps", "summary": "The client's swaps",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "state", "in": "query", "schema": { "type": "string", "enum": [ "live", "history", "all" ], "default": "live" } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 } }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "swaps": { "type": "array", "items": { "$ref": "#/components/schemas/Swap" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/staking/swaps/{swapId}": {
      "get": {
        "tags": [ "staking" ], "operationId": "getSwap", "summary": "One swap (by the venue contract id, or the router's swap id)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "swapId", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/Swap" } } } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/orders": {
      "post": {
        "tags": [ "orders" ], "operationId": "placeOrder", "summary": "Place an order on a perpetual or spot market (bare)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlaceOrderRequest" } } } },
        "responses": {
          "200": { "description": "Accepted (bare)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlaceOrderResult" } } } },
          "400": { "description": "Refused: `{code: 4000, msg, error, orderId, clOrdId, state}` (orderId null when nothing was written)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PlaceOrderRefused" } } } },
          "403": { "$ref": "#/components/responses/VerificationRequired" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "description": "409 code 4091: the leverage hint no longer matches the stored choice (`data: {leverageSent, leverageStored}`); nothing was written", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "502": { "$ref": "#/components/responses/VenueUnavailable" }
        }
      },
      "get": {
        "tags": [ "orders" ], "operationId": "listOrders", "summary": "Order history (bare, cursor paged)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 } }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK (bare)", "content": { "application/json": { "schema": { "type": "object", "properties": { "orders": { "type": "array", "items": { "$ref": "#/components/schemas/Order" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/partner/v1/clients/{clientId}/orders/open": {
      "get": {
        "tags": [ "orders" ], "operationId": "listOpenOrders", "summary": "Every live order",
        "parameters": [ { "$ref": "#/components/parameters/clientId" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "array", "items": { "$ref": "#/components/schemas/Order" } } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/partner/v1/clients/{clientId}/orders/{orderId}": {
      "delete": {
        "tags": [ "orders" ], "operationId": "cancelOrder", "summary": "Cancel an order (bare)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "orderId", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" }, "description": "The router's order id (the numeric part of the BARR- reference)" } ],
        "responses": { "200": { "description": "OK (bare)", "content": { "application/json": { "schema": { "type": "object", "properties": { "orderId": { "type": "integer", "format": "int64" }, "clOrdId": { "type": "string" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "502": { "$ref": "#/components/responses/VenueUnavailable" } }
      }
    },
    "/partner/v1/clients/{clientId}/positions": {
      "get": { "tags": [ "orders" ], "operationId": "listPositions", "summary": "Open positions (bare)", "parameters": [ { "$ref": "#/components/parameters/clientId" } ], "responses": { "200": { "description": "OK (bare)", "content": { "application/json": { "schema": { "type": "object", "properties": { "positions": { "type": "array", "items": { "$ref": "#/components/schemas/Position" } } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }
    },
    "/partner/v1/clients/{clientId}/trades": {
      "get": { "tags": [ "orders" ], "operationId": "listTrades", "summary": "Fills (bare, cursor paged)", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 } }, { "$ref": "#/components/parameters/before" } ], "responses": { "200": { "description": "OK (bare)", "content": { "application/json": { "schema": { "type": "object", "properties": { "trades": { "type": "array", "items": { "$ref": "#/components/schemas/Trade" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }
    },
    "/partner/v1/clients/{clientId}/position-history": {
      "get": { "tags": [ "orders" ], "operationId": "listPositionHistory", "summary": "Fills that realised P&L (bare, cursor paged)", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 } }, { "$ref": "#/components/parameters/before" } ], "responses": { "200": { "description": "OK (bare)", "content": { "application/json": { "schema": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/PositionHistoryItem" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }
    },
    "/partner/v1/clients/{clientId}/balances": {
      "get": { "tags": [ "account" ], "operationId": "getBalances", "summary": "Balances per currency with the margin figures and the portfolio value (bare)", "parameters": [ { "$ref": "#/components/parameters/clientId" } ], "responses": { "200": { "description": "OK (bare)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Balances" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }
    },
    "/partner/v1/clients/{clientId}/account/summary": {
      "get": { "tags": [ "account" ], "operationId": "getAccountSummary", "summary": "Lifetime aggregates", "parameters": [ { "$ref": "#/components/parameters/clientId" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/AccountSummary" } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }
    },
    "/partner/v1/clients/{clientId}/account/overview": {
      "get": { "tags": [ "account" ], "operationId": "getAccountOverview", "summary": "The portfolio overview in one round trip", "parameters": [ { "$ref": "#/components/parameters/clientId" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/AccountOverview" } } } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/clients/{clientId}/ledger": {
      "get": { "tags": [ "account" ], "operationId": "getLedger", "summary": "Ledger postings, newest first", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 } }, { "$ref": "#/components/parameters/before" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "postings": { "type": "array", "items": { "$ref": "#/components/schemas/LedgerPosting" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }
    },
    "/partner/v1/clients/{clientId}/notifications": {
      "get": { "tags": [ "account" ], "operationId": "getNotifications", "summary": "The client's notification items since a time, oldest first (at most 200)", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "since", "in": "query", "schema": { "type": "integer", "format": "int64" }, "description": "Unix ms; default the last 24 hours" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/NotificationsAnswer" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }
    },
    "/partner/v1/clients/{clientId}/statements": {
      "get": { "tags": [ "statements" ], "operationId": "listStatements", "summary": "The client's statements, newest first (bare)", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "kind", "in": "query", "schema": { "type": "string", "enum": [ "ACCOUNT", "COSTS", "TRANSACTIONS", "TAX", "CLIENT_ASSETS" ] } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } } ], "responses": { "200": { "description": "OK (bare)", "content": { "application/json": { "schema": { "type": "object", "properties": { "statements": { "type": "array", "items": { "$ref": "#/components/schemas/Statement" } } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } },
      "post": { "tags": [ "statements" ], "operationId": "generateStatement", "summary": "Generate a statement (bare; 30 per client per hour)", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenerateStatementRequest" } } } }, "responses": { "200": { "description": "The new statement row (bare)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Statement" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "429": { "$ref": "#/components/responses/TooManyRequests" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/clients/{clientId}/statements/{sid}": {
      "get": { "tags": [ "statements" ], "operationId": "getStatement", "summary": "One statement with its model (bare)", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/sid" } ], "responses": { "200": { "description": "OK (bare)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Statement" } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/clients/{clientId}/statements/{sid}/pdf": {
      "get": { "tags": [ "statements" ], "operationId": "getStatementPdf", "summary": "The statement PDF", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/sid" } ], "responses": { "200": { "description": "application/pdf attachment", "content": { "application/pdf": { "schema": { "type": "string", "format": "binary" } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/clients/{clientId}/statements/{sid}/csv": {
      "get": { "tags": [ "statements" ], "operationId": "getStatementCsv", "summary": "The statement CSV", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/sid" } ], "responses": { "200": { "description": "text/csv attachment", "content": { "text/csv": { "schema": { "type": "string" } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/clients/{clientId}/deposits": {
      "post": {
        "tags": [ "money" ], "operationId": "createDepositNotice", "summary": "A deposit notice (BROKER custody: PENDING until finance confirms; sandbox partners confirm at once; a PARTNER-custody partner answers 409 code 4092 and reports on /collateral instead)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DepositRequest" } } } },
        "responses": { "200": { "description": "The partnerRef was already filed for this client: the ORIGINAL notice replayed, nothing new (revision 4)", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/DepositNotice" } } } } } }, "201": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/DepositNotice" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/VerificationRequired" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" } }
      },
      "get": {
        "tags": [ "money" ], "operationId": "listClientDeposits", "summary": "The client's deposit notices",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "PENDING", "CONFIRMED", "REJECTED" ] } }, { "$ref": "#/components/parameters/limit200" }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/DepositsPage" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/partner/v1/deposits": {
      "get": {
        "tags": [ "money" ], "operationId": "listDeposits", "summary": "Deposit notices, partner-wide",
        "parameters": [ { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "PENDING", "CONFIRMED", "REJECTED" ] } }, { "$ref": "#/components/parameters/limit200" }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/DepositsPage" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } }
      }
    },
    "/partner/v1/clients/{clientId}/withdrawals": {
      "post": {
        "tags": [ "money" ], "operationId": "createWithdrawalRequest", "summary": "A withdrawal request (BROKER custody: the cash is reserved at once; sandbox partners are approved and paid at once; a PARTNER-custody partner answers 409 code 4092 and reports on /collateral instead)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WithdrawalRequestBody" } } } },
        "responses": { "200": { "description": "The partnerRef was already filed for this client: the ORIGINAL request replayed, nothing new (revision 4)", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/WithdrawalRequest" } } } } } }, "201": { "description": "Created: the amount reserved under the client lock (the cash and, for USDC, the lesser of cash and free margin with no margin call or close-out, recorded or implied); the reserve does not count as margin", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/WithdrawalRequest" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "403": { "$ref": "#/components/responses/VerificationRequired" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" } }
      },
      "get": {
        "tags": [ "money" ], "operationId": "listClientWithdrawals", "summary": "The client's withdrawal requests",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "REQUESTED", "APPROVED", "PAID", "REJECTED", "CANCELLED" ] } }, { "$ref": "#/components/parameters/limit200" }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/WithdrawalsPage" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/partner/v1/clients/{clientId}/withdrawals/{rid}/cancel": {
      "post": {
        "tags": [ "money" ], "operationId": "cancelWithdrawalRequest", "summary": "Cancel a REQUESTED withdrawal (the reserve is released)",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "rid", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "request": { "$ref": "#/components/schemas/WithdrawalRequest" }, "alreadyDecided": { "type": "boolean" } } } } } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" } }
      }
    },
    "/partner/v1/withdrawals": {
      "get": {
        "tags": [ "money" ], "operationId": "listWithdrawals", "summary": "Withdrawal requests, partner-wide",
        "parameters": [ { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "REQUESTED", "APPROVED", "PAID", "REJECTED", "CANCELLED" ] } }, { "$ref": "#/components/parameters/limit200" }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/WithdrawalsPage" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } }
      }
    },
    "/partner/v1/settlement": {
      "get": {
        "tags": [ "money" ], "operationId": "getSettlement", "summary": "The settlement report per currency (deposits confirmed, withdrawals paid, commissions, realised P&L, closing client cash), with the custody model and, for PARTNER custody, the interfirm block",
        "parameters": [ { "name": "from", "in": "query", "schema": { "type": "integer", "format": "int64" }, "description": "Unix ms, default 0" }, { "name": "to", "in": "query", "schema": { "type": "integer", "format": "int64" }, "description": "Unix ms, default now" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/Settlement" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } }
      }
    },
    "/partner/v1/clients/{clientId}/margin": {
      "get": { "tags": [ "orders" ], "operationId": "getMargin", "summary": "The live margin picture (bare): equity, cash, free margin, positions, the barrier share", "description": "The same body as the client API's GET /v1/margin. Under PARTNER custody `cash` is the collateral the partner reported, as the ledger holds it.", "parameters": [ { "$ref": "#/components/parameters/clientId" } ], "responses": { "200": { "description": "OK (bare)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarginView" } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/clients/{clientId}/margin/preview": {
      "post": { "tags": [ "orders" ], "operationId": "previewOrder", "summary": "The pre-trade check of an order, nothing written (bare)", "parameters": [ { "$ref": "#/components/parameters/clientId" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PreviewRequest" } } } }, "responses": { "200": { "description": "OK (bare); `accepted: false` carries the refusal sentence in `reason`", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PreviewResult" } } } }, "400": { "description": "400 code 4000: a malformed order shape (`accepted: false`, the sentence in `reason`)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "502": { "$ref": "#/components/responses/VenueUnavailable" }, "503": { "$ref": "#/components/responses/ServiceUnavailable" } } }
    },
    "/partner/v1/clients/{clientId}/leverage": {
      "get": { "tags": [ "orders" ], "operationId": "getLeverage", "summary": "The client's leverage on one perpetual market (bare)", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/symbol" } ], "responses": { "200": { "description": "OK (bare)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeverageView" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } },
      "put": { "tags": [ "orders" ], "operationId": "setLeverage", "summary": "Set the client's leverage on one perpetual market (bare)", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeverageRequest" } } } }, "responses": { "200": { "description": "Applied (bare)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeverageView" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/LeverageWouldBreach" } } },
      "post": { "tags": [ "orders" ], "operationId": "setLeverageByPost", "summary": "The same as PUT, for clients that cannot send PUT (bare)", "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeverageRequest" } } } }, "responses": { "200": { "description": "Applied (bare)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeverageView" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/LeverageWouldBreach" } } }
    },
    "/partner/v1/clients/{clientId}/collateral": {
      "post": {
        "tags": [ "custody" ], "operationId": "reportCollateral", "summary": "Report a collateral DEPOSIT or WITHDRAWAL (PARTNER custody): booked at once, 1:1 in USDC",
        "description": "Scope TRADE. A DEPOSIT books PARTNER_COLLATERAL_IN (client cash against HOUSE partner_custody:{partnerId}, ledger key pcol:{reportId}); a WITHDRAWAL books PARTNER_COLLATERAL_OUT when the client's collateral and the lesser of cash and free margin allow it and no restriction, margin call or close-out (recorded or implied by the live marks) stands, the gates read under the client lock inside the booking transaction (revision 4), otherwise a REFUSED report is recorded and answered 409 code 4092 with the reason. A partnerRef already filed for the same client replays the original report (200 for a BOOKED one, its original 409 for a REFUSED one), nothing written. A BROKER-custody partner answers 409 code 4092 and nothing is written. Neither direction produces a settlement item; the EDD deposit sum counts collateral deposits.",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CollateralReportRequest" } } } },
        "responses": {
          "200": { "description": "The partnerRef was already filed for this client and its report is BOOKED: the original report replayed (the balances as they stand now), nothing new (revision 4)", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/CollateralBooked" } } } } } },
          "201": { "description": "Booked", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/CollateralBooked" } } } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "403": { "$ref": "#/components/responses/VerificationRequired" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "409": { "description": "409 code 4092: a BROKER-custody partner, a closed account or a partnerRef already filed for another client (nothing written), an economic refusal of a withdrawal (a restriction, beyond the collateral, margin call or close-out recorded or implied, beyond the lesser of cash and free margin) recorded as a REFUSED report with data {reportId, status, refusal, report}, or the replay of a REFUSED report already filed under this partnerRef for the same client (the same data, nothing written)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CollateralRefused" } } } }
        }
      },
      "get": {
        "tags": [ "custody" ], "operationId": "listClientCollateral", "summary": "The client's collateral reports, newest first",
        "parameters": [ { "$ref": "#/components/parameters/clientId" }, { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "BOOKED", "REFUSED" ] } }, { "$ref": "#/components/parameters/limit200" }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/CollateralPage" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/partner/v1/collateral": {
      "get": {
        "tags": [ "custody" ], "operationId": "listCollateral", "summary": "Collateral reports, partner-wide",
        "parameters": [ { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "BOOKED", "REFUSED" ] } }, { "$ref": "#/components/parameters/limit200" }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/CollateralPage" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } }
      }
    },
    "/partner/v1/settlement/items": {
      "get": {
        "tags": [ "custody" ], "operationId": "listSettlementItems", "summary": "Settlement items, newest first (PARTNER custody)",
        "parameters": [ { "name": "status", "in": "query", "schema": { "type": "string", "enum": [ "PENDING", "SETTLED", "FAILED" ] } }, { "name": "since", "in": "query", "schema": { "type": "integer", "format": "int64" }, "description": "Unix ms: the items with occurredAt at or after it" }, { "name": "clientId", "in": "query", "schema": { "type": "string" }, "description": "Our numeric client id or the BARR-... uid; a foreign client answers 404" }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 } }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/SettlementItemsPage" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/partner/v1/settlement/items/{itemId}/report": {
      "post": {
        "tags": [ "custody" ], "operationId": "reportSettlementItem", "summary": "Report one settlement item SETTLED (with your transaction reference) or FAILED",
        "description": "Idempotent: the same status again answers 200 with changed false and nothing rewritten; SETTLED after FAILED is the retry; FAILED after SETTLED answers 409 code 4092. A report never changes the item's amount or the interfirm balance.",
        "parameters": [ { "name": "itemId", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } }, { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SettlementItemReport" } } } },
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/SettlementItemReportResult" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "description": "409 code 4092: the item was already reported SETTLED and cannot be reported FAILED (data.item)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }
      }
    },
    "/partner/v1/settlement/report": {
      "post": {
        "tags": [ "custody" ], "operationId": "reportSettlementBulk", "summary": "Report up to 500 settlement items at once (every entry applied on its own, the outcomes answered together)",
        "parameters": [ { "$ref": "#/components/parameters/idempotencyKey" } ],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SettlementBulkReport" } } } },
        "responses": { "200": { "description": "OK: the per-entry outcomes and the counts (a refused entry never fails the batch)", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/SettlementBulkReportResult" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } }
      }
    },
    "/partner/v1/settlement/summary": {
      "get": {
        "tags": [ "custody" ], "operationId": "getSettlementSummary", "summary": "The settlement position per currency for a window: the PENDING, SETTLED and FAILED buckets, the collateral held, the client cash and the interfirm block with outstanding",
        "parameters": [ { "name": "from", "in": "query", "schema": { "type": "integer", "format": "int64" }, "description": "Unix ms by the items' occurredAt, default 0" }, { "name": "to", "in": "query", "schema": { "type": "integer", "format": "int64" }, "description": "Unix ms, default now" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/SettlementSummary" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } }
      }
    },
    "/partner/v1/settlement/interfirm": {
      "get": {
        "tags": [ "custody" ], "operationId": "listInterfirmSettlements", "summary": "The interfirm settlements our finance recorded, newest first",
        "parameters": [ { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 50 } }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/InterfirmPage" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } }
      }
    },
    "/partner/v1/webhook": {
      "put": {
        "tags": [ "webhooks" ], "operationId": "putWebhook", "summary": "Set the webhook URL (https); the signing secret is answered ONCE and rotated on every PUT",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "url" ], "properties": { "url": { "type": "string", "format": "uri", "description": "An absolute https URL to a PUBLIC host: a loopback, private, link-local, multicast or otherwise unroutable address (an IP literal, or any address the name resolves to) and localhost are refused with 400 code 4000; the check runs again before every delivery. Redirects are never followed." } } } } } },
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/WebhookSecret" } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } }
      },
      "get": {
        "tags": [ "webhooks" ], "operationId": "getWebhook", "summary": "The webhook status",
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "$ref": "#/components/schemas/WebhookStatus" } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } }
      },
      "delete": {
        "tags": [ "webhooks" ], "operationId": "deleteWebhook", "summary": "Deactivate the webhook",
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "active": { "type": "boolean", "const": false }, "updatedAt": { "type": "integer", "format": "int64" } } } } } } } }, "404": { "$ref": "#/components/responses/NotFound" } }
      }
    },
    "/partner/v1/webhook/test": {
      "post": {
        "tags": [ "webhooks" ], "operationId": "testWebhook", "summary": "Enqueue a webhook.test delivery",
        "parameters": [ { "$ref": "#/components/parameters/idempotencyKey" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "deliveryId": { "type": "integer", "format": "int64" }, "event": { "type": "string", "const": "webhook.test" }, "queuedAt": { "type": "integer", "format": "int64" } } } } } } } }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" } }
      }
    },
    "/partner/v1/webhook/deliveries": {
      "get": {
        "tags": [ "webhooks" ], "operationId": "listWebhookDeliveries", "summary": "The delivery log, newest first",
        "parameters": [ { "$ref": "#/components/parameters/limit200" }, { "$ref": "#/components/parameters/before" } ],
        "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "required": [ "code", "data" ], "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "deliveries": { "type": "array", "items": { "$ref": "#/components/schemas/Delivery" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } }
      }
    }
  },
  "webhooks": {
    "partnerEvent": {
      "post": {
        "summary": "One event delivered to the partner's webhook URL",
        "description": "POST with `Content-Type: application/json` and the headers `X-Brokerage-Event` (the event name), `X-Brokerage-Delivery` (the delivery id, the same on every retry), `X-Brokerage-Timestamp` (Unix SECONDS at send time) and `X-Brokerage-Signature` (`v1=` plus the lower-case hex of HMAC-SHA256(secret, timestamp + \".\" + body) over the raw body). Answer any 2xx within 10 seconds; otherwise the delivery is retried after 5 s x 2^n (n attempts so far, capped at 2^7), at most 10 attempts; a redirect counts as a failure and is not followed; at most 16 KiB of a failure body is read and 256 bytes kept in the delivery log; the timestamp and signature are computed for each delivery when it is sent. Deduplicate on `id`; deliveries can arrive out of order.",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookDelivery" } } } },
        "responses": { "200": { "description": "Acknowledged (any 2xx)" } }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "partnerKey": { "type": "http", "scheme": "bearer", "bearerFormat": "pbk_ key", "description": "The partner API key (scope READ: GET and HEAD routes, HEAD answered at the edge as a body-less GET; TRADE: everything). `X-Partner-Key: pbk_...` is accepted as well. A CIDR allowlist and per-partner rate limits apply." }
    },
    "parameters": {
      "clientId": { "name": "clientId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Our numeric client id or the BARR-... client uid. A client of another partner answers 404 code 4004." },
      "idempotencyKey": { "name": "Idempotency-Key", "in": "header", "required": false, "schema": { "type": "string", "minLength": 1, "maxLength": 128 }, "description": "At most one execution per key (revision 4): the key is claimed before the request runs; the first answer is stored and replayed byte for byte for 24 h; a concurrent request with the same key waits up to 5 s for that answer and replays it, else answers 409 code 4092 \"A request with this Idempotency-Key is still in progress.\" and executes nothing (retry later for the stored answer); a request that failed with an error before answering gives the key back; a reuse for another method or path answers 409 code 4092." },
      "before": { "name": "before", "in": "query", "schema": { "type": "integer", "format": "int64" }, "description": "Keyset cursor: the nextBefore of the previous page." },
      "limit200": { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } },
      "symbol": { "name": "symbol", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The market symbol, e.g. BTC-USD-PERP" },
      "rfqId": { "name": "rfqId", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" }, "description": "The router's request id" },
      "sid": { "name": "sid", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" }, "description": "The client's statement id" }
    },
    "responses": {
      "BadRequest": { "description": "400 code 4000: validation, a refused action, a malformed paging value or Idempotency-Key header (the sentence in msg)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "ValidationError": { "description": "400 code 4000 \"Please check the highlighted fields.\" with data.errors, a map of dotted field paths to one sentence each; nothing was written", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } } },
      "PayloadTooLarge": { "description": "413 code 4000: the request body is over the cap (256 KB on the onboarding and KYC writes, 8 MB on a document); 413 code 4130 from the edge when the whole request body exceeds 11.5 MiB (12,058,624 bytes, sized so an 8 MB document fits after base64 and JSON framing)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "Unauthorized": { "description": "401 code 4010: no key, an unknown or revoked key, the key of a CLOSED partner, or a source address outside the allowlist (one and the same answer for every case: nothing distinguishes an unknown key from a valid key used from a wrong address)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "ForbiddenScope": { "description": "403 code 4034: the key's scope does not cover the route (a READ key on a write)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "PartnerSuspended": { "description": "403 code 4037 PARTNER_SUSPENDED (data.error)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "VerificationRequired": { "description": "403 code 4030: the client's verification level or blocks do not allow the action; data {action, level, requiredLevel, missingBlocks}", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GateError" } } } },
      "RelianceNotApproved": { "description": "403 code 4036 RELIANCE_NOT_APPROVED (data.error): the partner's reliance status is not APPROVED (also 4037 PARTNER_SUSPENDED)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "NotFound": { "description": "404 code 4004: unknown client (or a client of another partner), request, contract, swap, order, statement, notice, document or webhook", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "Conflict": { "description": "409: code 4090 (an OPEN client already uses the e-mail address) or code 4092 (a reused partnerClientRef, a partnerRef reused for another client (a reuse for the same client replays the original row with 200), an Idempotency-Key reused for another method or path or still in progress on a concurrent request, a stale test version, a locked section, a closed account, a state that does not allow the action, the document cap; on POST /clients a partnerClientRef naming a REJECTED client points at the re-onboarding PUT .../kyc with data {clientId, clientUid, kycPackageStatus, reonboardWith})", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "TooManyRequests": { "description": "429 code 4290: the partner's rate limit or a per-client generation cap", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "RetakeTooEarly": { "description": "429 code 4290: a retake before the cooling period elapsed (data.retakeAt)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "VenueUnavailable": { "description": "502 code 5020: the trading venue cannot be reached (a trading write usually stays in flight and the poll resolves it)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "ServiceUnavailable": { "description": "503 code 5030: the service the route needs is not built on this router", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "LeverageWouldBreach": { "description": "409 code 4090: the leverage change would need more initial margin than the account holds (data.wouldBreach true and the figures after); repeat with force true to apply it anyway", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeverageWouldBreach" } } } }
    },
    "schemas": {
      "Error": {
        "type": "object", "required": [ "code", "msg", "error" ],
        "properties": { "code": { "type": "integer", "description": "The stable four-digit code" }, "msg": { "type": "string", "description": "A sentence a person can read" }, "error": { "type": "string", "description": "The same sentence (older readers)" }, "data": { "type": "object", "description": "Machine facts when there are any (data.error carries RELIANCE_NOT_APPROVED or PARTNER_SUSPENDED, data.retakeAt the retake time, data.currentVersion the current test version, data.report the REFUSED collateral report, data.item the settlement item on a report conflict)", "additionalProperties": true } }
      },
      "ValidationError": {
        "type": "object", "required": [ "code", "msg", "error", "data" ],
        "properties": { "code": { "type": "integer", "const": 4000 }, "msg": { "type": "string" }, "error": { "type": "string" }, "data": { "type": "object", "properties": { "errors": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Dotted field path to one sentence, e.g. kyc.personalInfo.address.country, kyc.taxResidency.tax_residencies.0.tin, identityCheck.verifiedAt, attestation.screening.sanctionsClear, mifid.employmentFinancial.employer_name" } } } }
      },
      "GateError": {
        "type": "object", "required": [ "code", "msg", "error", "data" ],
        "properties": { "code": { "type": "integer", "const": 4030 }, "msg": { "type": "string" }, "error": { "type": "string" }, "data": { "type": "object", "properties": { "action": { "type": "string", "description": "TRADE:PERP, TRADE:SPOT, TRADE:BARRIER, TRADE:STAKING, DEPOSIT:CRYPTO, WITHDRAW:CRYPTO" }, "level": { "type": "string" }, "requiredLevel": { "type": "string" }, "missingBlocks": { "type": "array", "items": { "type": "string" } } } } }
      },
      "Me": {
        "type": "object",
        "properties": {
          "partner": { "type": "object", "properties": { "partnerId": { "type": "integer", "format": "int64" }, "code": { "type": "string" }, "name": { "type": "string" }, "legalName": { "type": "string" }, "country": { "type": "string" }, "licenceType": { "type": "string", "enum": [ "MICA_CASP", "MIFID_IF", "EMI", "CREDIT_INSTITUTION", "OTHER" ] }, "relianceStatus": { "type": "string", "enum": [ "NONE", "REQUESTED", "APPROVED", "SUSPENDED", "REVOKED" ] }, "status": { "type": "string", "enum": [ "ACTIVE", "SUSPENDED", "CLOSED" ] }, "sandbox": { "type": "boolean" }, "custodyModel": { "type": "string", "enum": [ "BROKER", "PARTNER" ], "description": "BROKER: client money with us, confirmed by our finance desk; PARTNER: the partner holds it as a USD stablecoin valued 1:1 to USDC and reports collateral movements" }, "collateralAsset": { "type": "string", "description": "The partner's stablecoin name under PARTNER custody, else empty" }, "limits": { "type": "object", "properties": { "readPerMinute": { "type": "integer" }, "tradePerMinute": { "type": "integer" } } }, "allowedCidrs": { "type": "array", "items": { "type": "string" } } } },
          "key": { "type": "object", "properties": { "keyId": { "type": "integer", "format": "int64" }, "label": { "type": "string" }, "prefix": { "type": "string" }, "scope": { "type": "string", "enum": [ "READ", "TRADE" ] }, "createdAt": { "type": "integer", "format": "int64" }, "lastUsedAt": { "type": [ "integer", "null" ], "format": "int64" } } },
          "webhook": { "type": [ "object", "null" ], "properties": { "url": { "type": "string" }, "active": { "type": "boolean" } } },
          "asOf": { "type": "integer", "format": "int64" }
        }
      },
      "ClientRow": {
        "type": "object",
        "properties": { "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string", "description": "BARR-00000412" }, "partnerClientRef": { "type": "string" }, "email": { "type": "string" }, "displayName": { "type": "string" }, "verificationLevel": { "type": "string", "enum": [ "NONE", "MICA", "MICA_MIFID" ] }, "lifecycleState": { "type": "string" }, "categorization": { "type": "string" }, "riskState": { "type": [ "string", "null" ] }, "cashUsdc": { "type": "string" }, "createdAt": { "type": "integer", "format": "int64" } }
      },
      "ClientsPage": { "type": "object", "properties": { "clients": { "type": "array", "items": { "$ref": "#/components/schemas/ClientRow" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } },
      "Summary": {
        "type": "object",
        "properties": { "asOf": { "type": "integer", "format": "int64" }, "clients": { "type": "object", "properties": { "total": { "type": "integer" }, "byState": { "type": "object", "additionalProperties": { "type": "integer" } }, "byLevel": { "type": "object", "additionalProperties": { "type": "integer" } } } }, "clientCash": { "type": "array", "items": { "type": "object", "properties": { "currency": { "type": "string" }, "cash": { "type": "string" }, "reserved": { "type": "string" }, "total": { "type": "string" } } } }, "openBarriers": { "type": "integer" }, "openSwaps": { "type": "integer" }, "pendingDeposits": { "type": "integer" }, "pendingWithdrawals": { "type": "integer" }, "pendingReviews": { "type": "integer", "description": "Packages in SPOT_CHECK or DOCUMENTS_REQUESTED" } }
      },
      "OnboardRequest": {
        "type": "object", "required": [ "partnerClientRef", "email", "kyc", "identityCheck", "attestation" ],
        "properties": {
          "partnerClientRef": { "type": "string", "minLength": 1, "maxLength": 64, "description": "Your own client reference, unique per partner" },
          "email": { "type": "string", "format": "email" },
          "clientType": { "type": "string", "enum": [ "NATURAL" ], "default": "NATURAL" },
          "categorization": { "type": "string", "enum": [ "RETAIL" ], "default": "RETAIL" },
          "residencyCountry": { "type": "string", "description": "ISO alpha-2; defaults to kyc.personalInfo.address.country; blocked jurisdictions refused" },
          "kyc": { "$ref": "#/components/schemas/KycSections" },
          "identityCheck": { "$ref": "#/components/schemas/IdentityCheck" },
          "attestation": { "$ref": "#/components/schemas/Attestation" }
        }
      },
      "KycSections": {
        "type": "object", "description": "The six MiCA blocks in the onboarding wizard's own shapes (snake_case). All six are required on POST /clients; on PUT .../kyc only the sections present are re-written.",
        "properties": {
          "personalInfo": { "$ref": "#/components/schemas/PersonalInfo" },
          "identification": { "$ref": "#/components/schemas/Identification" },
          "taxResidency": { "$ref": "#/components/schemas/TaxResidency" },
          "fatca": { "$ref": "#/components/schemas/Fatca" },
          "pep": { "$ref": "#/components/schemas/Pep" },
          "declarationsMica": { "$ref": "#/components/schemas/DeclarationsMica" }
        }
      },
      "PersonalInfo": {
        "type": "object", "required": [ "first_name", "last_name", "date_of_birth", "country_of_birth", "citizenships", "phone_country_code", "phone_number", "address" ],
        "properties": {
          "first_name": { "type": "string", "maxLength": 50 }, "middle_name": { "type": "string", "maxLength": 50 }, "last_name": { "type": "string", "maxLength": 50 },
          "date_of_birth": { "type": "string", "format": "date", "description": "YYYY-MM-DD, year 1900 or later, at least 18 years old" },
          "country_of_birth": { "type": "string", "description": "ISO alpha-2" },
          "citizenships": { "type": "array", "minItems": 1, "items": { "type": "string" }, "description": "ISO alpha-2, no duplicates" },
          "phone_country_code": { "type": "string", "pattern": "^\\+[0-9]{1,4}$" },
          "phone_number": { "type": "string", "pattern": "^[0-9]{4,15}$" },
          "address": { "type": "object", "required": [ "country", "street_name", "city", "postal_code" ], "properties": { "country": { "type": "string", "description": "ISO alpha-2, not a blocked jurisdiction (default list US, KP, IR, MM, SY, CU, RU, UA)" }, "street_name": { "type": "string", "maxLength": 150 }, "number": { "type": "string", "maxLength": 20 }, "city": { "type": "string", "maxLength": 50 }, "state": { "type": "string", "maxLength": 50 }, "postal_code": { "type": "string", "maxLength": 20 } } },
          "utility_bill_document_id": { "type": [ "integer", "string", "null" ], "description": "A document id of this client (proof of address); optional under reliance" }
        }
      },
      "Identification": {
        "type": "object", "required": [ "type", "country_of_issuance", "number", "expiration_date" ],
        "properties": { "type": { "type": "string", "enum": [ "passport", "national_id", "drivers_license", "residence_permit" ] }, "country_of_issuance": { "type": "string" }, "number": { "type": "string", "maxLength": 50 }, "expiration_date": { "type": "string", "format": "date", "description": "After today, year 2100 or earlier" }, "document_ids": { "type": "array", "items": { "type": [ "integer", "string" ] }, "description": "Document ids of this client" } }
      },
      "TaxResidency": {
        "type": "object", "required": [ "tax_residencies" ],
        "properties": { "tax_residencies": { "type": "array", "minItems": 1, "items": { "type": "object", "required": [ "country", "has_tin" ], "properties": { "country": { "type": "string", "description": "ISO alpha-2, no country twice" }, "has_tin": { "type": "boolean" }, "tin": { "type": "string", "description": "Required when has_tin: 5 to 20 letters and digits once spaces and dashes are removed" }, "no_tin_reasons": { "type": "array", "items": { "type": "string", "enum": [ "not_issued", "not_required", "pending", "other" ] }, "description": "Required when has_tin is false" }, "no_tin_reason_other": { "type": "string", "maxLength": 200, "description": "Required when the reasons contain other" } } } } }
      },
      "Fatca": {
        "type": "object", "required": [ "us_person_status" ],
        "properties": { "us_person_status": { "type": "boolean" }, "ssn_itin": { "type": "string", "description": "Required when true: a 9-digit SSN, ITIN or EIN in a valid structural shape" }, "w9_document_id": { "type": [ "integer", "string", "null" ], "description": "The W-9 document id; optional under reliance" } }
      },
      "PepFunction": {
        "type": "object", "required": [ "position", "country", "institution", "start_date" ],
        "properties": { "position": { "type": "string", "enum": [ "head_of_state", "head_of_government", "minister", "deputy_or_assistant_minister", "member_of_parliament", "party_governing_body_member", "high_judicial_body_member", "auditors_or_central_bank_board", "ambassador_or_charge_daffaires", "high_ranking_armed_forces_officer", "state_owned_enterprise_body_member", "international_organisation_director", "mayor" ] }, "country": { "type": "string" }, "institution": { "type": "string", "maxLength": 100 }, "start_date": { "type": "string", "format": "date", "description": "1900 or later, not in the future" }, "end_date": { "type": "string", "format": "date", "description": "Optional, not before the start" } }
      },
      "Pep": {
        "type": "object", "required": [ "is_pep", "has_associations" ],
        "properties": {
          "is_pep": { "type": "boolean" },
          "details": { "$ref": "#/components/schemas/PepFunction" },
          "has_associations": { "type": "boolean" },
          "associations": { "type": "array", "minItems": 1, "description": "Required when has_associations", "items": { "allOf": [ { "$ref": "#/components/schemas/PepFunction" }, { "type": "object", "required": [ "full_name", "dob", "nationality", "address", "relationship" ], "properties": { "full_name": { "type": "string", "maxLength": 100 }, "dob": { "type": "string", "format": "date", "description": "At least 18" }, "nationality": { "type": "string" }, "address": { "type": "string", "maxLength": 200 }, "relationship": { "type": "string", "enum": [ "spouse", "child", "son_daughter_in_law", "parent", "joint_beneficial_ownership", "other_close_business_relations", "sole_beneficial_ownership" ] } } } ] } }
        }
      },
      "DeclarationsMica": {
        "type": "object", "description": "Fourteen booleans, every one true; acceptedAt (Unix ms) is stored as received",
        "required": [ "fatca_crs_accurate", "fatca_crs_responsible", "fatca_crs_notify_changes", "fatca_crs_disclosure", "fatca_crs_consequences", "accept_legal_docs", "accuracy_of_info", "market_conduct", "aml_compliance", "recording_consent", "data_protection", "notify_changes", "cooperate_authorities", "authorised_client" ],
        "properties": { "fatca_crs_accurate": { "type": "boolean", "const": true }, "fatca_crs_responsible": { "type": "boolean", "const": true }, "fatca_crs_notify_changes": { "type": "boolean", "const": true }, "fatca_crs_disclosure": { "type": "boolean", "const": true }, "fatca_crs_consequences": { "type": "boolean", "const": true }, "accept_legal_docs": { "type": "boolean", "const": true }, "accuracy_of_info": { "type": "boolean", "const": true }, "market_conduct": { "type": "boolean", "const": true }, "aml_compliance": { "type": "boolean", "const": true }, "recording_consent": { "type": "boolean", "const": true }, "data_protection": { "type": "boolean", "const": true }, "notify_changes": { "type": "boolean", "const": true }, "cooperate_authorities": { "type": "boolean", "const": true }, "authorised_client": { "type": "boolean", "const": true }, "acceptedAt": { "type": "integer", "format": "int64" } }
      },
      "IdentityCheck": {
        "type": "object", "required": [ "provider", "method", "verifiedAt" ],
        "properties": { "provider": { "type": "string", "enum": [ "ondato", "sumsub", "manual", "other" ] }, "reference": { "type": "string", "maxLength": 200 }, "method": { "type": "string", "enum": [ "video", "nfc", "document", "in_person" ] }, "verifiedAt": { "type": "integer", "format": "int64", "description": "Unix ms, not in the future, no older than 12 months" }, "documentType": { "type": "string", "maxLength": 40 }, "documentCountry": { "type": "string" }, "documentExpiry": { "type": "string", "format": "date", "description": "After today" } }
      },
      "Attestation": {
        "type": "object", "required": [ "cddPerformedAt", "cddStandard", "screening", "riskRating", "attestedBy", "documentsAvailableOnRequest" ],
        "properties": {
          "cddPerformedAt": { "type": "integer", "format": "int64" },
          "cddStandard": { "type": "string", "maxLength": 64, "description": "MICA_CASP_CDD, MIFID_IF_CDD, EMI_CDD, CREDIT_INSTITUTION_CDD or OTHER (any label up to 64 characters is accepted)" },
          "screening": { "type": "object", "required": [ "sanctionsClear", "pepChecked", "adverseMediaChecked", "screenedAt" ], "properties": { "sanctionsClear": { "type": "boolean", "const": true }, "pepChecked": { "type": "boolean" }, "adverseMediaChecked": { "type": "boolean" }, "screenedAt": { "type": "integer", "format": "int64" }, "provider": { "type": "string", "maxLength": 100 } } },
          "riskRating": { "type": "string", "enum": [ "LOW", "MEDIUM", "HIGH" ] },
          "attestedBy": { "type": "string", "maxLength": 200 },
          "documentsAvailableOnRequest": { "type": "boolean", "const": true }
        }
      },
      "Requirements": { "type": "object", "description": "Action to the block codes the client still lacks (empty = open)", "additionalProperties": { "type": "array", "items": { "type": "string" } } },
      "OnboardResult": {
        "type": "object",
        "properties": { "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string" }, "partnerClientRef": { "type": "string" }, "verificationLevel": { "type": "string" }, "lifecycleState": { "type": "string" }, "status": { "type": "string", "enum": [ "ACTIVE", "PENDING_REVIEW" ] }, "kycPackageId": { "type": "integer", "format": "int64" }, "requirements": { "$ref": "#/components/schemas/Requirements" }, "review": { "type": [ "object", "null" ], "properties": { "reason": { "type": "string" }, "caseId": { "type": "integer", "format": "int64" } } } }
      },
      "KycUpdateRequest": {
        "type": "object", "required": [ "kyc", "attestation" ],
        "properties": { "kyc": { "$ref": "#/components/schemas/KycSections" }, "attestation": { "$ref": "#/components/schemas/Attestation" }, "identityCheck": { "$ref": "#/components/schemas/IdentityCheck" } }
      },
      "KycUpdateResult": {
        "type": "object",
        "properties": { "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string" }, "partnerClientRef": { "type": "string" }, "kycPackageId": { "type": "integer", "format": "int64" }, "revision": { "type": "integer" }, "status": { "type": "string", "enum": [ "ACCEPTED", "SPOT_CHECK", "DOCUMENTS_REQUESTED", "REJECTED" ] }, "verificationLevel": { "type": "string" }, "lifecycleState": { "type": "string" }, "identityChanged": { "type": "boolean" }, "screening": { "type": "string", "enum": [ "NOT_RUN", "CLEAR", "PENDING_REVIEW" ] },
          "reonboarded": { "type": "boolean", "description": "Present and true only on the re-onboarding after a REJECTED package (revision 3): the full reliance grant ran again" },
          "grant": { "type": "string", "enum": [ "ACTIVE", "PENDING_REVIEW" ], "description": "Re-onboarding only: the outcome of the grant (ACTIVE = level MICA, client.onboarded fired; PENDING_REVIEW = held for our compliance, client.review_required fired)" },
          "review": { "type": [ "object", "null" ], "description": "Re-onboarding only: the review facts on PENDING_REVIEW", "properties": { "reason": { "type": "string" }, "caseId": { "type": "integer", "format": "int64" } } },
          "requirements": { "$ref": "#/components/schemas/Requirements", "description": "Re-onboarding only" } }
      },
      "KycPackage": {
        "type": "object",
        "properties": { "kycPackageId": { "type": "integer", "format": "int64" }, "partnerId": { "type": "integer", "format": "int64" }, "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string" }, "revision": { "type": "integer" }, "status": { "type": "string", "enum": [ "ACCEPTED", "SPOT_CHECK", "DOCUMENTS_REQUESTED", "REJECTED" ] }, "receivedAt": { "type": "integer", "format": "int64" }, "payload": { "$ref": "#/components/schemas/KycSections" }, "attestation": { "$ref": "#/components/schemas/Attestation" }, "reviewedBy": { "type": [ "string", "null" ], "description": "The reviewer's ROLE label (COMPLIANCE, ADMIN, SYSTEM for the automatic spot check, PARTNER), never a person's name" }, "reviewedAt": { "type": [ "integer", "null" ], "format": "int64" }, "reviewNote": { "type": [ "string", "null" ], "description": "Answered when REJECTED or DOCUMENTS_REQUESTED" } }
      },
      "DocumentUpload": {
        "type": "object", "required": [ "dataBase64", "purpose" ],
        "properties": { "name": { "type": "string" }, "contentType": { "type": "string", "description": "Informational; the content is sniffed (JPEG, PNG or PDF)" }, "dataBase64": { "type": "string", "description": "The file content, base64, at most 8 MB decoded" }, "purpose": { "type": "string", "enum": [ "identity", "address", "w9", "other" ] } }
      },
      "DocumentUploadResult": { "type": "object", "properties": { "documentId": { "type": "integer", "format": "int64" }, "type": { "type": "string" }, "purpose": { "type": "string" }, "filename": { "type": "string" }, "mimeType": { "type": "string" }, "sizeBytes": { "type": "integer" }, "uploadedAt": { "type": "integer", "format": "int64" }, "source": { "type": "string", "const": "PARTNER" } } },
      "Document": { "type": "object", "properties": { "documentId": { "type": "integer", "format": "int64" }, "type": { "type": "string" }, "side": { "type": [ "string", "null" ] }, "filename": { "type": "string" }, "mimeType": { "type": "string" }, "sizeBytes": { "type": "integer" }, "uploadedAt": { "type": "integer", "format": "int64" }, "deletedAt": { "type": [ "integer", "null" ], "format": "int64" }, "source": { "type": "string", "enum": [ "CLIENT", "ONDATO", "PARTNER" ] } } },
      "AppropriatenessTest": {
        "type": "object",
        "properties": { "version": { "type": "integer" }, "questions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "text": { "type": "string" }, "section": { "type": [ "string", "null" ] }, "options": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "text": { "type": "string" } } } } } } }, "sections": { "type": [ "array", "null" ], "items": { "type": "object", "additionalProperties": true } }, "warningText": { "type": "string" }, "acknowledgeText": { "type": "string" } }
      },
      "AppropriatenessAnswers": { "type": "object", "required": [ "answers" ], "properties": { "version": { "type": "integer", "description": "The version rendered; a stale one answers 409 code 4092 with data.currentVersion" }, "answers": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Question id to option id, every question answered" } } },
      "AppropriatenessResult": { "type": "object", "properties": { "version": { "type": "integer" }, "outcome": { "type": "string", "enum": [ "PASS", "WARN", "FAIL" ] }, "score": { "type": "integer" }, "requiresAcknowledgement": { "type": "boolean" }, "retakeAt": { "type": [ "integer", "null" ], "format": "int64" }, "attempt": { "type": "integer" }, "verificationLevel": { "type": "string" }, "granted": { "type": "boolean", "description": "True when this call moved the level to MICA_MIFID" } } },
      "AcknowledgeRequest": { "type": "object", "required": [ "acknowledgedAt" ], "properties": { "acknowledgedAt": { "type": "integer", "format": "int64", "description": "Unix ms when the warning was shown and accepted, not in the future" } } },
      "AcknowledgeResult": { "type": "object", "properties": { "acknowledgedAt": { "type": "integer", "format": "int64", "description": "Our server time" }, "attestedAt": { "type": "integer", "format": "int64" }, "outcome": { "type": "string", "const": "WARN" }, "verificationLevel": { "type": "string" }, "granted": { "type": "boolean" } } },
      "MifidRequest": {
        "type": "object", "required": [ "accountPurpose", "employmentFinancial", "sourceOfWealth", "declarationsMifid" ],
        "properties": {
          "accountPurpose": { "type": "object", "required": [ "primary_purpose" ], "properties": { "primary_purpose": { "type": "string", "enum": [ "long_term_investment", "short_term_speculation", "hedging", "income_generation", "portfolio_diversification", "professional_trading", "other" ] }, "primary_purpose_other": { "type": "string", "maxLength": 200 } } },
          "employmentFinancial": { "type": "object", "required": [ "employment_status", "annual_income", "net_worth", "expected_deposit_12m" ], "properties": { "employment_status": { "type": "string", "enum": [ "employed_full_time", "employed_part_time", "self_employed", "unemployed", "retired", "student", "homemaker", "other" ] }, "employment_status_other": { "type": "string", "maxLength": 100 }, "industry": { "type": "string", "enum": [ "agriculture_forestry", "automotive", "banking_financial", "construction_real_estate", "consulting", "defense_aerospace", "education", "energy_utilities", "entertainment_media", "government_public", "healthcare_pharma", "hospitality_tourism", "information_technology", "insurance", "legal_services", "manufacturing", "mining_metals", "non_profit", "retail_consumer", "shipping_logistics", "telecommunications", "transportation", "other" ], "description": "Required for the employed statuses" }, "industry_other": { "type": "string", "maxLength": 100 }, "position": { "type": "string", "enum": [ "entry_level", "mid_level", "senior", "manager", "director", "vice_president", "c_suite", "board_member", "owner_founder", "other" ], "description": "Required for the employed statuses" }, "position_other": { "type": "string", "maxLength": 100 }, "employer_name": { "type": "string", "maxLength": 100, "description": "Required for the employed statuses" }, "annual_income": { "type": "string", "enum": [ "lt_10k", "10k_25k", "25k_50k", "50k_100k", "100k_250k", "250k_500k", "500k_1m", "gt_1m" ] }, "net_worth": { "type": "string", "enum": [ "lt_50k", "50k_100k", "100k_250k", "250k_500k", "500k_1m", "1m_5m", "gt_5m" ] }, "expected_deposit_12m": { "type": "string", "enum": [ "lt_5k", "5k_10k", "10k_25k", "25k_50k", "50k_100k", "100k_500k", "gt_500k" ] } } },
          "sourceOfWealth": { "type": "object", "required": [ "income_sources", "funds_sources", "wealth_sources" ], "properties": { "income_sources": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": [ "employment_salary", "business_income", "investments", "trust_income", "rental_income", "pension_retirement", "government_benefits", "family_support", "other" ] } }, "income_source_other": { "type": "string", "maxLength": 200 }, "funds_sources": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": [ "employment_salary", "business_income", "investments", "trust_income", "rental_income", "pension_retirement", "government_benefits", "family_support", "inheritance_gift", "savings", "property_sale", "business_sale", "insurance_payout", "legal_settlement", "other" ] } }, "funds_source_other": { "type": "string", "maxLength": 200 }, "wealth_sources": { "type": "array", "minItems": 1, "items": { "type": "string", "enum": [ "employment_income", "business_profits", "investment_returns", "property_ownership", "inheritance", "family_wealth", "sale_of_assets", "legal_settlement", "other" ] } }, "wealth_source_other": { "type": "string", "maxLength": 200 } } },
          "declarationsMifid": { "type": "object", "required": [ "order_execution_policy_consent", "complex_products_risk_acknowledged", "client_categorisation_notice_acknowledged" ], "properties": { "order_execution_policy_consent": { "type": "boolean", "const": true }, "complex_products_risk_acknowledged": { "type": "boolean", "const": true }, "client_categorisation_notice_acknowledged": { "type": "boolean", "const": true } } }
        }
      },
      "AppropriatenessState": { "type": "object", "properties": { "version": { "type": [ "integer", "null" ] }, "outcome": { "type": [ "string", "null" ] }, "score": { "type": [ "integer", "null" ] }, "takenAt": { "type": [ "integer", "null" ], "format": "int64" }, "acknowledgedAt": { "type": [ "integer", "null" ], "format": "int64" }, "retakeAt": { "type": [ "integer", "null" ], "format": "int64" }, "requiresAcknowledgement": { "type": "boolean" }, "attempt": { "type": "integer" } } },
      "MifidResult": { "type": "object", "properties": { "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string" }, "verificationLevel": { "type": "string" }, "lifecycleState": { "type": "string" }, "granted": { "type": "boolean" }, "appropriateness": { "$ref": "#/components/schemas/AppropriatenessState" }, "requirements": { "$ref": "#/components/schemas/Requirements" } } },
      "VerificationView": {
        "type": "object",
        "properties": { "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string" }, "partnerClientRef": { "type": "string" }, "level": { "type": "string" }, "lifecycleState": { "type": "string" }, "blocks": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "level": { "type": "string" }, "status": { "type": "string", "enum": [ "NOT_STARTED", "DRAFT", "SUBMITTED", "APPROVED", "REJECTED", "EXPIRED" ] }, "decidedBy": { "type": [ "string", "null" ], "description": "The decider's ROLE label: PARTNER (the partner's own attestation), SYSTEM, or the role of our employee (COMPLIANCE, ADMIN, ...); never a person's name" }, "decidedAt": { "type": [ "integer", "null" ], "format": "int64" }, "reason": { "type": [ "string", "null" ] }, "updatedAt": { "type": [ "integer", "null" ], "format": "int64" } } } }, "requirements": { "$ref": "#/components/schemas/Requirements" }, "appropriateness": { "$ref": "#/components/schemas/AppropriatenessState" }, "kycPackage": { "type": [ "object", "null" ], "properties": { "kycPackageId": { "type": "integer", "format": "int64" }, "revision": { "type": "integer" }, "status": { "type": "string" }, "reviewNote": { "type": [ "string", "null" ] } } } }
      },
      "Instruments": { "type": "object", "properties": { "instruments": { "type": "array", "items": { "type": "object", "properties": { "symbol": { "type": "string" }, "family": { "type": "string", "enum": [ "PERP", "SPOT", "BARRIER", "STAKING" ] }, "displayName": { "type": "string" }, "assetClass": { "type": "string" } } } } } },
      "TickerRow": { "type": "object", "properties": { "symbol": { "type": "string" }, "lastPrice": { "type": "string" }, "markPrice": { "type": "string" }, "indexPrice": { "type": "string" }, "bestBid": { "type": "string" }, "bestAsk": { "type": "string" }, "volume24h": { "type": "string" }, "openInterest": { "type": "string" }, "fundingRate": { "type": "string" }, "fundingRatePct": { "type": "string" }, "predictedFundingRate": { "type": "string" }, "nextFundingTs": { "type": [ "integer", "null" ], "format": "int64" } }, "additionalProperties": true },
      "Ticker": { "type": "object", "properties": { "code": { "type": "integer" }, "msg": { "type": "string" }, "data": { "$ref": "#/components/schemas/TickerRow" }, "asOfSeq": { "type": "integer" }, "ts": { "type": "integer", "format": "int64" } } },
      "Tickers": { "type": "object", "properties": { "asOf": { "type": "integer", "format": "int64" }, "tickers": { "type": "array", "items": { "allOf": [ { "$ref": "#/components/schemas/TickerRow" }, { "type": "object", "properties": { "family": { "type": "string" }, "displayName": { "type": "string" }, "assetClass": { "type": "string" }, "change24h": { "type": "string" }, "change24hPct": { "type": "string" }, "high24h": { "type": "string" }, "low24h": { "type": "string" }, "quoteVolume24h": { "type": "string" } } } ] } } } },
      "Klines": { "type": "object", "properties": { "code": { "type": "integer", "const": 0 }, "data": { "type": "object", "properties": { "symbol": { "type": "string" }, "interval": { "type": "string" }, "intervalMs": { "type": "integer" }, "klines": { "type": "array", "items": { "type": "object", "properties": { "t": { "type": "integer", "format": "int64" }, "open": { "type": "string" }, "high": { "type": "string" }, "low": { "type": "string" }, "close": { "type": "string" }, "volume": { "type": "string" }, "trades": { "type": "integer" }, "partial": { "type": "boolean" } } } }, "hasMore": { "type": "boolean" }, "oldestAvailable": { "type": [ "integer", "null" ], "format": "int64" }, "asOf": { "type": "integer", "format": "int64" } }, "additionalProperties": true } } },
      "OrderBook": { "type": "object", "properties": { "symbol": { "type": "string" }, "bids": { "type": "array", "items": { "type": "array", "items": { "type": "string" }, "minItems": 2, "maxItems": 2 } }, "asks": { "type": "array", "items": { "type": "array", "items": { "type": "string" }, "minItems": 2, "maxItems": 2 } }, "checksum": { "type": "integer" }, "asOfSeq": { "type": "integer" }, "ts": { "type": "integer", "format": "int64" } } },
      "MarketTrades": { "type": "object", "properties": { "symbol": { "type": "string" }, "trades": { "type": "array", "items": { "type": "object", "properties": { "tradeId": { "type": "integer", "format": "int64" }, "price": { "type": "string" }, "qty": { "type": "string" }, "side": { "type": "string" }, "flags": { "type": "string" }, "ts": { "type": "integer", "format": "int64" } } } }, "asOfSeq": { "type": "integer" }, "ts": { "type": "integer", "format": "int64" } } },
      "IndexPrice": { "type": "object", "properties": { "symbol": { "type": "string" }, "indexPrice": { "type": "string" }, "ts": { "type": "integer", "format": "int64" } } },
      "FundingSchedule": { "type": "object", "properties": { "schedule": { "type": "string", "enum": [ "GRID", "LOCAL_DAILY" ] }, "intervalHours": { "type": [ "integer", "null" ] }, "zone": { "type": [ "string", "null" ] }, "snapshotLocalTime": { "type": [ "string", "null" ] }, "vwapWindow": { "type": [ "string", "null" ] }, "vwapSnapshots": { "type": [ "integer", "null" ] }, "nextSettlementTs": { "type": [ "integer", "null" ], "format": "int64" }, "nextSnapshotTs": { "type": [ "integer", "null" ], "format": "int64" } } },
      "Funding": { "type": "object", "properties": { "symbol": { "type": "string" }, "fundingRate": { "type": "string" }, "fundingRatePct": { "type": "string" }, "predictedFundingRate": { "type": "string" }, "predictedFundingRatePct": { "type": "string" }, "fundingRateAnnualizedPct": { "type": "string" }, "fundingIntervalHours": { "type": [ "integer", "null" ] }, "settleCcy": { "type": "string" }, "nextFundingTs": { "type": [ "integer", "null" ], "format": "int64" }, "funding": { "$ref": "#/components/schemas/FundingSchedule" } } },
      "MarketInfo": { "type": "object", "description": "The market specification: grids, limits, the funding schedule, risk tiers, the leverage schedule, the barrier parameters (knockOutRebateBps, strictTakeProfitPremiumBps, strictTakeProfitOffered, barrierPremiumBps), the spot facts, the commission and the venue fees", "properties": { "symbol": { "type": "string" }, "family": { "type": "string" }, "displayName": { "type": "string" }, "assetClass": { "type": "string" }, "enabled": { "type": "boolean" }, "baseAsset": { "type": "string" }, "quoteAsset": { "type": "string" }, "settlementCcy": { "type": "string" }, "tickSize": { "type": "string" }, "lotSize": { "type": "string" }, "qtyStep": { "type": "string" }, "minQty": { "type": "string" }, "minNotional": { "type": "string" }, "contractMultiplier": { "type": "string" }, "maxOrderNotional": { "type": [ "string", "null" ] }, "maxPositionNotional": { "type": [ "string", "null" ] }, "priceBandBps": { "type": [ "integer", "null" ] }, "marketMaxSlippageBps": { "type": [ "integer", "null" ] }, "fundingIntervalHours": { "type": [ "integer", "null" ] }, "funding": { "$ref": "#/components/schemas/FundingSchedule" }, "venueStatus": { "type": "string" }, "venueKind": { "type": "string" }, "venueMode": { "type": "string" }, "riskTiers": { "type": "array", "items": { "type": "object", "properties": { "notionalCap": { "type": "string" }, "imRate": { "type": "string" }, "mmRate": { "type": "string" } } } }, "leverageCap": { "type": [ "integer", "null" ] }, "leverageSchedule": { "type": "array", "items": { "type": "object", "properties": { "categorization": { "type": "string" }, "maxLeverage": { "type": "integer" } } } }, "barrierMaxLeverage": { "type": [ "string", "null" ] }, "knockOutRebateBps": { "type": [ "integer", "null" ] }, "strictTakeProfitPremiumBps": { "type": [ "integer", "null" ] }, "strictTakeProfitOffered": { "type": [ "boolean", "null" ] }, "barrierPremiumBps": { "type": [ "integer", "null" ] }, "spot": { "type": [ "object", "null" ], "additionalProperties": true }, "feeModel": { "type": "string" }, "commissionBps": { "type": "integer" }, "commissionMin": { "type": "string" }, "commissionCurrency": { "type": "string" }, "venueFees": { "type": "object", "properties": { "makerFeeRate": { "type": "string" }, "takerFeeRate": { "type": "string" }, "chargedTo": { "type": "string" } } } }, "additionalProperties": true },
      "TradingStatus": { "type": "object", "properties": { "asOf": { "type": "integer", "format": "int64" }, "halted": { "type": "boolean" }, "halts": { "type": "array", "items": { "type": "object", "properties": { "scope": { "type": "string", "description": "A family or * for everything" }, "since": { "type": "integer", "format": "int64" }, "until": { "type": [ "integer", "null" ], "format": "int64" }, "message": { "type": "string" } } } } } },
      "Currencies": { "type": "object", "properties": { "cash": { "type": "string", "const": "USDC" }, "currencies": { "type": "array", "items": { "type": "object", "properties": { "code": { "type": "string" }, "kind": { "type": "string", "enum": [ "CASH", "ASSET" ] }, "venueAsset": { "type": "string" }, "displayDecimals": { "type": "integer" }, "scale": { "type": "integer" } } } } } },
      "StakingMarkets": { "type": "object", "properties": { "markets": { "type": "array", "items": { "type": "object", "properties": { "symbol": { "type": "string" }, "name": { "type": "string" }, "asset": { "type": "string" }, "venueAsset": { "type": "string" }, "enabled": { "type": "boolean" }, "minTenorDays": { "type": "integer" }, "maxTenorDays": { "type": "integer" }, "maxRateBps": { "type": "integer" }, "maxRatePct": { "type": "string" }, "minQty": { "type": "string" }, "qtyStep": { "type": "string" }, "maxQty": { "type": "string" }, "takerFeeRate": { "type": "string" }, "displayDecimals": { "type": "integer" }, "commissionRewardBps": { "type": "string" }, "family": { "type": "string", "const": "STAKING" } }, "additionalProperties": true } }, "disclosure": { "type": "string", "description": "The unsecured-writer disclosure; show it to the client" }, "commissionRewardBps": { "type": "string" } } },
      "StakingOffers": { "type": "object", "properties": { "offers": { "type": "array", "items": { "type": "object", "properties": { "offerId": { "type": "integer", "format": "int64" }, "symbol": { "type": "string" }, "name": { "type": "string" }, "asset": { "type": "string" }, "venueAsset": { "type": "string" }, "rateBps": { "type": "integer" }, "ratePct": { "type": "string" }, "tenorDays": { "type": "integer" }, "qty": { "type": "string" }, "remainingQty": { "type": "string" }, "minQty": { "type": "string" }, "expiryTs": { "type": "integer", "format": "int64" }, "createdTs": { "type": "integer", "format": "int64" }, "rewardPerUnit": { "type": "string" }, "commissionRewardBps": { "type": "string" } } } }, "asOf": { "type": "integer", "format": "int64" }, "stale": { "type": "boolean" }, "disclosure": { "type": "string" }, "commissionRewardBps": { "type": "string" } } },
      "Swap": { "type": "object", "properties": { "swapId": { "type": "integer", "format": "int64" }, "contractId": { "type": [ "integer", "null" ], "format": "int64" }, "tradeId": { "type": [ "integer", "null" ], "format": "int64" }, "offerId": { "type": "integer", "format": "int64" }, "symbol": { "type": "string" }, "name": { "type": "string" }, "asset": { "type": "string" }, "venueAsset": { "type": "string" }, "displayDecimals": { "type": "integer" }, "qty": { "type": "string" }, "notional": { "type": "string" }, "rateBps": { "type": "integer" }, "ratePct": { "type": "string" }, "tenorDays": { "type": "integer" }, "reward": { "type": "string" }, "fee": { "type": "string" }, "expectedPayout": { "type": "string" }, "state": { "type": "string", "enum": [ "ACCEPTING", "OPEN", "MATURED", "DEFAULTED", "CURED", "FINAL_SETTLEMENT", "REJECTED" ] }, "openedTs": { "type": [ "integer", "null" ], "format": "int64" }, "maturityTs": { "type": [ "integer", "null" ], "format": "int64" }, "closedTs": { "type": [ "integer", "null" ], "format": "int64" }, "paid": { "type": "string" }, "outstanding": { "type": "string" }, "claim": { "type": "string" }, "writtenOff": { "type": "string" }, "recovered": { "type": "string" }, "commission": { "type": "string" }, "commissionRewardBps": { "type": "string" }, "estimatedCommission": { "type": "string" }, "settleReason": { "type": [ "string", "null" ], "description": "matured, default, cured, finalSettlement" }, "rejectReason": { "type": [ "string", "null" ] }, "ts": { "type": "integer", "format": "int64" }, "createdAt": { "type": "integer", "format": "int64" } } },
      "RfqRequest": {
        "type": "object", "required": [ "symbol", "side", "qty", "barrier" ],
        "properties": {
          "symbol": { "type": "string", "description": "A barrier market, e.g. BTC-USD-KO" },
          "side": { "type": "string", "enum": [ "BUY", "SELL", "LONG", "SHORT" ], "description": "BUY = long with the knock-out below the entry, SELL = short with the knock-out above" },
          "qty": { "type": "string", "description": "Decimal string on the market's lot grid" },
          "premium": { "type": "string", "description": "The premium budget the request is sized to (optional)" },
          "barrier": { "type": "object", "required": [ "level" ], "properties": { "level": { "type": "string", "description": "The knock-out price, on the tick grid, at least 0.1 percent from the current price" }, "expiryTs": { "type": "integer", "format": "int64", "description": "Unix ms, at most 8 hours after receipt (exactly 8 h passes; beyond it 400 code 4000); omitted = the open-end contract: 12 calendar months, never rolled over" }, "takeProfit": { "type": "string", "description": "A price on the profit side of the entry; omit for a knock-out-only contract" }, "strictTakeProfit": { "type": "boolean", "default": false, "description": "Pays only on a touch of the take profit; needs takeProfit, an explicit expiryTs at most 24 h ahead and a market that offers it" } } },
          "expiresInMs": { "type": "integer", "format": "int64", "default": 60000, "description": "The quoting window, 1 s to 24 h" },
          "autoAccept": { "type": "boolean", "default": true, "description": "The router accepts the first acceptable live quote itself" }
        }
      },
      "Quote": { "type": "object", "properties": { "quoteId": { "type": "integer", "format": "int64" }, "price": { "type": "string" }, "qty": { "type": "string" }, "validUntil": { "type": "integer", "format": "int64" }, "validForMs": { "type": "integer", "format": "int64" }, "impliedMaxLoss": { "type": [ "string", "null" ] }, "impliedPremium": { "type": [ "string", "null" ] }, "impliedLeverage": { "type": [ "string", "null" ] }, "impliedPotentialProfit": { "type": [ "string", "null" ] }, "impliedPnl": { "type": [ "string", "null" ] }, "state": { "type": "string", "enum": [ "LIVE", "EXPIRED", "WITHDRAWN", "ACCEPTED", "SUPERSEDED" ] }, "premiumShareBps": { "type": "integer" }, "acceptable": { "type": "boolean" }, "notAcceptableReason": { "type": [ "string", "null" ] } } },
      "Rfq": {
        "type": "object",
        "properties": { "rfqId": { "type": "integer", "format": "int64" }, "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string" }, "venueRfqId": { "type": [ "integer", "null" ], "format": "int64" }, "clOrdId": { "type": "string" }, "symbol": { "type": "string" }, "side": { "type": "string" }, "direction": { "type": "string", "enum": [ "LONG", "SHORT" ] }, "qty": { "type": "string" }, "barrierLevel": { "type": "string" }, "takeProfit": { "type": [ "string", "null" ] }, "expiryTs": { "type": [ "integer", "null" ], "format": "int64" }, "expiryDefaulted": { "type": "boolean" }, "expiresAt": { "type": "integer", "format": "int64" }, "expiresInMs": { "type": "integer", "format": "int64" }, "state": { "type": "string", "enum": [ "OPEN", "ACCEPTED", "CANCELLED", "EXPIRED", "REJECTED" ] }, "createdAt": { "type": "integer", "format": "int64" }, "updatedAt": { "type": "integer", "format": "int64" }, "rejectReason": { "type": [ "string", "null" ] }, "accepting": { "type": "boolean" }, "autoAccept": { "type": "boolean" }, "autoAcceptNote": { "type": [ "string", "null" ] }, "closeContractId": { "type": [ "integer", "null" ], "format": "int64" }, "contractEntry": { "type": [ "string", "null" ] }, "acceptedQuoteId": { "type": [ "integer", "null" ], "format": "int64" }, "contractId": { "type": [ "integer", "null" ], "format": "int64" }, "entryPrice": { "type": [ "string", "null" ] }, "commission": { "type": "string" }, "maxLossAtRequest": { "type": "string" }, "premium": { "type": [ "string", "null" ] }, "markAtRequest": { "type": [ "string", "null" ] }, "impliedLeverage": { "type": [ "string", "null" ] }, "potentialProfit": { "type": [ "string", "null" ] }, "strictTakeProfit": { "type": "boolean" }, "premiumBps": { "type": "integer" }, "quotes": { "type": "array", "items": { "$ref": "#/components/schemas/Quote" } }, "currency": { "type": "string" } }
      },
      "RfqPreview": { "type": "object", "properties": { "accepted": { "type": "boolean" }, "reason": { "type": [ "string", "null" ] }, "symbol": { "type": "string" }, "side": { "type": "string" }, "direction": { "type": "string" }, "qty": { "type": "string" }, "barrierLevel": { "type": "string" }, "takeProfit": { "type": [ "string", "null" ] }, "mark": { "type": [ "string", "null" ] }, "maxLoss": { "type": [ "string", "null" ] }, "premium": { "type": [ "string", "null" ] }, "estimatedCommission": { "type": [ "string", "null" ] }, "requiredFreeMargin": { "type": [ "string", "null" ] }, "freeMarginBefore": { "type": [ "string", "null" ] }, "freeMarginAfter": { "type": [ "string", "null" ] }, "impliedLeverage": { "type": [ "string", "null" ] }, "potentialProfit": { "type": [ "string", "null" ] }, "maxLeverage": { "type": [ "string", "null" ] }, "expiryTs": { "type": [ "integer", "null" ], "format": "int64" }, "expiryDefaulted": { "type": "boolean" }, "strictTakeProfit": { "type": "boolean" }, "premiumBps": { "type": "integer" }, "knockOutRebateBps": { "type": [ "integer", "null" ] }, "strictTakeProfitPremiumBps": { "type": [ "integer", "null" ] }, "strictTakeProfitOffered": { "type": [ "boolean", "null" ] }, "currency": { "type": "string" } }, "additionalProperties": true },
      "RfqAcceptResult": { "type": "object", "properties": { "rfqId": { "type": "integer", "format": "int64" }, "venueRfqId": { "type": "integer", "format": "int64" }, "quoteId": { "type": "integer", "format": "int64" }, "contractId": { "type": "integer", "format": "int64" }, "tradeId": { "type": [ "integer", "null" ], "format": "int64" }, "symbol": { "type": "string" }, "side": { "type": "string" }, "direction": { "type": "string" }, "qty": { "type": "string" }, "entry": { "type": "string" }, "barrierLevel": { "type": "string" }, "takeProfit": { "type": [ "string", "null" ] }, "expiryTs": { "type": [ "integer", "null" ], "format": "int64" }, "maxLoss": { "type": "string" }, "premium": { "type": "string" }, "leverage": { "type": [ "string", "null" ] }, "potentialProfit": { "type": [ "string", "null" ] }, "commission": { "type": "string" }, "strictTakeProfit": { "type": "boolean" }, "premiumBps": { "type": "integer" }, "ts": { "type": "integer", "format": "int64" }, "currency": { "type": "string" } }, "additionalProperties": true },
      "BarrierCloseRequest": { "type": "object", "properties": { "autoAccept": { "type": "boolean", "default": true }, "expiresInMs": { "type": "integer", "format": "int64", "default": 60000 } } },
      "BarrierContract": {
        "type": "object",
        "properties": { "contractId": { "type": "integer", "format": "int64" }, "symbol": { "type": "string" }, "side": { "type": "string", "enum": [ "LONG", "SHORT" ] }, "qty": { "type": "string" }, "entry": { "type": "string" }, "barrierLevel": { "type": "string" }, "takeProfit": { "type": [ "string", "null" ] }, "expiryTs": { "type": [ "integer", "null" ], "format": "int64" }, "expiresInMs": { "type": [ "integer", "null" ], "format": "int64" }, "state": { "type": "string", "enum": [ "OPEN", "KNOCKED_OUT", "TAKE_PROFIT", "EXPIRED", "EARLY_CLOSE", "TORN_UP", "CLOSED" ] }, "openedAt": { "type": [ "integer", "null" ], "format": "int64" }, "closedAt": { "type": [ "integer", "null" ], "format": "int64" }, "settlePrice": { "type": [ "string", "null" ] }, "pnl": { "type": [ "string", "null" ] }, "mark": { "type": [ "string", "null" ] }, "markFresh": { "type": "boolean" }, "distanceAbs": { "type": [ "string", "null" ] }, "distancePct": { "type": [ "string", "null" ] }, "distanceToTpAbs": { "type": [ "string", "null" ] }, "distanceToTpPct": { "type": [ "string", "null" ] }, "unrealizedPnl": { "type": [ "string", "null" ] }, "requirement": { "type": "string" }, "maxLoss": { "type": "string" }, "premium": { "type": "string" }, "potentialProfit": { "type": [ "string", "null" ] }, "leverage": { "type": [ "string", "null" ] }, "commission": { "type": "string" }, "notional": { "type": [ "string", "null" ] }, "venueRfqId": { "type": [ "integer", "null" ], "format": "int64" }, "rfqId": { "type": [ "integer", "null" ], "format": "int64" }, "closeReason": { "type": [ "string", "null" ], "description": "knockOut, takeProfit, expiry, earlyClose, liquidation, finalSettlement" }, "closeRfqId": { "type": [ "integer", "null" ], "format": "int64" }, "strictTakeProfit": { "type": "boolean" }, "premiumBps": { "type": "integer" }, "currency": { "type": "string" } }
      },
      "PlaceOrderRequest": {
        "type": "object", "required": [ "symbol", "side", "type", "qty" ],
        "properties": {
          "symbol": { "type": "string", "description": "A PERP or SPOT market" },
          "side": { "type": "string", "enum": [ "BUY", "SELL" ] },
          "type": { "type": "string", "enum": [ "LIMIT", "MARKET", "STOP_MARKET", "STOP_LIMIT", "TAKE_PROFIT_MARKET", "TAKE_PROFIT_LIMIT" ] },
          "qty": { "type": "string" },
          "price": { "type": "string", "description": "LIMIT only, on the tick grid" },
          "tif": { "type": "string", "enum": [ "GTC", "IOC", "FOK", "POST_ONLY" ], "default": "GTC" },
          "reduceOnly": { "type": "boolean", "default": false, "description": "Not on spot markets" },
          "trigger": { "type": "object", "description": "Conditional types only", "properties": { "source": { "type": "string", "enum": [ "LAST", "MARK", "INDEX" ] }, "price": { "type": "string" }, "direction": { "type": "string", "enum": [ "AT_OR_ABOVE", "AT_OR_BELOW" ] }, "limitPrice": { "type": "string", "description": "The *_LIMIT variants only" } } },
          "attach": { "type": "object", "description": "LIMIT and MARKET parents only, at least one leg", "properties": { "takeProfit": { "$ref": "#/components/schemas/AttachLeg" }, "stopLoss": { "$ref": "#/components/schemas/AttachLeg" } } },
          "ocoGroup": { "type": "string", "pattern": "^[A-Za-z0-9:_-]{1,40}$", "description": "Conditional reduce-only orders only" },
          "leverage": { "type": "integer", "description": "The leverage hint the order was prepared at; a mismatch answers 409 code 4091" }
        }
      },
      "AttachLeg": { "type": "object", "required": [ "price" ], "properties": { "price": { "type": "string" }, "limitPrice": { "type": "string" } } },
      "PlaceOrderResult": { "type": "object", "properties": { "orderId": { "type": "integer", "format": "int64" }, "clOrdId": { "type": "string", "description": "BARR-<orderId>" }, "state": { "type": "string" } } },
      "PlaceOrderRefused": { "type": "object", "properties": { "code": { "type": "integer", "const": 4000 }, "msg": { "type": "string" }, "error": { "type": "string" }, "orderId": { "type": [ "integer", "null" ], "format": "int64" }, "clOrdId": { "type": [ "string", "null" ] }, "state": { "type": [ "string", "null" ] } } },
      "Order": {
        "type": "object",
        "properties": { "orderId": { "type": "integer", "format": "int64" }, "clOrdId": { "type": "string" }, "symbol": { "type": "string" }, "family": { "type": "string" }, "side": { "type": "string" }, "type": { "type": "string" }, "qty": { "type": "string" }, "price": { "type": [ "string", "null" ] }, "state": { "type": "string" }, "reject": { "type": [ "string", "null" ] }, "filledQty": { "type": "string" }, "createdAt": { "type": "integer", "format": "int64" }, "reduceOnly": { "type": "boolean" }, "tif": { "type": "string" }, "trigger": { "type": [ "object", "null" ], "additionalProperties": true }, "updatedAt": { "type": "integer", "format": "int64" }, "attach": { "type": [ "object", "null" ], "additionalProperties": true }, "ocoGroup": { "type": [ "string", "null" ] }, "parentOrderId": { "type": [ "integer", "null" ], "format": "int64" }, "parentClOrdId": { "type": [ "string", "null" ] }, "origin": { "type": "string" }, "note": { "type": [ "string", "null" ] }, "replacedBy": { "type": [ "string", "null" ] }, "replaces": { "type": [ "string", "null" ] }, "reservation": { "type": [ "object", "null" ], "additionalProperties": true } }
      },
      "Position": { "type": "object", "properties": { "symbol": { "type": "string" }, "netQty": { "type": "string" }, "avgEntryPrice": { "type": "string" }, "netCost": { "type": "string" }, "realizedPnl": { "type": "string" }, "updatedAt": { "type": "integer", "format": "int64" } } },
      "Trade": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "venueTradeId": { "type": [ "integer", "null" ], "format": "int64" }, "orderId": { "type": "integer", "format": "int64" }, "clOrdId": { "type": "string" }, "symbol": { "type": "string" }, "family": { "type": "string" }, "side": { "type": "string" }, "price": { "type": "string" }, "qty": { "type": "string" }, "commission": { "type": "string" }, "ts": { "type": "integer", "format": "int64" }, "realizedPnl": { "type": "string" }, "notional": { "type": [ "string", "null" ] }, "asset": { "type": [ "string", "null" ] } } },
      "PositionHistoryItem": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "orderId": { "type": "integer", "format": "int64" }, "clOrdId": { "type": "string" }, "symbol": { "type": "string" }, "side": { "type": "string" }, "qty": { "type": "string" }, "price": { "type": "string" }, "realizedPnl": { "type": "string" }, "ts": { "type": "integer", "format": "int64" } } },
      "BalanceRow": { "type": "object", "properties": { "currency": { "type": "string" }, "kind": { "type": "string", "enum": [ "CASH", "ASSET" ] }, "cash": { "type": "string" }, "reserved": { "type": "string" }, "total": { "type": "string" }, "free": { "type": "string" }, "displayDecimals": { "type": "integer" }, "venueAsset": { "type": "string" }, "equity": { "type": [ "string", "null" ] }, "unrealizedPnl": { "type": [ "string", "null" ] }, "freeMargin": { "type": [ "string", "null" ] }, "mark": { "type": [ "string", "null" ] }, "markFresh": { "type": [ "boolean", "null" ] }, "value": { "type": [ "string", "null" ] }, "valueCurrency": { "type": "string" }, "staked": { "type": "string" }, "swapClaims": { "type": "string" }, "stakedValue": { "type": [ "string", "null" ] }, "claimsValue": { "type": [ "string", "null" ] } } },
      "Balances": { "type": "object", "properties": { "balances": { "type": "array", "items": { "$ref": "#/components/schemas/BalanceRow" } }, "portfolioValue": { "type": "string" }, "portfolioCurrency": { "type": "string" }, "portfolio": { "type": "object", "properties": { "cashTotal": { "type": "string" }, "reserved": { "type": [ "string", "null" ] }, "holdingsValue": { "type": "string" }, "stakedValue": { "type": "string" }, "unrealizedPnl": { "type": "string" }, "claimsValue": { "type": "string" }, "holdingsValued": { "type": "boolean" }, "currency": { "type": "string" } } } } },
      "AccountSummary": { "type": "object", "properties": { "currency": { "type": "string" }, "realizedPnl": { "type": "string" }, "commissionPaid": { "type": "string" }, "fundingPaid": { "type": "string" }, "tradeCount": { "type": "integer" }, "since": { "type": [ "string", "null" ], "description": "ISO-8601 Z" }, "sinceTs": { "type": [ "integer", "null" ], "format": "int64" }, "realizedTotal": { "type": "string" }, "realizedByFamily": { "type": "object", "properties": { "fills": { "type": "string" }, "spot": { "type": "string" }, "barrier": { "type": "string" }, "staking": { "type": "string" } } }, "commissionByFamily": { "type": "object", "properties": { "fills": { "type": "string" }, "barrier": { "type": "string" }, "staking": { "type": "string" } } }, "counts": { "type": "object", "properties": { "fills": { "type": "integer" }, "barrierContracts": { "type": "integer" }, "swapTakes": { "type": "integer" } } } } },
      "AccountOverview": { "type": "object", "description": "The whole portfolio in one round trip: equity, cash, freeMargin, initialMargin, unrealizedPnl, barrierMargin, barrierUnrealizedPnl, marksFresh, reserved, holdings, staked, holdingsValue, stakedValue, claimsValue, holdingsValued, portfolioValue, realizedPnl, realizedPnl30d, commissionPaid, fundingPaid, realizedTotal, realizedByFamily, commissionByFamily, stakingByAsset, tradeCount, closedPositions, wins, losses, counts, allocation, verificationLevel, openCases, unreadCaseMessages, currency", "additionalProperties": true },
      "LedgerPosting": { "type": "object", "properties": { "postingId": { "type": "integer", "format": "int64" }, "txId": { "type": "integer", "format": "int64" }, "type": { "type": "string", "description": "DEPOSIT, WITHDRAWAL_RESERVE, WITHDRAWAL, WITHDRAWAL_RELEASE, COMMISSION, PNL, FUNDING, BARRIER_SETTLE, SWAP_PRINCIPAL, SWAP_SETTLE, SWAP_FEE_ADJUST, PARTNER_COLLATERAL_IN, PARTNER_COLLATERAL_OUT and the other ledger transaction types; every commission (a fill's, a barrier entry's, a staking swap's share of the reward) is a COMMISSION posting whose refs say which" }, "actor": { "type": "string" }, "reason": { "type": "string" }, "ts": { "type": "integer", "format": "int64" }, "amount": { "type": "string", "description": "Signed, from the client account's point of view" }, "currency": { "type": "string" }, "kind": { "type": "string", "enum": [ "cash", "reserved" ] }, "refs": { "type": "object", "additionalProperties": true } } },
      "NotificationsAnswer": { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "kind": { "type": "string" }, "ref": { "type": "string" }, "ts": { "type": "integer", "format": "int64" }, "event": { "type": [ "string", "null" ], "description": "The partner webhook event name the kind maps to; null when not forwarded" } } } }, "since": { "type": "integer", "format": "int64" }, "asOf": { "type": "integer", "format": "int64" } } },
      "Statement": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "clientId": { "type": "integer", "format": "int64" }, "kind": { "type": "string", "enum": [ "ACCOUNT", "COSTS", "TRANSACTIONS", "TAX", "CLIENT_ASSETS" ] }, "periodFrom": { "type": "string" }, "periodTo": { "type": "string" }, "basis": { "type": "string" }, "generatedAt": { "type": "integer", "format": "int64" }, "generatedBy": { "type": "string" }, "title": { "type": "string" }, "formats": { "type": "array", "items": { "type": "string" } }, "pdfBytes": { "type": "integer" }, "sha256": { "type": "string" }, "version": { "type": "integer" }, "supersedes": { "type": [ "integer", "null" ] }, "supersededBy": { "type": [ "integer", "null" ] }, "model": { "type": "object", "additionalProperties": true, "description": "On GET .../statements/{sid} only" } } },
      "GenerateStatementRequest": { "type": "object", "required": [ "kind" ], "properties": { "kind": { "type": "string", "enum": [ "ACCOUNT", "COSTS", "TRANSACTIONS", "TAX", "CLIENT_ASSETS" ] }, "preset": { "type": "string", "enum": [ "LAST_30_DAYS", "LAST_MONTH", "THIS_YEAR", "LAST_YEAR", "CUSTOM", "SINCE_LAST_STATEMENT", "LAST_QUARTER", "THIS_QUARTER" ] }, "from": { "type": "string", "format": "date", "description": "With preset CUSTOM, at most 24 months" }, "to": { "type": "string", "format": "date" }, "year": { "type": "integer", "description": "TAX: up to 5 years back" } } },
      "DepositRequest": { "type": "object", "required": [ "partnerRef", "currency", "amount" ], "properties": { "partnerRef": { "type": "string", "minLength": 1, "maxLength": 64, "description": "Unique per partner" }, "currency": { "type": "string", "enum": [ "USDC", "BTC", "ETH", "SOL", "BNB", "XRP", "EUR", "USD1" ] }, "amount": { "type": "string", "description": "Positive decimal string within the currency's precision" }, "method": { "type": "string", "enum": [ "FIAT", "CRYPTO" ], "default": "FIAT" }, "evidenceRef": { "type": "string", "maxLength": 200 } } },
      "DepositNotice": { "type": "object", "properties": { "noticeId": { "type": "integer", "format": "int64" }, "partnerId": { "type": "integer", "format": "int64" }, "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string" }, "partnerRef": { "type": "string" }, "currency": { "type": "string" }, "amount": { "type": "string" }, "method": { "type": "string" }, "evidenceRef": { "type": "string" }, "status": { "type": "string", "enum": [ "PENDING", "CONFIRMED", "REJECTED" ] }, "createdAt": { "type": "integer", "format": "int64" }, "decidedBy": { "type": [ "string", "null" ], "description": "The decider's ROLE label (FINANCE, ADMIN; PARTNER on a sandbox partner's instant decision), never a person's name" }, "decidedAt": { "type": [ "integer", "null" ], "format": "int64" }, "decisionNote": { "type": "string" }, "ledgerTxId": { "type": [ "integer", "null" ], "format": "int64" } } },
      "DepositsPage": { "type": "object", "properties": { "deposits": { "type": "array", "items": { "$ref": "#/components/schemas/DepositNotice" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } },
      "WithdrawalRequestBody": { "type": "object", "required": [ "partnerRef", "currency", "amount" ], "properties": { "partnerRef": { "type": "string", "minLength": 1, "maxLength": 64 }, "currency": { "type": "string", "enum": [ "USDC", "BTC", "ETH", "SOL", "BNB", "XRP", "EUR", "USD1" ] }, "amount": { "type": "string" }, "destination": { "type": "object", "additionalProperties": true, "description": "Your payout reference, any shape, stored verbatim, at most 4096 characters of JSON" } } },
      "WithdrawalRequest": { "type": "object", "properties": { "requestId": { "type": "integer", "format": "int64" }, "partnerId": { "type": "integer", "format": "int64" }, "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string" }, "partnerRef": { "type": "string" }, "currency": { "type": "string" }, "amount": { "type": "string" }, "destination": { "type": "object", "additionalProperties": true }, "status": { "type": "string", "enum": [ "REQUESTED", "APPROVED", "PAID", "REJECTED", "CANCELLED" ] }, "createdAt": { "type": "integer", "format": "int64" }, "decidedBy": { "type": [ "string", "null" ], "description": "The decider's ROLE label (FINANCE, ADMIN; PARTNER on a sandbox partner's instant decision), never a person's name" }, "decidedAt": { "type": [ "integer", "null" ], "format": "int64" }, "paidAt": { "type": [ "integer", "null" ], "format": "int64" }, "decisionNote": { "type": "string" }, "ledgerTxId": { "type": [ "integer", "null" ], "format": "int64" } } },
      "WithdrawalsPage": { "type": "object", "properties": { "withdrawals": { "type": "array", "items": { "$ref": "#/components/schemas/WithdrawalRequest" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } },
      "Settlement": { "type": "object", "properties": { "from": { "type": "integer", "format": "int64" }, "to": { "type": "integer", "format": "int64" }, "asOf": { "type": "integer", "format": "int64" }, "custodyModel": { "type": "string", "enum": [ "BROKER", "PARTNER" ] }, "collateralAsset": { "type": "string" }, "interfirm": { "oneOf": [ { "$ref": "#/components/schemas/InterfirmBlock" }, { "type": "null" } ], "description": "The interfirm block of the window for a PARTNER-custody partner, null under BROKER custody" }, "currencies": { "type": "array", "items": { "type": "object", "properties": { "currency": { "type": "string" }, "depositsConfirmed": { "type": "string" }, "withdrawalsPaid": { "type": "string" }, "commissions": { "type": "string", "description": "Positive for a charge" }, "realizedPnl": { "type": "string", "description": "Signed from the client's point of view" }, "closingClientCash": { "type": "string", "description": "Client cash plus reserved of the partner's clients as of to" } } } }, "definitions": { "type": "object", "properties": { "commissions": { "type": "array", "items": { "type": "string" }, "description": "The ledger types counted as commissions: [\"COMMISSION\"] (every commission is a COMMISSION posting; SWAP_COMMISSION and BARRIER_COMMISSION are no ledger types)" }, "realizedPnl": { "type": "array", "items": { "type": "string" } }, "closingClientCash": { "type": "string" }, "interfirm": { "type": "string" } } } } },
      "MarginPosition": { "type": "object", "properties": { "symbol": { "type": "string" }, "netQty": { "type": "string" }, "avgEntryPrice": { "type": "string" }, "mark": { "type": [ "string", "null" ] }, "markFresh": { "type": "boolean" }, "unrealizedPnl": { "type": "string" }, "initialMargin": { "type": "string" }, "roiPct": { "type": [ "string", "null" ] }, "leverage": { "type": "integer" }, "realizedPnl": { "type": "string" }, "estLiquidationPrice": { "type": [ "string", "null" ] } } },
      "MarginView": { "type": "object", "description": "The same body as the client API's GET /v1/margin; money 6 places. Under PARTNER custody cash is the mirrored collateral.", "properties": { "clientId": { "type": "integer", "format": "int64" }, "equity": { "type": "string" }, "cash": { "type": "string" }, "unrealizedPnl": { "type": "string" }, "reserved": { "type": "string" }, "initialMargin": { "type": "string" }, "maintenanceMargin": { "type": "string" }, "positionMargin": { "type": "string" }, "orderMargin": { "type": "string" }, "freeMargin": { "type": "string" }, "marginLevel": { "type": [ "string", "null" ] }, "riskState": { "type": "string", "enum": [ "NORMAL", "MARGIN_CALL", "CLOSE_OUT" ] }, "categorization": { "type": "string" }, "marksFresh": { "type": "boolean" }, "closeOutPct": { "type": "string" }, "marginCallPct": { "type": "string" }, "positions": { "type": "array", "items": { "$ref": "#/components/schemas/MarginPosition" } }, "openOrders": { "type": "integer" }, "barrierMargin": { "type": "string" }, "barrierUnrealizedPnl": { "type": "string" }, "barrierMarksFresh": { "type": "boolean" }, "pendingAcceptMargin": { "type": "string" }, "closeOutEquity": { "type": "string" }, "barriers": { "type": "array", "items": { "$ref": "#/components/schemas/BarrierContract" } } }, "additionalProperties": true },
      "PreviewRequest": { "type": "object", "required": [ "symbol", "side", "type", "qty" ], "properties": { "symbol": { "type": "string" }, "side": { "type": "string", "enum": [ "BUY", "SELL" ] }, "type": { "type": "string", "enum": [ "LIMIT", "MARKET", "STOP_MARKET", "STOP_LIMIT", "TAKE_PROFIT_MARKET", "TAKE_PROFIT_LIMIT" ] }, "tif": { "type": "string", "enum": [ "GTC", "IOC", "FOK", "POST_ONLY" ] }, "qty": { "type": "string" }, "price": { "type": "string" }, "trigger": { "type": "object", "additionalProperties": true }, "reduceOnly": { "type": "boolean" }, "leverage": { "type": "integer", "description": "Preview at this leverage instead of the stored choice; not persisted" } } },
      "PreviewResult": { "type": "object", "properties": { "accepted": { "type": "boolean" }, "reason": { "type": [ "string", "null" ] }, "reservation": { "type": [ "object", "null" ], "description": "Spot only: what the order would reserve", "properties": { "currency": { "type": "string" }, "amount": { "type": "string" } } }, "orderValue": { "type": [ "string", "null" ] }, "marginRequired": { "type": [ "string", "null" ] }, "leverage": { "type": [ "integer", "null" ] }, "freeMarginBefore": { "type": "string" }, "freeMarginAfter": { "type": [ "string", "null" ] }, "marginLevelAfter": { "type": [ "string", "null" ] }, "estLiquidationPrice": { "type": [ "string", "null" ] }, "equityBefore": { "type": "string" }, "initialMarginBefore": { "type": "string" }, "initialMarginAfter": { "type": [ "string", "null" ] }, "estimatedCommission": { "type": "string" }, "slippageAllowance": { "type": "string" }, "estimatedCosts": { "type": "string" } } },
      "LeverageView": { "type": "object", "properties": { "symbol": { "type": "string" }, "leverage": { "type": "integer", "description": "The effective leverage: the stored choice, else the cap" }, "cap": { "type": "integer", "description": "The schedule's maximum for the client's categorisation" }, "categorization": { "type": "string" }, "chosen": { "type": [ "integer", "null" ], "description": "The stored choice, null until one is set" } } },
      "LeverageRequest": { "type": "object", "required": [ "symbol", "leverage" ], "properties": { "symbol": { "type": "string" }, "leverage": { "type": "integer", "minimum": 1 }, "force": { "type": "boolean", "description": "Apply even when the change would start a margin call or close-out" } } },
      "LeverageWouldBreach": { "type": "object", "required": [ "code", "msg", "error", "data" ], "properties": { "code": { "type": "integer", "const": 4090 }, "msg": { "type": "string" }, "error": { "type": "string" }, "data": { "type": "object", "properties": { "wouldBreach": { "type": "boolean", "const": true }, "initialMarginAfter": { "type": "string" }, "maintenanceMarginAfter": { "type": "string" }, "freeMarginAfter": { "type": "string" }, "marginLevelAfter": { "type": [ "string", "null" ] }, "riskStateAfter": { "type": "string" } } } } },
      "CollateralReportRequest": { "type": "object", "required": [ "partnerRef", "direction", "amount" ], "properties": { "partnerRef": { "type": "string", "minLength": 1, "maxLength": 64, "description": "Unique per partner; a REFUSED report keeps its reference" }, "direction": { "type": "string", "enum": [ "DEPOSIT", "WITHDRAWAL" ] }, "amount": { "type": "string", "description": "Positive decimal string, at most 6 places" }, "currency": { "type": "string", "enum": [ "USDC" ], "default": "USDC", "description": "The stablecoin is valued 1:1 to USDC" }, "sourceAsset": { "type": "string", "maxLength": 32, "description": "The stablecoin name for display; defaults to the partner's collateralAsset" }, "txRef": { "type": "string", "maxLength": 128 }, "occurredAt": { "type": "integer", "format": "int64", "description": "Unix ms, not in the future; defaults to now" } } },
      "CollateralReport": { "type": "object", "properties": { "reportId": { "type": "integer", "format": "int64" }, "partnerId": { "type": "integer", "format": "int64" }, "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string" }, "partnerRef": { "type": "string" }, "direction": { "type": "string", "enum": [ "DEPOSIT", "WITHDRAWAL" ] }, "currency": { "type": "string" }, "amount": { "type": "string" }, "sourceAsset": { "type": "string" }, "txRef": { "type": "string" }, "occurredAt": { "type": "integer", "format": "int64" }, "status": { "type": "string", "enum": [ "BOOKED", "REFUSED" ] }, "refusal": { "type": "string", "description": "The reason on a REFUSED report, else empty" }, "ledgerTxId": { "type": [ "integer", "null" ], "format": "int64" }, "createdAt": { "type": "integer", "format": "int64" } } },
      "CollateralBalances": { "type": "object", "description": "The client's USDC line after the booking", "properties": { "cash": { "type": "string" }, "reserved": { "type": "string" }, "free": { "type": "string", "description": "The lesser of cash and freeMargin" }, "freeMargin": { "type": "string" } } },
      "CollateralBooked": { "type": "object", "properties": { "reportId": { "type": "integer", "format": "int64" }, "status": { "type": "string", "const": "BOOKED" }, "ledgerTxId": { "type": "integer", "format": "int64" }, "balances": { "$ref": "#/components/schemas/CollateralBalances" }, "report": { "$ref": "#/components/schemas/CollateralReport" } } },
      "CollateralRefused": { "type": "object", "required": [ "code", "msg", "error" ], "properties": { "code": { "type": "integer", "const": 4092 }, "msg": { "type": "string" }, "error": { "type": "string" }, "data": { "type": [ "object", "null" ], "description": "Present on an economic refusal (a REFUSED report was recorded); absent when nothing was written", "properties": { "reportId": { "type": "integer", "format": "int64" }, "status": { "type": "string", "const": "REFUSED" }, "refusal": { "type": "string" }, "report": { "$ref": "#/components/schemas/CollateralReport" } } } } },
      "CollateralPage": { "type": "object", "properties": { "reports": { "type": "array", "items": { "$ref": "#/components/schemas/CollateralReport" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } },
      "SettlementItem": { "type": "object", "properties": { "itemId": { "type": "integer", "format": "int64" }, "clientId": { "type": "integer", "format": "int64" }, "clientUid": { "type": "string" }, "partnerClientRef": { "type": "string" }, "type": { "type": "string", "description": "The ledger transaction type: PNL, COMMISSION (a fill's, a barrier entry's or a staking swap's commission, the refs say which), FUNDING, BARRIER_SETTLE, SWAP_PRINCIPAL, SWAP_SETTLE, SWAP_FEE_ADJUST, NBP_WRITEOFF, MANUAL, ..." }, "currency": { "type": "string" }, "amount": { "type": "string", "description": "Signed from the client's view: positive = credit the client's stablecoin, negative = debit it" }, "refs": { "type": "object", "additionalProperties": true, "description": "The ledger transaction's own references (TradeId, ClientOrderId, Instrument on a fill; contractId, symbol, reason, settlePrice on a barrier settlement; ...)" }, "occurredAt": { "type": "integer", "format": "int64" }, "status": { "type": "string", "enum": [ "PENDING", "SETTLED", "FAILED" ] }, "partnerTxRef": { "type": "string" }, "settledAt": { "type": [ "integer", "null" ], "format": "int64" }, "reportedAt": { "type": [ "integer", "null" ], "format": "int64" }, "note": { "type": "string" }, "ledgerTxId": { "type": "integer", "format": "int64" }, "createdAt": { "type": "integer", "format": "int64" } } },
      "SettlementItemsPage": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/SettlementItem" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] } } },
      "SettlementItemReport": { "type": "object", "required": [ "status" ], "properties": { "status": { "type": "string", "enum": [ "SETTLED", "FAILED" ] }, "partnerTxRef": { "type": "string", "maxLength": 128, "description": "Required (1 to 128 characters) on SETTLED" }, "settledAt": { "type": "integer", "format": "int64", "description": "Unix ms, not in the future; defaults to now on SETTLED" }, "note": { "type": "string", "maxLength": 500 } } },
      "SettlementItemReportResult": { "type": "object", "properties": { "item": { "$ref": "#/components/schemas/SettlementItem" }, "changed": { "type": "boolean", "description": "False on the idempotent repeat of the same status (nothing rewritten)" } } },
      "SettlementBulkReport": { "type": "object", "required": [ "items" ], "properties": { "items": { "type": "array", "minItems": 1, "maxItems": 500, "items": { "allOf": [ { "$ref": "#/components/schemas/SettlementItemReport" }, { "type": "object", "required": [ "itemId" ], "properties": { "itemId": { "type": "integer", "format": "int64" } } } ] } } } },
      "SettlementBulkReportResult": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "itemId": { "type": [ "integer", "null" ], "format": "int64" }, "ok": { "type": "boolean" }, "changed": { "type": "boolean", "description": "ok entries only" }, "status": { "type": "string", "description": "ok entries only: the item's status after the entry" }, "code": { "type": "integer", "description": "Refused entries only: 4000, 4004 or 4092" }, "msg": { "type": "string", "description": "Refused entries only" } } } }, "settled": { "type": "integer", "description": "Entries that changed an item to SETTLED" }, "failed": { "type": "integer", "description": "Entries that changed an item to FAILED" }, "unchanged": { "type": "integer" }, "refused": { "type": "integer" } } },
      "SettlementBucket": { "type": "object", "properties": { "count": { "type": "integer" }, "amount": { "type": "string", "description": "The signed sum" }, "credits": { "type": "string", "description": "The positive items" }, "debits": { "type": "string", "description": "The negative items, as a positive figure" } } },
      "InterfirmLine": { "type": "object", "properties": { "currency": { "type": "string" }, "owedToPartner": { "type": "string" }, "owedByPartner": { "type": "string" }, "net": { "type": "string", "description": "owedToPartner minus owedByPartner, signed: positive = we owe the partner" }, "settlementsRecorded": { "type": "string", "description": "The recorded interfirm settlements whose period OVERLAPS the window (periodFrom <= to and periodTo >= from), each counted in full, signed: positive = we paid the partner" }, "outstanding": { "type": "string", "description": "net minus settlementsRecorded, signed like net" } } },
      "InterfirmDefinitions": { "type": "object", "properties": { "owedToPartner": { "type": "string" }, "owedByPartner": { "type": "string" }, "net": { "type": "string" }, "settlementsRecorded": { "type": "string" }, "outstanding": { "type": "string" }, "window": { "type": "string" } } },
      "InterfirmBlock": { "type": "object", "description": "The interfirm block of the settlement report (PARTNER custody only)", "properties": { "currencies": { "type": "array", "items": { "$ref": "#/components/schemas/InterfirmLine" } }, "definitions": { "$ref": "#/components/schemas/InterfirmDefinitions" } } },
      "SettlementSummary": { "type": "object", "properties": { "from": { "type": "integer", "format": "int64" }, "to": { "type": "integer", "format": "int64" }, "asOf": { "type": "integer", "format": "int64" }, "custodyModel": { "type": "string", "enum": [ "BROKER", "PARTNER" ] }, "collateralAsset": { "type": "string" }, "currencies": { "type": "array", "items": { "type": "object", "properties": { "currency": { "type": "string" }, "pending": { "$ref": "#/components/schemas/SettlementBucket" }, "settled": { "$ref": "#/components/schemas/SettlementBucket" }, "failed": { "$ref": "#/components/schemas/SettlementBucket" }, "collateralHeld": { "type": "string", "description": "Minus the balance of HOUSE partner_custody:{partnerId}, now" }, "clientCash": { "type": "string", "description": "The partner clients' cash plus reserved, now" }, "interfirm": { "$ref": "#/components/schemas/InterfirmLine" } } } }, "definitions": { "type": "object", "properties": { "pending": { "type": "string" }, "settled": { "type": "string" }, "failed": { "type": "string" }, "collateralHeld": { "type": "string" }, "clientCash": { "type": "string" }, "interfirm": { "$ref": "#/components/schemas/InterfirmDefinitions" } } } } },
      "InterfirmSettlement": { "type": "object", "properties": { "settlementId": { "type": "integer", "format": "int64" }, "partnerId": { "type": "integer", "format": "int64" }, "currency": { "type": "string" }, "periodFrom": { "type": "integer", "format": "int64" }, "periodTo": { "type": "integer", "format": "int64" }, "amount": { "type": "string", "description": "Signed: positive = we paid the partner, negative = the partner paid us" }, "direction": { "type": "string", "enum": [ "PAID_TO_PARTNER", "PAID_BY_PARTNER" ] }, "txRef": { "type": "string" }, "note": { "type": "string" }, "recordedBy": { "type": "string" }, "recordedAt": { "type": "integer", "format": "int64" } } },
      "InterfirmPage": { "type": "object", "properties": { "settlements": { "type": "array", "items": { "$ref": "#/components/schemas/InterfirmSettlement" } }, "hasMore": { "type": "boolean" }, "nextBefore": { "type": [ "integer", "null" ] }, "definitions": { "$ref": "#/components/schemas/InterfirmDefinitions" } } },
      "WebhookSecret": { "type": "object", "properties": { "url": { "type": "string" }, "secret": { "type": "string", "description": "whs_...; shown this once, rotated on every PUT" }, "active": { "type": "boolean" }, "createdAt": { "type": "integer", "format": "int64" }, "updatedAt": { "type": "integer", "format": "int64" } } },
      "WebhookStatus": { "type": "object", "properties": { "url": { "type": "string" }, "active": { "type": "boolean" }, "createdAt": { "type": "integer", "format": "int64" }, "updatedAt": { "type": "integer", "format": "int64" }, "lastDeliveryAt": { "type": [ "integer", "null" ], "format": "int64" }, "pending": { "type": "integer" } } },
      "Delivery": { "type": "object", "properties": { "deliveryId": { "type": "integer", "format": "int64" }, "event": { "type": "string" }, "clientId": { "type": [ "integer", "null" ], "format": "int64" }, "clientUid": { "type": [ "string", "null" ] }, "status": { "type": "string", "enum": [ "PENDING", "RETRYING", "SENT", "FAILED" ] }, "attempts": { "type": "integer" }, "lastStatus": { "type": [ "integer", "null" ] }, "error": { "type": [ "string", "null" ] }, "ts": { "type": "integer", "format": "int64" }, "sentAt": { "type": [ "integer", "null" ], "format": "int64" }, "nextAt": { "type": [ "integer", "null" ], "format": "int64" } } },
      "WebhookDelivery": {
        "type": "object", "required": [ "id", "event", "partnerId", "ts", "data" ],
        "properties": {
          "id": { "type": "integer", "format": "int64", "description": "The delivery id; deduplicate on it" },
          "event": { "type": "string", "description": "client.onboarded, client.review_required, client.level_changed, appropriateness.result, kyc.documents_requested, kyc.rejected, deposit.confirmed, deposit.rejected, withdrawal.status, collateral.booked, collateral.refused (data: the collateral report), settlement.item_created (data: the settlement item), webhook.test, and the feed events swap.settled, swap.defaulted, barrier.near_take_profit, barrier.near_barrier, barrier.expiry_soon, margin.restriction_set, margin.restriction_lifted, client.verification_decision, money.movement, statement.ready (data {kind, ref, ts})" },
          "partnerId": { "type": "integer", "format": "int64" },
          "clientId": { "type": [ "integer", "null" ], "format": "int64" },
          "clientUid": { "type": [ "string", "null" ] },
          "partnerClientRef": { "type": [ "string", "null" ] },
          "ts": { "type": "integer", "format": "int64", "description": "When the event was queued, Unix ms" },
          "data": { "type": "object", "additionalProperties": true }
        }
      }
    }
  }
}
