πSwap Crypto
Swap crypto balances in your Swapped Commerce account
Why Swap via API?
Merchants may wish to enable Webhook-based payout orchestration.
You may want to settle all incoming payments to a Stablecoin, like USDT, and then allow a customer to receive a different token when receiving a Payout.
For example:
A customer deposits ~100.00 USDT equivalent of BTC (they pay BTC), which then the merchant auto-converts into USDT. Great, now the merchant has what they want: USDT
Now, a customer wishes to withdraw ~50.00 USDT equivalent of ETH, which can be sourced from the merchant's USDT balance.
Now you the Merchant need to convert ~$50.00 USDT into ETH, and initiate an ETH Payout to the end-customer.
How it works
GET a Quote for a Swap:
GET https://pay-api.swapped.com/v1/convert/quote?fromCurrency=USDT&fromAmount=50&toCurrency=ETHPOST a Swap:
POST https://pay-api.swapped.com/v1/convert { "fromAmount": "50", "fromCurrency": "USDT", "toCurrency": "ETH" }Listen for Webhooks to get the amount, then proceed with your next action (e.g: Send a Crypto Payout):
POST https://pay-api.swapped.com/v1/payouts { "payouts": [ { chain: "ethereum", currency: "ETH", amount: "0.004521", memo: "", // optional address: "0x0123456789..." customerName: "John Doe", customerEmail: "[email protected]" } ] }
You've now successfully enabled dynamic payouts from your USDT balance to any crypto a customer might wish to receive.
Gets a quote to perform a conversion for the authenticated merchant
^(?:[1-9]\d*|0?\.\d+|\d+\.\d+)$Successful
Successful
Last updated