Transfer Stablecoin
curl --request POST \
--url https://api.stateset.com/v1/stablecoin/transfer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"to": "<string>",
"amount": {
"denom": "<string>",
"amount": "<string>"
},
"transfers": [
{
"to": "<string>",
"amount": {},
"memo": "<string>"
}
],
"memo": "<string>",
"priority": "<string>",
"idempotency_key": "<string>",
"metadata": {},
"scheduled_at": "<string>"
}
'import requests
url = "https://api.stateset.com/v1/stablecoin/transfer"
payload = {
"from": "<string>",
"to": "<string>",
"amount": {
"denom": "<string>",
"amount": "<string>"
},
"transfers": [
{
"to": "<string>",
"amount": {},
"memo": "<string>"
}
],
"memo": "<string>",
"priority": "<string>",
"idempotency_key": "<string>",
"metadata": {},
"scheduled_at": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '<string>',
to: '<string>',
amount: {denom: '<string>', amount: '<string>'},
transfers: [{to: '<string>', amount: {}, memo: '<string>'}],
memo: '<string>',
priority: '<string>',
idempotency_key: '<string>',
metadata: {},
scheduled_at: '<string>'
})
};
fetch('https://api.stateset.com/v1/stablecoin/transfer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stateset.com/v1/stablecoin/transfer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '<string>',
'to' => '<string>',
'amount' => [
'denom' => '<string>',
'amount' => '<string>'
],
'transfers' => [
[
'to' => '<string>',
'amount' => [
],
'memo' => '<string>'
]
],
'memo' => '<string>',
'priority' => '<string>',
'idempotency_key' => '<string>',
'metadata' => [
],
'scheduled_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.stateset.com/v1/stablecoin/transfer"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"amount\": {\n \"denom\": \"<string>\",\n \"amount\": \"<string>\"\n },\n \"transfers\": [\n {\n \"to\": \"<string>\",\n \"amount\": {},\n \"memo\": \"<string>\"\n }\n ],\n \"memo\": \"<string>\",\n \"priority\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"metadata\": {},\n \"scheduled_at\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.stateset.com/v1/stablecoin/transfer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"amount\": {\n \"denom\": \"<string>\",\n \"amount\": \"<string>\"\n },\n \"transfers\": [\n {\n \"to\": \"<string>\",\n \"amount\": {},\n \"memo\": \"<string>\"\n }\n ],\n \"memo\": \"<string>\",\n \"priority\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"metadata\": {},\n \"scheduled_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stateset.com/v1/stablecoin/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"amount\": {\n \"denom\": \"<string>\",\n \"amount\": \"<string>\"\n },\n \"transfers\": [\n {\n \"to\": \"<string>\",\n \"amount\": {},\n \"memo\": \"<string>\"\n }\n ],\n \"memo\": \"<string>\",\n \"priority\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"metadata\": {},\n \"scheduled_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}
{
"from": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"transfers": [
{
"to": "stateset1abcdefghijklmnopqrstuvwxyz123456789012",
"amount": {
"denom": "ssusd",
"amount": "250000000"
},
"memo": "Vendor payment A"
},
{
"to": "stateset1zyxwvutsrqponmlkjihgfedcba987654321098",
"amount": {
"denom": "ssusd",
"amount": "750000000"
},
"memo": "Vendor payment B"
}
],
"memo": "Batch vendor payments - Jan 2024",
"priority": "medium"
}
{
"id": "txf_batch_7h8g9f0e1d2c3b4a",
"object": "batch_transfer",
"transaction_hash": "C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0U1V2",
"status": "confirmed",
"transfers": [
{
"from": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"to": "stateset1abcdefghijklmnopqrstuvwxyz123456789012",
"amount": {
"denom": "ssusd",
"amount": "250000000",
"display_amount": "250.00 ssUSD"
},
"status": "confirmed"
},
{
"from": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"to": "stateset1zyxwvutsrqponmlkjihgfedcba987654321098",
"amount": {
"denom": "ssusd",
"amount": "750000000",
"display_amount": "750.00 ssUSD"
},
"status": "confirmed"
}
],
"total_amount": {
"denom": "ssusd",
"amount": "1000000000",
"display_amount": "1,000.00 ssUSD"
},
"fees": {
"network_fee": "0.02",
"priority_fee": "0.00",
"total_fee": "0.02"
},
"block_height": 1234568,
"created_at": "2024-01-15T11:00:00Z",
"confirmed_at": "2024-01-15T11:00:03Z"
}
Transfer Stablecoin
Transfer stablecoins between addresses with optional batch support
POST
/
v1
/
stablecoin
/
transfer
Transfer Stablecoin
curl --request POST \
--url https://api.stateset.com/v1/stablecoin/transfer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "<string>",
"to": "<string>",
"amount": {
"denom": "<string>",
"amount": "<string>"
},
"transfers": [
{
"to": "<string>",
"amount": {},
"memo": "<string>"
}
],
"memo": "<string>",
"priority": "<string>",
"idempotency_key": "<string>",
"metadata": {},
"scheduled_at": "<string>"
}
'import requests
url = "https://api.stateset.com/v1/stablecoin/transfer"
payload = {
"from": "<string>",
"to": "<string>",
"amount": {
"denom": "<string>",
"amount": "<string>"
},
"transfers": [
{
"to": "<string>",
"amount": {},
"memo": "<string>"
}
],
"memo": "<string>",
"priority": "<string>",
"idempotency_key": "<string>",
"metadata": {},
"scheduled_at": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
from: '<string>',
to: '<string>',
amount: {denom: '<string>', amount: '<string>'},
transfers: [{to: '<string>', amount: {}, memo: '<string>'}],
memo: '<string>',
priority: '<string>',
idempotency_key: '<string>',
metadata: {},
scheduled_at: '<string>'
})
};
fetch('https://api.stateset.com/v1/stablecoin/transfer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.stateset.com/v1/stablecoin/transfer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'from' => '<string>',
'to' => '<string>',
'amount' => [
'denom' => '<string>',
'amount' => '<string>'
],
'transfers' => [
[
'to' => '<string>',
'amount' => [
],
'memo' => '<string>'
]
],
'memo' => '<string>',
'priority' => '<string>',
'idempotency_key' => '<string>',
'metadata' => [
],
'scheduled_at' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.stateset.com/v1/stablecoin/transfer"
payload := strings.NewReader("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"amount\": {\n \"denom\": \"<string>\",\n \"amount\": \"<string>\"\n },\n \"transfers\": [\n {\n \"to\": \"<string>\",\n \"amount\": {},\n \"memo\": \"<string>\"\n }\n ],\n \"memo\": \"<string>\",\n \"priority\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"metadata\": {},\n \"scheduled_at\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.stateset.com/v1/stablecoin/transfer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"amount\": {\n \"denom\": \"<string>\",\n \"amount\": \"<string>\"\n },\n \"transfers\": [\n {\n \"to\": \"<string>\",\n \"amount\": {},\n \"memo\": \"<string>\"\n }\n ],\n \"memo\": \"<string>\",\n \"priority\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"metadata\": {},\n \"scheduled_at\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stateset.com/v1/stablecoin/transfer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"from\": \"<string>\",\n \"to\": \"<string>\",\n \"amount\": {\n \"denom\": \"<string>\",\n \"amount\": \"<string>\"\n },\n \"transfers\": [\n {\n \"to\": \"<string>\",\n \"amount\": {},\n \"memo\": \"<string>\"\n }\n ],\n \"memo\": \"<string>\",\n \"priority\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"metadata\": {},\n \"scheduled_at\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"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"
}
}
{
"from": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"transfers": [
{
"to": "stateset1abcdefghijklmnopqrstuvwxyz123456789012",
"amount": {
"denom": "ssusd",
"amount": "250000000"
},
"memo": "Vendor payment A"
},
{
"to": "stateset1zyxwvutsrqponmlkjihgfedcba987654321098",
"amount": {
"denom": "ssusd",
"amount": "750000000"
},
"memo": "Vendor payment B"
}
],
"memo": "Batch vendor payments - Jan 2024",
"priority": "medium"
}
{
"id": "txf_batch_7h8g9f0e1d2c3b4a",
"object": "batch_transfer",
"transaction_hash": "C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0U1V2",
"status": "confirmed",
"transfers": [
{
"from": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"to": "stateset1abcdefghijklmnopqrstuvwxyz123456789012",
"amount": {
"denom": "ssusd",
"amount": "250000000",
"display_amount": "250.00 ssUSD"
},
"status": "confirmed"
},
{
"from": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"to": "stateset1zyxwvutsrqponmlkjihgfedcba987654321098",
"amount": {
"denom": "ssusd",
"amount": "750000000",
"display_amount": "750.00 ssUSD"
},
"status": "confirmed"
}
],
"total_amount": {
"denom": "ssusd",
"amount": "1000000000",
"display_amount": "1,000.00 ssUSD"
},
"fees": {
"network_fee": "0.02",
"priority_fee": "0.00",
"total_fee": "0.02"
},
"block_height": 1234568,
"created_at": "2024-01-15T11:00:00Z",
"confirmed_at": "2024-01-15T11:00:03Z"
}
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 withstablecoin:transfer permissions.
Authorization: Bearer YOUR_API_KEY
Request Body
Single Transfer
string
required
The sender’s blockchain addressExample:
stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xustring
required
The recipient’s blockchain address
object
required
Batch Transfer
string
required
The sender’s blockchain address for all transfers
array
required
Common Fields
string
Optional memo for the transaction
string
Transaction priority: “low”, “medium”, “high” (affects gas price)Default: “medium”
string
Unique key to prevent duplicate transfers
object
Additional metadata for the transfer
string
ISO 8601 timestamp for scheduled transfers (future feature)
Response
string
Unique transfer identifier
string
Object type: “transfer” or “batch_transfer”
string
Blockchain transaction hash
string
Transfer status: “pending”, “confirmed”, “failed”
array
object
Total amount transferred (for batch)
object
integer
Block height of confirmation
string
ISO 8601 timestamp
string
ISO 8601 timestamp of confirmation
{
"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"
}
}
{
"from": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"transfers": [
{
"to": "stateset1abcdefghijklmnopqrstuvwxyz123456789012",
"amount": {
"denom": "ssusd",
"amount": "250000000"
},
"memo": "Vendor payment A"
},
{
"to": "stateset1zyxwvutsrqponmlkjihgfedcba987654321098",
"amount": {
"denom": "ssusd",
"amount": "750000000"
},
"memo": "Vendor payment B"
}
],
"memo": "Batch vendor payments - Jan 2024",
"priority": "medium"
}
{
"id": "txf_batch_7h8g9f0e1d2c3b4a",
"object": "batch_transfer",
"transaction_hash": "C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0U1V2",
"status": "confirmed",
"transfers": [
{
"from": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"to": "stateset1abcdefghijklmnopqrstuvwxyz123456789012",
"amount": {
"denom": "ssusd",
"amount": "250000000",
"display_amount": "250.00 ssUSD"
},
"status": "confirmed"
},
{
"from": "stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"to": "stateset1zyxwvutsrqponmlkjihgfedcba987654321098",
"amount": {
"denom": "ssusd",
"amount": "750000000",
"display_amount": "750.00 ssUSD"
},
"status": "confirmed"
}
],
"total_amount": {
"denom": "ssusd",
"amount": "1000000000",
"display_amount": "1,000.00 ssUSD"
},
"fees": {
"network_fee": "0.02",
"priority_fee": "0.00",
"total_fee": "0.02"
},
"block_height": 1234568,
"created_at": "2024-01-15T11:00:00Z",
"confirmed_at": "2024-01-15T11:00:03Z"
}
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);
}
}
import requests
import uuid
class StablecoinTransfer:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = "https://api.stateset.com/v1/stablecoin"
def single_transfer(self, from_address, to_address, amount, memo=None):
"""Execute a single stablecoin transfer"""
url = f"{self.base_url}/transfer"
headers = {
"Authorization": f"Bearer {self.api_key}",
"Content-Type": "application/json"
}
data = {
"from": from_address,
"to": to_address,
"amount": {
"denom": "ssusd",
"amount": str(amount)
},
"idempotency_key": str(uuid.uuid4())
}
if memo:
data["memo"] = memo
try:
response = requests.post(url, json=data, headers=headers)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
print(f"Transfer failed: {e}")
return None
def batch_transfer(self, from_address, recipients):
"""Execute batch transfer to multiple recipients"""
url = f"{self.base_url}/transfer"
headers = {
"Authorization": f"Bearer {self.api_key}",
"Content-Type": "application/json"
}
transfers = []
for recipient in recipients:
transfers.append({
"to": recipient["address"],
"amount": {
"denom": "ssusd",
"amount": str(recipient["amount"])
},
"memo": recipient.get("memo", "")
})
data = {
"from": from_address,
"transfers": transfers,
"memo": "Batch transfer"
}
try:
response = requests.post(url, json=data, headers=headers)
response.raise_for_status()
result = response.json()
print(f"Batch transfer completed: {len(transfers)} recipients")
print(f"Total amount: {result['total_amount']['display_amount']}")
return result
except requests.exceptions.RequestException as e:
print(f"Batch transfer failed: {e}")
return None
# Example usage
transfer = StablecoinTransfer("YOUR_API_KEY")
# Single transfer
transfer.single_transfer(
"stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
"stateset1abcdefghijklmnopqrstuvwxyz123456789012",
1000000000, # 1000 ssUSD
"Invoice payment"
)
# Batch transfer
recipients = [
{"address": "stateset1abc...", "amount": 500000000, "memo": "Vendor A"},
{"address": "stateset1xyz...", "amount": 300000000, "memo": "Vendor B"}
]
transfer.batch_transfer(
"stateset1qypqxpq9qcrsszg2pvxq6rs0zqg3yyc5lzv7xu",
recipients
)
⌘I