Payments
Crypto Payments — Hosted checkout & API for 30+ coins White Label — Your brand on the entire payment flow Processing — Auto-convert, withdrawals & controls Payouts — Mass crypto payouts by API or file Platform — Marketplace payments & commissions
Plugins Affiliate Pricing Blog Docs Contact
Sign in
All articles

How to Take Your First API Payment (Quickstart)

Three steps from nothing to a working crypto payment: grab a key, create a charge, then mark the order paid when the webhook lands. Copy the curl call and you have it running in five minutes.

CryptoPayr Jun 3, 2026 3 min read

If you can send a POST request, you can take a crypto payment. There is no SDK to install and nothing to compile. You ask for a payment, you get back a checkout URL, you send your buyer to it, and you find out it is paid from a webhook. Here is the whole thing, start to finish.

Step 1: Get your API key

Log in and open Developers in your dashboard. Copy your API key from there. It is a bearer token, so every request carries it in an Authorization header. Keep it server side and never put it in front-end code, since anyone holding the key can create payments on your account.

Step 2: Create a payment

One call does it. Send an amount and a 3-letter fiat currency, and you get back a hosted checkout URL.

curl -X POST https://cryptopayr.com/api/v1/payment/create \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 49.00,
    "currency": "USD",
    "webhook_url": "https://yoursite.com/hooks/cryptopayr"
  }'

The response comes back in the same envelope every endpoint uses:

{
  "status": "success",
  "message": "Payment created",
  "data": {
    "tid": "txn_...",
    "status": "CREATED",
    "amount": 49,
    "currency": "USD",
    "checkout_url": "https://cryptopayr.com/payment/txn_..."
  }
}

Save the tid against your order so you can match the payment later. Then send the buyer to checkout_url. That page handles coin choice, the live rate, the QR code and confirmations for you, so there is nothing else to build on the customer side.

A few optional fields are worth knowing about. Pass success_url and cancel_url to control where the buyer lands afterwards. Set buyer_pays_fees to 1 if you want the customer to cover the processing fee. Drop your order number into metadata so it travels with the payment. You can also pin a coin with pay_currency if you only want, say, USDT.

Step 3: Confirm the payment

Do not mark an order paid because the buyer came back to your success page. They might close the tab early, and a redirect is not proof of payment. The webhook is. When the payment confirms on-chain, CryptoPayr POSTs to your webhook_url with the transaction details. Verify it, then fulfil the order.

Each webhook is signed. Read the X-CryptoPayr-Signature header, compute an HMAC-SHA256 of the raw request body using your API key as the secret, and compare the two with a constant-time check. If they match, the call really came from us. If they do not, throw it away.

$raw  = file_get_contents('php://input');
$sig  = $_SERVER['HTTP_X_CRYPTOPAYR_SIGNATURE'] ?? '';
$mine = hash_hmac('sha256', $raw, 'YOUR_API_KEY');
if (hash_equals($mine, $sig)) {
    // genuine: look up the tid, mark the order paid
}

If you would rather poll instead of waiting for the webhook, call payment/lookup with the tid and read the status back. Webhooks are the better default because they fire the moment the money lands.

That is the whole loop

Create, redirect, confirm. Once those three are wired up you have a working crypto checkout, and every other endpoint (payouts, refunds, transfers, balance) follows the same key and the same response shape. The full field list and every endpoint live in the API reference. Go grab a key and run the curl call against a small amount to watch it work end to end.

Start accepting crypto today

Open a free CryptoPayr account and take your first crypto payment the same day.

Get started for free

Keep reading

🧭 Crypto 101

Coins, Networks and Confirmations: The Three Words That Demystify Crypto Checkout

Why does a crypto checkout ask which "network"? What's a confirmation, and why wait for one? Three words explain almost everything a merchant needs to know — here they are, in plain language.

Jun 10, 2026 · 3 min Read →
🛡️ Company

Where Your Money Lives: How CryptoPayr Keeps Funds and Data Safe

Handing a payment gateway your revenue is an act of trust. Here's a plain account of how CryptoPayr handles your balance, your keys and your customers' data — and the boundaries we hold.

Jun 10, 2026 · 3 min Read →
🔗 Product

Get Paid Without an Invoice: Reusable Payment Links

Sometimes you don't need a store or an integration — you need a link you can send. Here's how reusable payment links let you charge a fixed price or take any amount, with nothing to build.

Jun 10, 2026 · 3 min Read →