NYYU Logo
APIDeposit

Create PayPal Payment for Deposit Into the Wallet

Initiate a PayPal payment transaction to deposit funds into your wallet with secure order processing

💳

Create PayPal Payment for Deposit

Initiate a PayPal payment transaction to deposit funds into your wallet with secure order processing

Overview

The paypalForDeposit mutation allows users to create a PayPal payment for depositing funds into their wallet. This endpoint initiates a PayPal checkout session and returns the order details needed to complete the payment process. Once the PayPal order is created, users are redirected to PayPal to complete the payment.

🔧 Mutation Schema

paypalForDeposit(
  amount: Float!,
  currencyCode: String!,
  cryptoType: String!
): OrderResponseDTO

Parameters

amountRequired

Type: Float

The amount to deposit into the wallet. Must be a positive number representing the deposit value in the specified currency.

currencyCodeRequired

Type: String

The fiat currency code for the deposit (e.g., "USD", "EUR", "GBP"). This determines the currency that will be charged via PayPal.

cryptoTypeRequired

Type: String

The type of cryptocurrency to be credited to the wallet (e.g., "USDT"). Note: This is currently a placeholder and may not be functional.

Return Value

OrderResponseDTO

The mutation returns an OrderResponseDTO object containing the PayPal order details:

orderIdThe unique PayPal order identifier
redirectUrlThe PayPal checkout URL where users complete the payment

Example Usage

Example Mutation

The following example demonstrates how to create a PayPal payment for depositing $100 USD into the wallet:

mutation {
  paypalForDeposit(
    amount: 100.0,
    currencyCode: "USD",
    cryptoType: "USDT"
  ) {
    orderId
    redirectUrl
  }
}

Example Response

{
  "data": {
    "paypalForDeposit": {
      "orderId": "8VH12345ABC67890",
      "redirectUrl": "https://www.paypal.com/checkoutnow?token=8VH12345ABC67890"
    }
  }
}

Use Cases

💰

Wallet Funding

Enable users to quickly add funds to their wallet balance using PayPal for trading or purchases.

🔒

Secure Payments

Leverage PayPal's secure payment infrastructure for safe and reliable deposit transactions.

🌍

International Deposits

Accept deposits in multiple currencies from users worldwide through PayPal's global network.

Quick Checkout

Streamline the deposit process with PayPal's one-click checkout for returning users.

Important Notes

Payment Flow

After creating the PayPal order, you must redirect the user to the redirectUrl to complete the payment. Once the payment is completed, use the captureOrderForDeposit mutation to finalize the transaction and credit the user's wallet.

💡 Best Practices

  • Validate the amount before creating the PayPal order to ensure it meets minimum deposit requirements
  • Store the orderId for tracking and reconciliation purposes
  • Handle redirect errors gracefully if the user cancels the PayPal checkout
  • Implement timeout handling for cases where users don't complete the PayPal checkout