NYYU Logo
APIPresale Payment

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

createChargeForPresale
Generate deposit address for cryptocurrency payment

Schema

createChargeForPresale(
  presaleId: Int!
  orderId: Int!
  coin: String!
  network: String!
  cryptoType: String!
): CoinpaymentDepositTransaction

Parameters

presaleIdRequired
Type: Int!
The unique identifier of the presale round
orderIdRequired
Type: Int!
The ID of the presale order to pay for
coinRequired
Type: String!
The cryptocurrency coin symbol (e.g., "BTC", "ETH", "USDT")
networkRequired
Type: String!
The blockchain network (e.g., "Bitcoin", "Ethereum", "BSC", "Polygon")
cryptoTypeRequired
Type: String!
The cryptocurrency type identifier

Return Value

📦
Returns CoinpaymentDepositTransaction Object

Contains deposit address and transaction details for cryptocurrency payment

Example

💻
Bitcoin Payment Example
Generate BTC deposit address
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

📤
Sample Response
Deposit address generated
{
  "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

Bitcoin (BTC)

Network: Bitcoin

Ξ
Ethereum (ETH)

Network: Ethereum

Tether (USDT)

Networks: Ethereum, BSC, Polygon, Tron

Payment Flow

🔄
Cryptocurrency Payment Process
Complete blockchain payment workflow
1
Generate Deposit Address

Call createChargeForPresale to get a unique deposit address for the payment

2
Display Address to User

Show the deposit address and payment amount to the user with QR code

3
User Sends Cryptocurrency

User transfers cryptocurrency from their wallet to the deposit address

4
Blockchain Confirmation

Transaction is confirmed on the blockchain (confirmations vary by network)

5
Order Fulfillment

Once confirmed, the presale order is updated and tokens are delivered

Important Notes

⏱️
Confirmation Time

Bitcoin: ~10 min, Ethereum: ~1 min, BSC: ~3 sec. Wait for sufficient confirmations.

🔐
Unique Address

Each payment gets a unique deposit address for tracking and security

Network Selection

Ensure users select the correct network to avoid loss of funds

💰
Gas Fees

Users pay blockchain gas fees. Consider network congestion and fees

💡
Best Practice

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.