{"openapi":"3.1.0","info":{"title":"SettleProof API","version":"1.0.0-devnet","summary":"Headless API for AAP - Agent Attestation Protocol devnet settlement.","description":"Prepare escrow inputs, relay signed Solana transactions, and read indexed settlement state without giving SettleProof private keys."},"servers":[{"url":"https://api.settleproof.xyz"}],"tags":[{"name":"Status"},{"name":"Escrows"},{"name":"Merchants"},{"name":"Relay"},{"name":"Indexer"}],"paths":{"/health":{"get":{"tags":["Status"],"summary":"Service heartbeat","responses":{"200":{"description":"Service is reachable"}}}},"/v1/status":{"get":{"tags":["Status"],"summary":"Protocol and deployment status","responses":{"200":{"description":"Protocol status"}}}},"/v1/escrows/prepare":{"post":{"tags":["Escrows"],"summary":"Prepare deterministic escrow inputs","description":"Derives escrow PDA, vault ATA, merchant PDA, and task hash inputs. It does not sign or submit a transaction.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscrowPrepareRequest"}}}},"responses":{"200":{"description":"Prepared escrow inputs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscrowPrepareResponse"}}}}}}},"/v1/escrows/{pda}":{"get":{"tags":["Escrows"],"summary":"Read one escrow","parameters":[{"name":"pda","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Escrow account"}}}},"/v1/merchants/{pubkey}":{"get":{"tags":["Merchants"],"summary":"Read one merchant","parameters":[{"name":"pubkey","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Merchant account"}}}},"/v1/relay":{"get":{"tags":["Relay"],"summary":"Relay policy","responses":{"200":{"description":"Relay policy"}}},"post":{"tags":["Relay"],"summary":"Broadcast a signed Solana transaction","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RelayRequest"}}}},"responses":{"202":{"description":"Transaction submitted"}}}},"/v1/indexer":{"get":{"tags":["Indexer"],"summary":"Query persistent escrow index","parameters":[{"name":"merchant","in":"query","schema":{"type":"string"}},{"name":"agent_owner","in":"query","schema":{"type":"string"}},{"name":"state","in":"query","schema":{"type":"string","enum":["Pending","Fulfilled","Refunded","PartiallyFulfilled"]}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Indexed escrows"}}}},"/v1/indexer/events":{"get":{"tags":["Indexer"],"summary":"Query indexed settlement events","parameters":[{"name":"merchant","in":"query","schema":{"type":"string"}},{"name":"agent_owner","in":"query","schema":{"type":"string"}},{"name":"state","in":"query","schema":{"type":"string","enum":["Pending","Fulfilled","Refunded","PartiallyFulfilled"]}},{"name":"limit","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"Indexed events"}}}},"/v1/indexer/sync":{"post":{"tags":["Indexer"],"summary":"Trigger an indexer sync","responses":{"202":{"description":"Sync completed"}}}}},"components":{"schemas":{"EscrowPrepareRequest":{"type":"object","required":["agent_owner","merchant","mint","amount_stroops","ttl_seconds"],"properties":{"agent_owner":{"type":"string"},"merchant":{"type":"string"},"mint":{"type":"string"},"amount_stroops":{"type":"string","example":"1000000"},"ttl_seconds":{"type":"integer","minimum":1,"maximum":604800},"task_hash":{"type":"string","description":"Optional 32-byte hex task hash."},"task_intent":{"type":"string","description":"Used to derive task_hash when task_hash is absent."},"nonce":{"type":"string"}}},"EscrowPrepareResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"escrow_pda":{"type":"string"},"vault_token_account":{"type":"string"},"merchant_pda":{"type":"string"},"inputs":{"type":"object"},"sdk_call":{"type":"object"}}}}},"RelayRequest":{"type":"object","required":["signed_transaction"],"properties":{"signed_transaction":{"type":"string","description":"Base64 serialized signed Solana transaction."},"encoding":{"type":"string","enum":["base64"],"default":"base64"},"confirm":{"type":"boolean","default":false},"skip_preflight":{"type":"boolean","default":false}}}}}}