CryptoPayr Docs
Dashboard Get API key

Public · keyless · rate-limited

Exchange API

Quote and execute instant crypto-to-crypto swaps programmatically. No account, no API key: call the endpoints below. Every swap is tracked by its tracking_id.

Base URL https://cryptopayr.com

How a swap works

  1. Estimate the receive amount for a pair and amount (float or fixed rate).
  2. Create the order with a payout address (and an optional refund address). You get a deposit address and a tracking_id.
  3. Send the from coin to the deposit address.
  4. On confirmation we pay the to coin to your payout address. Poll the status to follow along.

Embeddable widget

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>

Options

OptionDescription
containerRequired Selector or element to mount into.
themelight, dark or auto.
accentBrand colour, e.g. #08a05a.
referralWallet / referralTo / referralNetworkYour referral wallet plus its payout coin and network. Earns 50% of our fee.
from / to / fromNetwork / toNetworkDefault coins and networks.
amountDefault send amount.
rateTypefloat or fixed.
lockCoinsLock the coin selection to your defaults.
width / height / radiusWidget size and corner radius.

Callbacks

onCreated, onStatus, onComplete and onEvent. Each is also dispatched as a cryptopayr-exchange:<event> DOM event on the container. Declarative mounting works too, via data-cryptopayr-exchange and matching data-* attributes.

On WordPress? Skip the code: install the CryptoPayr Exchange plugin and drop the widget on any page with a [cryptopayr_exchange] shortcode or Gutenberg block, themed from a settings screen.

List currencies

GET/api/v1/swap/currenciesNo key

Supported coins and networks, with the fee and limit metadata.

curl https://cryptopayr.com/api/v1/swap/currencies

Get a quote

GET/api/v1/swap/estimateNo key

Quote a receive amount. Params: from, from_network, to, to_network, amount, type (float or fixed). The minimum depends on the pair: min_usd (and min_from, the same amount in the coin you send) is the smallest deposit the destination coin can be paid out on; BTC payouts, for example, need about $9. amount_ok tells you whether amount is in range.

curl "https://cryptopayr.com/api/v1/swap/estimate?from=BTC&from_network=BTC&to=ETH&to_network=ETH&amount=0.01&type=fixed"

Create a swap

POST/api/v1/swap/createNo key

JSON body: from, from_network, to, to_network, amount, type, payout_address and an optional 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 and the 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"
  }'

Swap status

GET/api/v1/swap/statusNo key

Follow a swap. Param: id, the tracking id.

curl "https://cryptopayr.com/api/v1/swap/status?id=SWP-XXXX-YYYY"

Email a receipt

POST/api/v1/swap/receiptNo key

JSON body: id, email. 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]"}'

Status values

AWAITING_DEPOSIT → CONFIRMING → EXCHANGING → SENDING → COMPLETED

Error paths: REFUND_PENDING → REFUNDED, or EXPIRED / FAILED.

Referrals

Pass a referral_wallet_address (with a 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.

Notes

  • No authentication. Endpoints are rate-limited per IP; back off on HTTP 429.
  • If you send a different amount than quoted, the receive amount adjusts to what actually arrives.
  • On any error we refund the deposit to your refund_address (or the sending address if none was given).