Pay For Presale In Cryptocurrency
Accept cryptocurrency payments via blockchain deposit addresses
Cryptocurrency Payment
Accept Bitcoin, Ethereum, USDT and other cryptocurrencies for presale orders
Mutation
Schema
createChargeForPresale(
presaleId: Int!
orderId: Int!
coin: String!
network: String!
cryptoType: String!
): CoinpaymentDepositTransaction
Parameters
presaleId
RequiredInt!
orderId
RequiredInt!
coin
RequiredString!
network
RequiredString!
cryptoType
RequiredString!
Return Value
Contains deposit address and transaction details for cryptocurrency payment
Example
mutation {
createChargeForPresale(
presaleId: 1
orderId: 123
coin: "BTC"
network: "Bitcoin"
cryptoType: "Bitcoin"
) {
txnId
presaleId
orderId
userId
coin
network
cryptoType
depositAddress
status
createdAt
updatedAt
}
}
Response Example
{
"data": {
"createChargeForPresale": {
"txnId": "TXN123456",
"presaleId": 1,
"orderId": 123,
"userId": "user_abc123",
"coin": "BTC",
"network": "Bitcoin",
"cryptoType": "Bitcoin",
"depositAddress": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
"status": 0,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}
}
Supported Cryptocurrencies
Network: Bitcoin
Network: Ethereum
Networks: Ethereum, BSC, Polygon, Tron
Payment Flow
Call createChargeForPresale to get a unique deposit address for the payment
Show the deposit address and payment amount to the user with QR code
User transfers cryptocurrency from their wallet to the deposit address
Transaction is confirmed on the blockchain (confirmations vary by network)
Once confirmed, the presale order is updated and tokens are delivered
Important Notes
Bitcoin: ~10 min, Ethereum: ~1 min, BSC: ~3 sec. Wait for sufficient confirmations.
Each payment gets a unique deposit address for tracking and security
Ensure users select the correct network to avoid loss of funds
Users pay blockchain gas fees. Consider network congestion and fees
Display the deposit address as both text and QR code for easy scanning. Show real-time confirmation status to users. Implement webhook handlers to detect incoming transactions. Warn users about network selection and provide clear instructions. Set appropriate confirmation requirements based on payment amount.