Welcome to the CryptoPay API documentation. This guide will help you integrate the CryptoPay API to accept cryptocurrency payments for your products or services. With our API, you can easily create payment links, check order status, and manage transactions with crypto.
This API endpoint allows you to create a payment link for a product or service, enabling your customers to pay with cryptocurrency.
$apiKey = "YOUR_API_KEY"; // Your unique API key $productName = "30 days premium"; // Product name $buyerEmail = "[email protected]"; // Buyer's email $price = 13.50; // Product price in USD $notificationURL = "https://yourwebsite.com/notification"; // URL to receive notifications on payment status $successfulURL = "https://yourwebsite.com/success"; // URL to redirect user on successful payment // Prepare post data $postData = "apikey=".$apiKey; $postData .= "&productName=".$productName; $postData .= "&buyerEmail=".$buyerEmail; $postData .= "&price=".$price; $postData .= "¬ificationURL=".$notificationURL; $postData .= "&successfulURL=".$successfulURL; // Call API $data = cURL("https://cryptopayapi.com/api/create", null, $postData); // Decode response $json = json_decode($data, true); // Get payment link $payLink = $json["payLink"]; // Display payment link echo $payLink;
{
"payLink": "https://cryptopayapi.com/pay/123456"
}
This API endpoint allows you to check the payment status of an order by its order ID.
$orderid = "ainr2Z900o"; // Order ID
$apiKey = "YOUR_API_KEY"; // Your unique API key
// Call API
$data = file_get_contents("https://cryptopayapi.com/api/orderinfo?apikey={$apiKey}&id={$orderid}");
// Decode response
$json = json_decode($data, true);
// Get payment status
$status = $json["status"];
{
"status": "paid",
"orderid": "ainr2Z900o",
"product": "30 days premium",
"cryptoReceived": "0.00114",
"cryptoAddress": "bc1q96xh067q3cccs36xgs98ywzk7ted9s7yex6lq3",
"cryptoAmount": "0.00114",
"cryptoSymbol": "BTC",
"cryptoTxID": "68b12214b1d35dd51277bcec64ebfe3f91d9a314f1bd657adb3c1020df0aa080",
"buyerIP": "100.200.170.10",
"buyerEmail": "[email protected]",
"priceUSD": "95.3",
"paidDate": "2025-03-04 09:09:23"
}
The CryptoPay API will return standard HTTP status codes to indicate the result of a request.
{
"error": "Invalid API key"
}