cURL
customerSwap
curl --request POST \ --url https://api-staging.stablestack.xyz/api/swaps \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data ' { "customer_id": "85b148ab-3f6b-4d55-917f-3c8de668a48e", "from_currency": "USDT", "to_currency": "USDC", "amount": "1" } '
200
success
{ "status": "success", "data": { "debitTransaction": { "id": "552e8bb6-e9bf-4956-ab3b-9e56cad65a04", "sender_wallet_id": "7c1c1825-75c2-4031-86ff-9c46ece29f6c", "receiver_wallet_id": "a0d8df69-5cb4-43e7-8746-5652576d7b8b", "transaction_id": "ICNZ1RG2VM", "asset_code": "usdt", "amount": "0.13000000", "reference_id": "e60637ec-e5d0-4c68-9bc8-a12658e5735e", "status": "PENDING", "created_at": "2025-05-21T13:25:08.478Z", "updated_at": "2025-05-21T13:25:08.478Z", "network": null, "crypto_transaction_id": null, "transaction_type": "INTERNAL TRANSFER", "transaction_mode": "DEBIT", "exchange_rate": "0.98", "fee": null, "withdrawal_recipient_name": null, "balance": "1.16240000", "reason": null, "customer_id": null }, "creditTransaction": { "id": "0ea5afd1-3a83-4f54-8116-062fe4680666", "sender_wallet_id": "7c1c1825-75c2-4031-86ff-9c46ece29f6c", "receiver_wallet_id": "a0d8df69-5cb4-43e7-8746-5652576d7b8b", "transaction_id": "8OXM5O9NPM", "asset_code": "usdc", "amount": "0.12000000", "reference_id": "e60637ec-e5d0-4c68-9bc8-a12658e5735e", "status": "PENDING", "created_at": "2025-05-21T13:25:08.478Z", "updated_at": "2025-05-21T13:25:08.478Z", "network": null, "crypto_transaction_id": null, "transaction_type": "INTERNAL TRANSFER", "transaction_mode": "CREDIT", "exchange_rate": "0.98", "fee": null, "withdrawal_recipient_name": null, "balance": "1.10000000", "reason": null, "customer_id": null }, "swapId": "e60637ec-e5d0-4c68-9bc8-a12658e5735e" }, "message": "Swap transaction successful"}
API reference for confirming and executing a currency swap
{ "customer_id": "85b148ab-3f6b-4d55-917f-3c8de668a48e", "from_currency": "USDT", "to_currency": "USDC", "amount": "1" }
{ "from_currency": "USDT", "to_currency": "USDC", "amount": "1" }
"USDT"
"USDC"
"20"
Required for customer, omit for merchant
"85b148ab-3f6b-4d55-917f-3c8de668a48e"
Swap executed successfully
"success"
Show child attributes
"e60637ec-e5d0-4c68-9bc8-a12658e5735e"
"Swap transaction successful"