Place A New Presale Order
Create presale orders with customizable NDB token amounts and destination options
Place Presale Order
Create a new presale order with flexible destination options for NDB token delivery
Mutation
Schema
placePreSaleOrder(
presaleId: Int!
ndbAmount: Float!
destination: Int!
extAddr: String
): PreSaleOrder
Parameters
presaleId
RequiredInt!
ndbAmount
RequiredFloat!
destination
RequiredInt!
1
Internal - Tokens sent to your NYYU wallet2
External - Tokens sent to an external wallet addressextAddr
OptionalString
External wallet address for NDB token delivery. Required when destination is 2
Return Value
Contains the created presale order with initial status of 0 (pending payment confirmation)
Example
mutation {
placePreSaleOrder(
presaleId: 1
ndbAmount: 500.0
destination: 1
) {
id
presaleId
userId
ndbAmount
destination
status
createdAt
updatedAt
}
}
mutation {
placePreSaleOrder(
presaleId: 1
ndbAmount: 500.0
destination: 2
extAddr: "0x1234567890abcdef1234567890abcdef12345678"
) {
id
presaleId
userId
ndbAmount
destination
extAddr
status
createdAt
updatedAt
}
}
Response Example
{
"data": {
"placePreSaleOrder": {
"id": 12345,
"presaleId": 1,
"userId": "user_abc123",
"ndbAmount": 500.0,
"destination": 2,
"extAddr": "0x1234567890abcdef1234567890abcdef12345678",
"status": 0,
"createdAt": 1634567890,
"updatedAt": 1634567890
}
}
}
Order Workflow
Call placePreSaleOrder
with presale ID, amount, and destination. Order is created with status 0 (pending)
Use one of the payment methods (Stripe, PayPal, Crypto, or Wallet) to pay for the order
Payment gateway confirms the transaction and updates order status
NDB tokens are delivered to the specified destination (internal wallet or external address)
Important Notes
The order is created with status 0 (pending). It must be confirmed through a payment method before token delivery.
When destination is 2 (external), you must provide a valid external wallet address in the extAddr field.
Choosing destination 1 (internal) delivers tokens to your NYYU wallet automatically upon payment confirmation.
Use the returned order ID to track payment status and token delivery through other API endpoints.
Always validate the external address format on the frontend before submitting. For Ethereum addresses, ensure they are valid checksummed addresses. Store the order ID immediately after creation for payment processing and order tracking.