Quote and execute instant crypto-to-crypto swaps programmatically. No account, no API key — just
call the endpoints below. Every swap is tracked by its tracking_id. Base URL
https://cryptopayr.com.
tracking_id.from coin to the deposit address.to coin to your payout address. Poll status to follow along.Put the whole swap flow on your own site with a few lines — no backend, no API key. The widget is an isolated iframe that auto-resizes, matches your theme and accent colour, and can pay your referral wallet 50% of our fee on every swap. Loaded from https://cryptopayr.com/js/exchange-widget.js.
<div id="swap"></div>
<script src="https://cryptopayr.com/js/exchange-widget.js"></script>
<script>
new Exchange({
container: "#swap", // selector or element (required)
theme: "auto", // "light" | "dark" | "auto"
accent: "#08a05a", // your brand colour
referralWallet: "0xYourWallet", // earns 50% of our fee
referralTo: "USDT", // referral payout coin
referralNetwork: "TRON", // referral payout network
from: "BTC", to: "ETH", amount: 0.01, // optional defaults
rateType: "float", // "float" | "fixed"
lockCoins: false, // lock the coin selection
onComplete: function (e) { console.log("done", e.tracking); },
onStatus: function (e) { console.log("status", e.status); }
});
</script>
| Option | Description |
|---|---|
container | Selector or element to mount into (required). |
theme | light, dark or auto. |
accent | Brand colour, e.g. #08a05a. |
referralWallet / referralTo / referralNetwork | Your referral wallet + payout coin and network — earns 50% of our fee. |
from / to / fromNetwork / toNetwork | Default coins and networks. |
amount | Default send amount. |
rateType | float or fixed. |
lockCoins | Lock the coin selection to your defaults. |
width / height / radius | Widget size and corner radius. |
onCreated, onStatus, onComplete, onEvent — each is also dispatched as a cryptopayr-exchange:<event> DOM event on the container.
Declarative mount also works via data-cryptopayr-exchange + matching data-* attributes.
[cryptopayr_exchange] shortcode or Gutenberg block, themed from a settings screen.
/api/v1/swap/currenciesList supported coins, networks and the fee/limit metadata.
curl https://cryptopayr.com/api/v1/swap/currencies
/api/v1/swap/estimateQuote a receive amount. Params: from, from_network, to, to_network, amount, type (float|fixed).
curl "https://cryptopayr.com/api/v1/swap/estimate?from=BTC&from_network=BTC&to=ETH&to_network=ETH&amount=0.01&type=fixed"
/api/v1/swap/createCreate a swap. JSON body: from, from_network, to, to_network, amount, type, payout_address, refund_address?. Optional referral: referral_wallet_address, referral_wallet_to, referral_wallet_network — that wallet earns 50% of our service fee. Returns the deposit address + tracking id.
curl -X POST https://cryptopayr.com/api/v1/swap/create \
-H 'Content-Type: application/json' \
-d '{
"from":"BTC","from_network":"BTC",
"to":"ETH","to_network":"ETH",
"amount":0.01,"type":"float",
"payout_address":"0xYourEthAddress",
"refund_address":"bc1YourBtcRefund",
"referral_wallet_address":"0xYourReferralWallet",
"referral_wallet_to":"USDT",
"referral_wallet_network":"TRON"
}'
/api/v1/swap/statusFollow a swap. Param: id = the tracking id.
curl "https://cryptopayr.com/api/v1/swap/status?id=SWP-XXXX-YYYY"
/api/v1/swap/receiptEmail a receipt. JSON body: id, email. Only available 30 minutes after the swap ends.
curl -X POST https://cryptopayr.com/api/v1/swap/receipt \
-H 'Content-Type: application/json' \
-d '{"id":"SWP-XXXX-YYYY","email":"[email protected]"}'
AWAITING_DEPOSIT → CONFIRMING → EXCHANGING → SENDING → COMPLETED. Error paths: REFUND_PENDING → REFUNDED, or EXPIRED / FAILED.
Pass a referral_wallet_address (+ referral_wallet_to coin and referral_wallet_network) on create and that wallet earns 50% of our service fee on the swap, based on the amount actually received. Earnings accrue per wallet and are paid out automatically once the balance clears the minimum; small amounts roll over to the next swap.
refund_address (or the sending address if none was given).