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 userId → destinationPaymentAddress
Wallet-to-Account : External wallet paying to Money Account using sourceAddress → destinationPaymentAddress
Account-to-Wallet : Money Account paying to external wallet using userId → destinationWalletAddress
Cross-chain : Automatically routes payments across different chains
Authentication
Basic authentication. Value: Basic base64(STABLEYARD_APP_ID). Obtain your STABLEYARD_APP_ID from the Stableyard SDK.
Body Parameters
Required
Payment amount (e.g., 100.00)
Source (Sender)
Sender’s Money Account user ID. Use this when sender is a registered Money Account.
Source wallet address. Use this for payments from external wallets not linked to a Money Account.
Source chain ID (e.g., 8453 for Base). If not provided, uses sender’s preferred chain.
Source token symbol (e.g., “USDC”). Defaults to USDC if not specified.
Destination (Recipient)
Recipient’s Money Account user ID. Alternative to payment address or wallet address.
destinationPaymentAddress
Recipient’s payment address (e.g., merchant@stableyard). Human-readable format.
Recipient’s wallet address for direct transfers to external wallets.
Target chain ID for settlement. If not provided, uses recipient’s preferred chain.
Target token symbol (e.g., “USDC”). If not provided, uses recipient’s preferred token.
Response
Indicates if the request was successful
Quote data Core quote identifiers Show quoteData properties
Address to send tokens to. User transfers funds here to complete payment.
Unique quote identifier for tracking and verification
Payment details to display to user Input token details Amount in smallest units (wei)
inputTokenAmountRawFormatted
Human-readable amount
Output token details outputTokenAmountRawFormatted
Human-readable amount recipient receives
Minimum guaranteed output (slippage protected)
Estimated completion time in seconds
Unix timestamp when quote expires
Exchange rate between input and output tokens
Account-to-Account
Cross-Chain Payment
JavaScript
Python
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"
}'
200
400 Bad Request
404 Not Found
{
"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:
Field Source Example You Pay payload.tokenIn.inputTokenAmountRawFormatted”6.0000 USDC” They Receive payload.tokenOut.outputTokenAmountRawFormatted”5.8988 USDC” Exchange Rate payload.exchangeRate”0.9831” Estimated Time payload.estimatedTime”~3 seconds” USD Value payload.tokenIn.inputValueInUSD”$5.99” Minimum Output payload.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.