{"components":{"schemas":{"ApiError":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},"requestId":{"type":"string"}},"required":["error","requestId"],"type":"object"},"QuoteRequest":{"properties":{"clientReferenceId":{"maxLength":100,"type":"string"},"fromAmount":{"description":"Exact input amount in the source token's base units.","pattern":"^[0-9]+$","type":"string"},"fromChainId":{"type":"integer"},"fromTokenAddress":{"example":"0x0000000000000000000000000000000000000000","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"slippageBps":{"maximum":2500,"minimum":1,"type":"integer"},"toChainId":{"type":"integer"},"toTokenAddress":{"example":"0x0000000000000000000000000000000000000000","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"walletAddress":{"example":"0x0000000000000000000000000000000000000000","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"}},"required":["fromAmount","fromChainId","fromTokenAddress","slippageBps","toChainId","toTokenAddress","walletAddress"],"type":"object"},"QuoteRoute":{"properties":{"approval":{"properties":{"spender":{"example":"0x0000000000000000000000000000000000000000","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"transaction":{"properties":{"chainId":{"type":"integer"},"data":{"type":"string"},"gasLimit":{"type":"string"},"gasPrice":{"type":"string"},"target":{"example":"0x0000000000000000000000000000000000000000","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"value":{"type":"string"}},"required":["chainId","data","target","value"],"type":"object"}},"required":["spender"],"type":"object"},"expiresAt":{"format":"date-time","type":"string"},"feeIncluded":{"enum":[true],"type":"boolean"},"fromAmount":{"type":"string"},"fromToken":{"properties":{"address":{"example":"0x0000000000000000000000000000000000000000","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"chainId":{"type":"integer"},"decimals":{"type":"integer"},"symbol":{"type":"string"}},"required":["address","chainId","decimals","symbol"],"type":"object"},"gasCosts":{"items":{"properties":{"amount":{"type":"string"},"amountUsd":{"type":"string"},"estimate":{"type":"string"},"limit":{"type":"string"},"token":{"properties":{"address":{"example":"0x0000000000000000000000000000000000000000","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"chainId":{"type":"integer"},"decimals":{"type":"integer"},"symbol":{"type":"string"}},"required":["address","chainId","decimals","symbol"],"type":"object"}},"required":["amount","estimate","token"],"type":"object"},"type":"array"},"minimumOutput":{"type":"string"},"outputAmount":{"type":"string"},"priceImpactPercentage":{"type":"string"},"routeClass":{"enum":["same-chain","cross-chain"],"type":"string"},"routeId":{"type":"string"},"toToken":{"properties":{"address":{"example":"0x0000000000000000000000000000000000000000","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"chainId":{"type":"integer"},"decimals":{"type":"integer"},"symbol":{"type":"string"}},"required":["address","chainId","decimals","symbol"],"type":"object"},"transaction":{"properties":{"chainId":{"type":"integer"},"data":{"type":"string"},"gasLimit":{"type":"string"},"gasPrice":{"type":"string"},"target":{"example":"0x0000000000000000000000000000000000000000","pattern":"^0x[a-fA-F0-9]{40}$","type":"string"},"value":{"type":"string"}},"required":["chainId","data","target","value"],"type":"object"}},"required":["expiresAt","feeIncluded","fromAmount","fromToken","gasCosts","minimumOutput","outputAmount","routeClass","routeId","toToken","transaction"],"type":"object"},"SettlementRequest":{"properties":{"routeId":{"pattern":"^pfof_q_[a-f0-9]{24}$","type":"string"},"transactionHash":{"pattern":"^0x[a-fA-F0-9]{64}$","type":"string"}},"required":["routeId","transactionHash"],"type":"object"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"PFOF API key","scheme":"bearer","type":"http"}}},"info":{"contact":{"email":"dracula@pfof.exchange"},"description":"Invite-only API for preparing fee-inclusive, wallet-bound PFOF routes. API keys must remain server-side.","title":"PFOF Partner API","version":"2026-08-13"},"openapi":"3.1.0","paths":{"/api/v1/chains":{"get":{"description":"List the networks currently available to PFOF.","responses":{"200":{"description":"Supported networks"},"401":{"description":"Invalid API key"},"429":{"description":"Rate limit exceeded"}},"security":[{"bearerAuth":[]}],"summary":"List supported chains"}},"/api/v1/health":{"get":{"responses":{"200":{"description":"API health"}},"summary":"Check API health"}},"/api/v1/quote":{"post":{"description":"Compare eligible routes and return the strongest executable PFOF transaction. The transaction is bound to walletAddress and expires quickly.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"apiVersion":{"type":"string"},"clientReferenceId":{"type":"string"},"commercials":{"properties":{"partnerRevenueShareBps":{"type":"integer"},"routingFeeBps":{"type":"integer"}},"required":["partnerRevenueShareBps","routingFeeBps"],"type":"object"},"requestId":{"type":"string"},"route":{"$ref":"#/components/schemas/QuoteRoute"}},"required":["apiVersion","commercials","requestId","route"],"type":"object"}}},"description":"Winning PFOF route"},"400":{"description":"Invalid quote request"},"401":{"description":"Invalid API key"},"422":{"description":"No executable route"},"429":{"description":"Rate limit exceeded"},"502":{"description":"Route providers unavailable"}},"security":[{"bearerAuth":[]}],"summary":"Prepare the best PFOF route"}},"/api/v1/settlements":{"post":{"description":"Report an execution. PFOF verifies the source chain, sender, target, calldata, value, receipt status, and replay status before recording attribution.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementRequest"}}},"required":true},"responses":{"201":{"description":"Execution verified and attributed"},"409":{"description":"Pending or previously attributed transaction"},"422":{"description":"Failed or mismatched transaction"}},"security":[{"bearerAuth":[]}],"summary":"Verify a route execution"}},"/api/v1/earnings":{"get":{"description":"Return durable all-time execution-verified earnings totals and the latest 100 settlements pending provider-revenue reconciliation.","responses":{"200":{"description":"Partner earnings ledger"}},"security":[{"bearerAuth":[]}],"summary":"List partner earnings"}},"/api/v1/tokens":{"get":{"description":"List or search PFOF's cached token catalog by chain.","parameters":[{"in":"query","name":"chainId","required":true,"schema":{"type":"integer"}},{"in":"query","name":"query","schema":{"maxLength":64,"type":"string"}},{"in":"query","name":"limit","schema":{"default":50,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"cursor","schema":{"default":0,"minimum":0,"type":"integer"}}],"responses":{"200":{"description":"Token catalog page"},"401":{"description":"Invalid API key"},"429":{"description":"Rate limit exceeded"}},"security":[{"bearerAuth":[]}],"summary":"List tokens"}}},"servers":[{"url":"https://pfof.exchange"}]}