NYYU Logo
APIPresale Payment

Pay For Presale With PayPal

Create PayPal checkout orders for presale payments with redirect flow

PayPal Checkout for Presale

Accept presale payments through PayPal's secure checkout flow

Mutation

🅿️
paypalForPresale
Create a PayPal checkout order and get redirect URL

Schema

paypalForPresale(
  presaleId: Int!
  orderId: Int!
  currencyCode: String!
): OrderResponseDTO

Parameters

presaleIdRequired
Type: Int!
The unique identifier of the presale round
orderIdRequired
Type: Int!
The ID of the presale order to pay for
currencyCodeRequired
Type: String!
The currency code for the payment (e.g., "USD", "EUR", "GBP")

Return Value

📦
Returns OrderResponseDTO Object

Contains PayPal order ID and redirect URL for checkout

Example

💻
Usage Example
Create PayPal checkout order in USD
mutation {
  paypalForPresale(
    presaleId: 1
    orderId: 123
    currencyCode: "USD"
  ) {
    orderId
    redirectUrl
  }
}

Response Example

📤
Sample Response
PayPal order created successfully
{
  "data": {
    "paypalForPresale": {
      "orderId": "5O190127TN364715T",
      "redirectUrl": "https://www.paypal.com/checkoutnow?token=5O190127TN364715T"
    }
  }
}

Integration Flow

🔄
PayPal Payment Flow
Complete checkout workflow
1
Create PayPal Order

Call paypalForPresale mutation to create a PayPal checkout order

2
Redirect to PayPal

Redirect user to the PayPal checkout page using the redirectUrl from response

3
User Completes Payment

User logs into PayPal and approves the payment

4
Return to Your Site

PayPal redirects user back to your return URL with order details

5
Capture Order

Call captureOrderForPresale mutation to complete the payment and update order status

Use Cases

💰
PayPal Balance

Allow users to pay directly from their PayPal account balance

🔗
Linked Bank Accounts

Users can pay via bank accounts linked to their PayPal

💳
PayPal Credit

Support for PayPal Credit and Buy Now Pay Later options

🌍
Global Reach

Accept payments from PayPal users worldwide in multiple currencies

Important Notes

⚠️
Two-Step Process

PayPal payments require two steps: creating the order (this mutation) and capturing it after user approval.

🔗
Redirect Required

Users must be redirected to PayPal's checkout page. This cannot be done in an iframe or popup.

Return URL

Configure return and cancel URLs in your PayPal settings to handle post-payment redirects.

💡
Order Expiry

PayPal orders expire after 3 hours. Users must complete checkout within this timeframe.

💡
Best Practice

Store the PayPal orderId in your database immediately after receiving it. Handle the return URL to capture the order using the captureOrderForPresale mutation. Implement timeout handling for expired orders and provide clear user feedback during the redirect flow.