NYYU Logo
APIDeposit

Create Stripe Payment for Deposit

Process credit card deposits into your wallet using Stripe payment gateway

Create Stripe Payment for Deposit

Process secure credit card deposits into your wallet using Stripe

Mutation

💳
stripeForDeposit
Create a Stripe payment for wallet deposit

Schema

stripeForDeposit(
  amount: Float!
  fiatAmount: Float!
  fiatType: String!
  cryptoType: String!
  paymentIntentId: String!
  paymentMethodId: String!
  isSaveCard: Boolean
): PayResponse

Parameters

amountRequired
Type: Float!
The amount to deposit in USD
fiatAmountRequired
Type: Float!
The amount in the payment currency (for currency conversion)
fiatTypeRequired
Type: String!
The payment currency (e.g., "USD", "EUR", "GBP")
cryptoTypeRequired
Type: String!
The cryptocurrency type (e.g., "USDT") - currently not functional
paymentIntentIdRequired
Type: String!
The payment intent ID obtained from Stripe
paymentMethodIdRequired
Type: String!
The payment method ID obtained from Stripe
isSaveCardOptional
Type: Boolean
Set to true to save card information for future payments

Return Value

📦
Returns PayResponse Object

Contains details needed to complete the Stripe payment including client secret and payment status

Example

💻
Usage Example
Creating a Stripe payment for $100 deposit
mutation {
  stripeForDeposit(
    amount: 100.0
    fiatAmount: 100.0
    fiatType: "USD"
    cryptoType: "USDT"
    paymentIntentId: "pi_1Fxxxxx"
    paymentMethodId: "pm_1Fxxxxx"
    isSaveCard: true
  ) {
    clientSecret
    paymentIntentId
    requiresAction
    error
  }
}

Response Example

📤
Sample Response
Successful payment response
{
  "data": {
    "stripeForDeposit": {
      "clientSecret": "pi_1Fxxxxx_secret_xxxxx",
      "paymentIntentId": "pi_1Fxxxxx",
      "requiresAction": false,
      "error": null
    }
  }
}

Integration Flow

🔄
Payment Processing Steps
Complete integration workflow
1
Initialize Stripe

Load Stripe.js in your frontend and create payment intent

2
Collect Card Details

Use Stripe Elements to securely collect card information

3
Call stripeForDeposit

Submit payment with Stripe IDs to create deposit transaction

4
Handle Response

Use clientSecret to confirm payment if requiresAction is true

Use Cases

💰
Instant Deposits

Add funds to your wallet immediately using credit/debit cards

🔒
Secure Payments

PCI-compliant payment processing through Stripe gateway

💳
Save Card for Future

Optionally save card details for faster future deposits

🌍
Multi-Currency

Support for multiple fiat currencies with automatic conversion

💡
Best Practice
Always handle the requiresAction flag in the response. When true, use Stripe's confirmCardPayment method with the clientSecret to complete 3D Secure authentication.