POST
https://api.stableyard.fi
/
sdk
/
v1
/
quote
curl -X POST https://api.stableyard.fi/sdk/v1/quote \
  -H "Authorization: Basic $(echo -n $STABLEYARD_APP_ID | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user_sender123",
    "amount": 100.00,
    "destinationPaymentAddress": "merchant@stableyard"
  }'
{
  "success": true,
  "data": {
    "quoteData": {
      "depositAddress": "0x2AEf5902d662f86CbBF5915b2d147fFa11f6CFe1",
      "quoteId": "86598ce7d40ba910c4709093f33543ec1b1bc32f5cf73663d074615a923f3049"
    },
    "payload": {
      "tokenIn": {
        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "inputTokenAmountRaw": "6000000",
        "inputTokenAmountRawFormatted": "6.0000",
        "inputValueInUSD": "5.9985"
      },
      "tokenOut": {
        "address": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
        "outputTokenAmountRaw": "5898753",
        "outputTokenAmountRawFormatted": "5.8988",
        "outputValueInUSD": "5.8973",
        "minimumOutput": "5869259"
      },
      "estimatedTime": 3,
      "quoteExpiry": 1768744584,
      "exchangeRate": "0.9831"
    }
  },
  "requestId": "02f665af-b92f-4bb5-8a13-211e0bf8f1e0"
}
Generate a payment quote for transfers between Money Accounts or to external wallets. Supports both same-chain and cross-chain payments with automatic routing.
Flexible Payments — Use this endpoint for:
  • Account-to-Account: Pay between Money Accounts using userIddestinationPaymentAddress
  • Wallet-to-Account: External wallet paying to Money Account using sourceAddressdestinationPaymentAddress
  • Account-to-Wallet: Money Account paying to external wallet using userIddestinationWalletAddress
  • Cross-chain: Automatically routes payments across different chains

Authentication

Authorization
string
required
Basic authentication. Value: Basic base64(STABLEYARD_APP_ID). Obtain your STABLEYARD_APP_ID from the Stableyard SDK.

Body Parameters

Required

amount
number
required
Payment amount (e.g., 100.00)

Source (Sender)

userId
string
Sender’s Money Account user ID. Use this when sender is a registered Money Account.
sourceAddress
string
Source wallet address. Use this for payments from external wallets not linked to a Money Account.
sourceChainId
integer
Source chain ID (e.g., 8453 for Base). If not provided, uses sender’s preferred chain.
sourceChainToken
string
Source token symbol (e.g., “USDC”). Defaults to USDC if not specified.

Destination (Recipient)

destinationUserId
string
Recipient’s Money Account user ID. Alternative to payment address or wallet address.
destinationPaymentAddress
string
Recipient’s payment address (e.g., merchant@stableyard). Human-readable format.
destinationWalletAddress
string
Recipient’s wallet address for direct transfers to external wallets.
destinationChainID
integer
Target chain ID for settlement. If not provided, uses recipient’s preferred chain.
destinationToken
string
Target token symbol (e.g., “USDC”). If not provided, uses recipient’s preferred token.

Response

success
boolean
Indicates if the request was successful
data
object
Quote data
curl -X POST https://api.stableyard.fi/sdk/v1/quote \
  -H "Authorization: Basic $(echo -n $STABLEYARD_APP_ID | base64)" \
  -H "Content-Type: application/json" \
  -d '{
    "userId": "user_sender123",
    "amount": 100.00,
    "destinationPaymentAddress": "merchant@stableyard"
  }'
{
  "success": true,
  "data": {
    "quoteData": {
      "depositAddress": "0x2AEf5902d662f86CbBF5915b2d147fFa11f6CFe1",
      "quoteId": "86598ce7d40ba910c4709093f33543ec1b1bc32f5cf73663d074615a923f3049"
    },
    "payload": {
      "tokenIn": {
        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "inputTokenAmountRaw": "6000000",
        "inputTokenAmountRawFormatted": "6.0000",
        "inputValueInUSD": "5.9985"
      },
      "tokenOut": {
        "address": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
        "outputTokenAmountRaw": "5898753",
        "outputTokenAmountRawFormatted": "5.8988",
        "outputValueInUSD": "5.8973",
        "minimumOutput": "5869259"
      },
      "estimatedTime": 3,
      "quoteExpiry": 1768744584,
      "exchangeRate": "0.9831"
    }
  },
  "requestId": "02f665af-b92f-4bb5-8a13-211e0bf8f1e0"
}

Payment Flow

The payment flow uses a deposit-based mechanism:
1. Create Quote → Get depositAddress + payment details
2. Display confirmation screen to user (show rates, fees, estimated time)
3. User confirms → Send tokens to depositAddress on-chain
4. Poll /verify-transfer → Wait for payment confirmation

Complete Payment Example

import { ethers } from 'ethers';

// Step 1: Create quote
const quoteRes = await fetch('https://api.stableyard.fi/sdk/v1/quote', {
  method: 'POST',
  headers: {
    'Authorization': 'Basic ' + btoa(STABLEYARD_APP_ID),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    amount: 6.00,
    sourceChainId: 8453,  // Base
    destinationPaymentAddress: 'merchant@stableyard'
  })
});
const quote = await quoteRes.json();

// Step 2: Display confirmation to user
const { quoteData, payload } = quote.data;
console.log('Deposit Address:', quoteData.depositAddress);
console.log('You send:', payload.tokenIn.inputTokenAmountRawFormatted, 'USDC');
console.log('Recipient gets:', payload.tokenOut.outputTokenAmountRawFormatted, 'USDC');
console.log('Exchange rate:', payload.exchangeRate);
console.log('Estimated time:', payload.estimatedTime, 'seconds');

// Step 3: User confirms - send tokens on-chain
const provider = new ethers.BrowserProvider(window.ethereum);
const signer = await provider.getSigner();
const tokenContract = new ethers.Contract(
  payload.tokenIn.address,
  ['function transfer(address to, uint256 amount) returns (bool)'],
  signer
);

const tx = await tokenContract.transfer(
  quoteData.depositAddress,
  payload.tokenIn.inputTokenAmountRaw
);
await tx.wait();

// Step 4: Poll for payment confirmation
const pollPayment = async (quoteId: string) => {
  while (true) {
    const res = await fetch(
      `https://api.stableyard.fi/sdk/v1/verify-transfer?quoteId=${quoteId}`,
      { headers: { 'Authorization': 'Basic ' + btoa(STABLEYARD_APP_ID) } }
    );
    const result = await res.json();

    if (result.success && result.data?.isTransferDone) {
      console.log('Payment complete!');
      return result.data;
    }

    // Wait 2 seconds before next poll
    await new Promise(r => setTimeout(r, 2000));
  }
};

const confirmation = await pollPayment(quoteData.quoteId);

What to Show on Confirmation Screen

Display these fields from the quote response to keep users informed:
FieldSourceExample
You Paypayload.tokenIn.inputTokenAmountRawFormatted”6.0000 USDC”
They Receivepayload.tokenOut.outputTokenAmountRawFormatted”5.8988 USDC”
Exchange Ratepayload.exchangeRate”0.9831”
Estimated Timepayload.estimatedTime”~3 seconds”
USD Valuepayload.tokenIn.inputValueInUSD”$5.99”
Minimum Outputpayload.tokenOut.minimumOutput”5.8692 USDC”
Quote Expiry — Quotes expire at the quoteExpiry timestamp. Always check this before initiating the transfer.
Smart Defaults — If you don’t specify source/destination chains, Stableyard uses the sender’s and recipient’s preferred settlement preferences.