Transfers

Send money directly from one account to another. Transfers route through Stableyard’s routing network — the on-chain trail shows sender → Stableyard → recipient as separate transactions, breaking the direct link for privacy.

Send Money

Alice sends $10 USDC to Bob:
curl -X POST https://api.stableyard.fi/v2/sessions \
  -H "Authorization: Bearer sy_secret_*" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "transfer",
    "amount": 10000000,
    "destination": "bob@stableyard",
    "sourceChain": "polygon"
  }'

Transfer Flow

1. Create transfer session
   POST /v2/sessions { type: "transfer", amount, destination, sourceChain }
   → Returns deposit address + route info

2. Alice sends USDC to deposit address

3. Confirm tx
   POST /v2/sessions/:id/submit-tx { txHash, chain }

4. Stableyard routes (3-15 seconds)
   On-chain: Alice → Stableyard, Stableyard → Bob (separate txs)

5. Bob receives on his settlement chain
   Webhook: payment.settled

Payment Request

Alice wants to get paid $25 — creates a session and shares the link:
curl -X POST https://api.stableyard.fi/v2/sessions \
  -H "Authorization: Bearer sy_auth_*" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 25000000,
    "destination": "alice@stableyard"
  }'
Response includes a checkoutUrl — share it with anyone. The payer opens the link, picks their chain, and pays through the standard checkout flow. This is identical to the merchant checkout — Alice IS the merchant in this context.

Vault Payment (Zero Gas)

If Alice has an active vault with balance, she can pay without gas:
curl -X POST https://api.stableyard.fi/v2/sessions/ses_abc/pay \
  -H "Authorization: Bearer sy_secret_*" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "vault_balance",
    "signedMessage": "0x...",
    "signerAddress": "0xALICE"
  }'
Alice signs an EIP-712 message, Stableyard executes from the vault. Stableyard fronts money to the recipient immediately.