Create swap
Creates a Solana EURC↔USDC swap and returns a deposit address.
RemitFlex does not custody funds. Deposit the from token to depositAddress before expiry.
refundTo is always required. Tied to customerId (defaults to org primary customer).
Requires api:write scope and an Idempotency-Key header.
curl -X POST https://api.remitflex.io/v1/swaps \
-H "Authorization: Bearer $REMITFLEX_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"from":"USDC","to":"EURC","amount":100,"tradeType":"exact_input","destinationAddress":"2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB","refundTo":"2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB"}'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: 'USDC',
to: 'EURC',
amount: 100,
destinationAddress: '2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB',
refundTo: '2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB'
})
};
fetch('http://localhost:4000/v1/swaps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:4000/v1/swaps"
payload = {
"from": "USDC",
"to": "EURC",
"amount": 100,
"destinationAddress": "2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB",
"refundTo": "2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": "error",
"message": "Idempotency-Key header is required for API key requests"
}{
"status": "error",
"message": "Unsupported currency pair"
}Authorizations
API key created in the Remitflex Dashboard at dashboard.remitflex.io (rmf_live_... or rmf_test_...).
Key management endpoints require a dashboard JWT and are not part of this reference.
Headers
Unique key for safe retries on mutating API-key requests. Cached for 24 hours per org, method, and path.
255"7f3c2a1b-4e5d-6c7b-8a9f-0e1d2c3b4a5f"
Body
Source currency on Solana.
USDC, EURC "USDC"
Destination currency on Solana.
USDC, EURC "EURC"
Human-readable amount. For exact_input, amount to send. For exact_output, amount to receive.
x <= 1000000000100
Solana address to receive swapped tokens.
32 - 64"2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB"
Solana address for Relay refunds (always required).
32 - 64"2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB"
Whether amount is the send side or receive side.
exact_input, exact_output Customer under your org. Defaults to the org primary customer.
1 - 128curl -X POST https://api.remitflex.io/v1/swaps \
-H "Authorization: Bearer $REMITFLEX_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"from":"USDC","to":"EURC","amount":100,"tradeType":"exact_input","destinationAddress":"2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB","refundTo":"2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB"}'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: 'USDC',
to: 'EURC',
amount: 100,
destinationAddress: '2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB',
refundTo: '2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB'
})
};
fetch('http://localhost:4000/v1/swaps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "http://localhost:4000/v1/swaps"
payload = {
"from": "USDC",
"to": "EURC",
"amount": 100,
"destinationAddress": "2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB",
"refundTo": "2dudFU32c5wsRpfRZDXBAJFirHC4hindqpKSCwwtDaAB"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": "error",
"message": "Idempotency-Key header is required for API key requests"
}{
"status": "error",
"message": "Unsupported currency pair"
}