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.
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.
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.
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.
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.
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.
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.
Open a free CryptoPayr account and take your first crypto payment the same day.
Get started for freeWhy 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.
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.
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.