Debit-card funding
NinjaTrader Connect supports deposits from an approved saved debit card. The flow uses Stripe in the user’s client and NinjaTrader’s live REST API. For deposits funded with Apple Pay or Google Pay, see Wallet Pay Funding.
Prerequisites
Your integration needs:
- a bearer access token for the user
- the user’s eligible live
accountId, user ID, and the USDcurrencyId - Stripe.js or an applicable Stripe client integration
Complete the funding disclosures
Before the saved-card flow, the user must review and sign both funding disclosures:
- Form of Risk Disclosure and Customer Authorization
- Payment Processor Disclosure and Authorization
Both disclosures must be signed, but the signing order is not enforced. addStripeDebitCard and startStripeFunding reject requests when either disclosure is missing. Use the published signUserDocument operation by following Funding disclosures. If you prefer a hosted signing and funding flow, see Embedding the Funding Page with an iframe.
Get the Stripe publishable key
Call getStripeConfiguration to obtain the Stripe publishable key. Never send Stripe secret keys to the browser.
Check eligibility and limits
Call checkStripeFundingEligibility before the saved-card flow:
Use the returned minimumAmount and maximumAmount for the amount UI. Do not hard-code them. To validate a specific deposit, repeat the request with amount.
Stop when errorText is non-empty. While a deposit is still Pending, Suspended, Locked, or InTransit, a check without amount returns a maximumAmount lowered by that deposit’s amount, and an amount-specific check that is otherwise within limits returns a non-empty errorText and no maximumAmount. Reconcile that deposit and wait for it to settle instead of retrying.
Saved debit-card flow
-
Before registering the card, call
stripeFundingMethodDependentswith the user’s ID:If the result already contains a non-archived record with
status: Approved, don’t calladdStripeDebitCard. A user can have only one non-archived approved funding method. To fund from the saved card, use that record’s numericidasfundingMethodIdand continue to the Start Stripe Funding/Withdrawal section below. To replace it, calldeleteStripeFundingMethod, readstripeFundingMethod/depsagain, and confirm that the same numericidnow hasarchived: trueand is no longer a non-archived approved method before continuing.Otherwise, record the numeric
idof every existing funding method so you can identify the new record later. -
Use Stripe.js in the user’s browser to collect the billing details and create a Stripe PaymentMethod.
-
Call
addStripeDebitCardwith the Stripe string PaymentMethod ID: -
If the response is
HTTP 429or contains ap-ticket, stop, do not retry with the ticket, and follow Rate limits and Penalty tickets. -
Inspect the final registration response to choose the next step. Do not use
errorTextas the branch discriminator:
Resolve the approved funding-method ID
After addStripeDebitCard returns {}, call stripeFundingMethodDependents again with the same request. Compare the result with the IDs captured before registration. Continue only when there is exactly one new record and it has status: Approved.
Use the new record’s numeric id as fundingMethodId. Do not use Stripe’s pm_... identifier as the funding-method ID.
If there are zero or multiple new records, or the one new record is not Approved, stop the API flow. Do not call startStripeFunding or call addStripeDebitCard again for the same card. Use the NinjaTrader-hosted funding flow or contact NinjaTrader support.
Start Stripe Funding/Withdrawal
Call startStripeFunding with NinjaTrader’s approved numeric ID:
Before sending this request, and to reconcile the deposit afterward, follow Reconcile the funding outcome.
Next steps
- Call
startStripeFundingwith the approved numericfundingMethodIdto start the saved-card deposit, then reconcile the funding outcome. - Do not use
submitDebitCardFundingas the deposit operation. - If you prefer a NinjaTrader-hosted flow, see Embedding the Funding Page with an iframe.
- To fund a deposit with Apple Pay or Google Pay instead, see Wallet Pay Funding.