This endpoint enables instant stablecoin transfers between addresses on the StateSet network. Supports both single and batch transfers with atomic execution.
Authentication
This endpoint requires a valid API key with stablecoin:transfer
permissions.
Authorization: Bearer YOUR_API_KEY
Request Body
Single Transfer
The sender’s blockchain address Example: stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu
The recipient’s blockchain address
The transfer amount The stablecoin denomination (e.g., “ssusd”)
The amount in smallest unit (e.g., “1000000” for 1 ssUSD)
Batch Transfer
The sender’s blockchain address for all transfers
Array of transfer objects Transfer amount (same structure as single transfer)
Optional memo for this transfer
Common Fields
Optional memo for the transaction
Transaction priority: “low”, “medium”, “high” (affects gas price) Default: “medium”
Unique key to prevent duplicate transfers
Additional metadata for the transfer
ISO 8601 timestamp for scheduled transfers (future feature)
Response
Unique transfer identifier
Object type: “transfer” or “batch_transfer”
Blockchain transaction hash
Transfer status: “pending”, “confirmed”, “failed”
Array of individual transfers (for batch transfers) Transfer amount with display formatting
Individual transfer status
Total amount transferred (for batch)
Fee breakdown Additional priority fee (if applicable)
Block height of confirmation
ISO 8601 timestamp of confirmation
Single Transfer Request
Batch Transfer Request
Example Response
{
"from" : "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu" ,
"to" : "stateset1abcdefghijklmnopqrstuvwxyz123456789012" ,
"amount" : {
"denom" : "ssusd" ,
"amount" : "500000000"
},
"memo" : "Payment for invoice #INV-2024-001" ,
"priority" : "high" ,
"idempotency_key" : "transfer_abc123" ,
"metadata" : {
"invoice_id" : "inv_123456" ,
"order_id" : "ord_789012"
}
}
Error Codes
Code Description 400
Invalid request parameters 401
Unauthorized - Invalid API key 403
Forbidden - Account restricted 422
Insufficient balance 429
Rate limit exceeded 500
Internal server error
Transfer Limits
Type Limit Description Single Transfer $10,000,000 Per transaction Batch Transfers 100 Maximum recipients per batch Daily Volume $50,000,000 Per account Minimum Amount $0.01 Minimum transfer value
Best Practices
Use idempotency keys to prevent duplicate transfers
Batch transfers when sending to multiple recipients to save on fees
Set appropriate priority based on urgency
Include memos for better transaction tracking
Validate addresses before initiating transfers
Code Examples
const axios = require ( 'axios' );
// Single transfer
async function transferStablecoin ( to , amount ) {
try {
const response = await axios . post (
'https://api.stateset.com/v1/stablecoin/transfer' ,
{
from: 'stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu' ,
to: to ,
amount: {
denom: 'ssusd' ,
amount: amount
},
memo: 'Payment transfer' ,
idempotency_key: `transfer_ ${ Date . now () } `
},
{
headers: {
'Authorization' : 'Bearer YOUR_API_KEY' ,
'Content-Type' : 'application/json'
}
}
);
console . log ( 'Transfer successful:' , response . data );
return response . data ;
} catch ( error ) {
console . error ( 'Transfer failed:' , error . response . data );
}
}
// Batch transfer
async function batchTransfer ( recipients ) {
try {
const transfers = recipients . map ( r => ({
to: r . address ,
amount: {
denom: 'ssusd' ,
amount: r . amount
},
memo: r . memo
}));
const response = await axios . post (
'https://api.stateset.com/v1/stablecoin/transfer' ,
{
from: 'stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu' ,
transfers: transfers ,
memo: 'Batch payment processing'
},
{
headers: {
'Authorization' : 'Bearer YOUR_API_KEY' ,
'Content-Type' : 'application/json'
}
}
);
console . log ( `Transferred to ${ transfers . length } recipients` );
return response . data ;
} catch ( error ) {
console . error ( 'Batch transfer failed:' , error . response . data );
}
}