NYYU Logo
APIDeposit

Create Stripe Payment with Saved Card

Process deposits using previously saved card information for faster checkout

Create Stripe Payment with Saved Card

Process fast and secure deposits using your saved card information

Mutation

stripeForDepositWithSavedCard
Quick deposit with saved card

Schema

stripeForDepositWithSavedCard(
  amount: Float!
  fiatAmount: Float!
  fiatType: String!
  cryptoType: String!
  cardId: Int!
  paymentIntentId: String!
): PayResponse

Parameters

amountRequired
Type: Float!
The amount to deposit in USD
fiatAmountRequired
Type: Float!
The amount in the payment currency
fiatTypeRequired
Type: String!
The payment currency (e.g., "USD", "EUR")
cryptoTypeRequired
Type: String!
The cryptocurrency type (e.g., "USDT")
cardIdRequired
Type: Int!
The ID of the saved card to use for payment
paymentIntentIdRequired
Type: String!
The payment intent ID from Stripe

Return Value

📦
Returns PayResponse Object

Contains payment confirmation details including client secret and status

Example

💻
Usage Example
Using saved card ID 456
mutation {
  stripeForDepositWithSavedCard(
    amount: 100.0
    fiatAmount: 100.0
    fiatType: "USD"
    cryptoType: "USDT"
    cardId: 456
    paymentIntentId: "pi_1Fxxxxx"
  ) {
    clientSecret
    paymentIntentId
    requiresAction
    error
  }
}

Response Example

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

Advantages

Faster Checkout

Skip card entry with one-click deposit using saved cards

🔒
Secure Storage

Card details securely stored by Stripe, never exposed to frontend

📱
Better UX

Streamlined experience for repeat deposits

💳
Multiple Cards

Users can save and choose from multiple payment methods

How to Get Card ID

🔑
Obtaining Card IDs
Where to find saved card information
1. Save Card During First Payment

When using stripeForDeposit, set isSaveCard: true to save the card

2. Retrieve Saved Cards

Use your user profile or payment methods query to list all saved cards with their IDs

3. Display Cards to User

Show last 4 digits and card brand for user to select which card to use

💡
Tip
This mutation is ideal for repeat customers. Combine it with a card management interface where users can view, add, or remove saved payment methods.