API Reference

Base URL: https://api.stableyard.fi/v2 All requests must include an Authorization: Bearer <token> header. See Authentication for details.

Endpoints Summary

Authentication

MethodEndpointDescription
POST/auth/challengeCreate a wallet auth challenge
POST/auth/verifyVerify signature and get session token
POST/auth/refreshRefresh a session token

Accounts

MethodEndpointDescription
GET/accounts/resolveResolve account by wallet address
GET/accounts/:idGet account details
GET/accounts/:id/nonceGet signing nonce
PATCH/accounts/:id/settingsUpdate settlement settings
GET/accounts/:id/keysGet API keys
POST/accounts/:id/keys/regenerateRegenerate API keys
GET/accounts/:id/ledgerGet ledger entries

Vault

MethodEndpointDescription
GET/accounts/:id/vaultGet vault balance
POST/accounts/:id/vaultDeploy a new vault
POST/accounts/:id/vault/activateActivate vault role module

Deposits

MethodEndpointDescription
POST/deposits/addressesCreate a deposit address
GET/deposits/addresses/:idGet deposit address
POST/deposits/settleSettle deposit (auto-detect token)

Sessions

MethodEndpointDescription
POST/sessionsCreate a payment session
GET/sessions/:idGet session details
GET/sessionsList sessions
POST/sessions/quoteGet a payment quote
POST/sessions/:id/payPay from vault
POST/sessions/:id/cancelCancel a session
POST/sessions/:id/refundRefund a session
POST/sessions/:id/submit-txSubmit transaction hash
POST/sessions/:id/verifyVerify x402 payment
POST/sessions/:id/disputeFlag a dispute
POST/sessions/:id/dispute/resolveResolve a dispute
GET/sessions/:id/traceGet session trace

Webhooks

MethodEndpointDescription
POST/webhooksCreate a webhook
GET/webhooksList webhooks
POST/webhooks/:id/urlUpdate webhook URL
POST/webhooks/:id/rotate-secretRotate webhook secret
DELETE/webhooks/:idDelete a webhook
GET/webhooks/:id/eventsGet webhook events

Network

MethodEndpointDescription
GET/network/chainsList supported chains
GET/network/statusAPI and chain status
GET/network/portfolioMulti-chain portfolio

Common Response Format

All responses include a requestId for debugging:
{
  "object": "session",
  "id": "ses_abc123",
  "requestId": "req_xyz789",
  "...": "..."
}

Error Format

{
  "error": {
    "type": "invalid_request",
    "code": "missing_fields",
    "message": "amount is required",
    "requestId": "req_xyz789"
  }
}

Idempotency

POST endpoints that create resources support the Idempotency-Key header. Sending the same key returns the cached response instead of creating a duplicate.
curl -X POST https://api.stableyard.fi/v2/sessions \
  -H "Idempotency-Key: unique-key-123" \
  ...