CoinPayment Create Payment API
Accept cryptocurrency payments through CoinPayments with support for Bitcoin, Ethereum, and 100+ altcoins
CoinPayment Create Payment API
Accept cryptocurrency payments from customers worldwide. Support for Bitcoin, Ethereum, Litecoin, and 100+ other cryptocurrencies through CoinPayments integration.
100+ Cryptocurrencies
Accept Bitcoin, Ethereum, Litecoin, and many more altcoins.
Decentralized
No chargebacks or payment reversals. Secure blockchain transactions.
Low Fees
Significantly lower transaction fees compared to traditional payments.
Endpoint Overview
/graphqlCreate a cryptocurrency payment through CoinPayments. Returns wallet address, amount, QR code, and checkout URL for the customer to complete payment.
Request Parameters
categoryPaymentCategory!RequiredThe category of the payment. Values: SUBSCRIPTION, ONE_TIME, ADDON.
groupIdIntRequiredThe ID of the subscription group/plan associated with the payment.
moreLoginCountIntRequiredNumber of additional logins to purchase (set to 0 if not needed).
coinString!RequiredThe cryptocurrency to use for payment. Examples: BTC, ETH, LTC, USDT.
Supported Cryptocurrencies
BTC
Bitcoin
ETH
Ethereum
LTC
Litecoin
USDT
Tether USD
GraphQL Mutation
mutation coinpaymentCreatePayment(
$category: PaymentCategory!
$groupId: Int
$moreLoginCount: Int
$coin: String!
) {
coinpaymentCreatePayment(
category: $category
groupId: $groupId
moreLoginCount: $moreLoginCount
coin: $coin
) {
id
error
address
amount
txn_id
confirms_needed
timeout
checkout_url
status_url
qrcode_url
}
}Variables:
{
"category": "SUBSCRIPTION",
"groupId": 1,
"moreLoginCount": 0,
"coin": "BTC"
}HTTP Request:
curl -X POST https://api.orbnet.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-d '{
"query": "mutation coinpaymentCreatePayment($category: PaymentCategory!, $groupId: Int, $moreLoginCount: Int, $coin: String!) { coinpaymentCreatePayment(category: $category, groupId: $groupId, moreLoginCount: $moreLoginCount, coin: $coin) { id address amount txn_id confirms_needed timeout checkout_url qrcode_url error } }",
"variables": {
"category": "SUBSCRIPTION",
"groupId": 1,
"moreLoginCount": 0,
"coin": "BTC"
}
}'Response
address
Cryptocurrency wallet address where the customer should send payment.
amount
Exact amount of cryptocurrency the customer needs to send.
qrcode_url
URL to a QR code image for easy mobile wallet scanning.
checkout_url
CoinPayments hosted checkout page URL for the transaction.
timeout
Timestamp when the payment request expires.
confirms_needed
Number of blockchain confirmations required to complete payment.
{
"data": {
"coinpaymentCreatePayment": {
"id": "CPFK4WLSPWSKN0",
"error": null,
"address": "1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2",
"amount": "0.00125000",
"txn_id": "CPFK4WLSPWSKN0",
"confirms_needed": "2",
"timeout": "2025-01-15T12:30:00Z",
"checkout_url": "https://www.coinpayments.net/index.php?cmd=checkout&id=CPFK4WLSPWSKN0",
"status_url": "https://www.coinpayments.net/index.php?cmd=status&id=CPFK4WLSPWSKN0",
"qrcode_url": "https://www.coinpayments.net/qrgen.php?id=CPFK4WLSPWSKN0"
}
}
}{
"errors": [
{
"message": "Unsupported cryptocurrency",
"path": ["coinpaymentCreatePayment"],
"extensions": {
"code": "INVALID_COIN"
}
}
],
"data": null
}Payment Flow
Create Payment
Call this API with the selected cryptocurrency to generate a payment address and amount.
Display Payment Info
Show the wallet address, amount, and QR code to the customer. Include timeout countdown.
Customer Sends Crypto
Customer sends the exact amount from their wallet to the provided address.
Wait for Confirmations
System waits for blockchain confirmations. Use status_url or webhooks to monitor.
Payment Complete
Once confirmed, subscription is activated automatically.
Best Practices
Display QR Code
Always show the QR code for easy mobile wallet scanning. Embed the qrcode_url in an image tag.
Show Exact Amount
Display the exact crypto amount. Underpayments may not be processed correctly.
Countdown Timer
Show a countdown to the timeout. Crypto prices fluctuate, so payments must complete in time.
Copy Button
Provide easy copy buttons for the wallet address and amount to prevent typos.
Related Endpoints
Payment Timeout
Cryptocurrency payments have a timeout period (usually 1-2 hours). If the customer doesn't send payment within this window, the exchange rate may change and a new payment request will be needed.
Accept Cryptocurrency
Expand your payment options with Bitcoin, Ethereum, and 100+ other cryptocurrencies. No chargebacks, low fees, global reach.