Skip to content

Preview First Deposit ​

Read-only dry-run for the card-open first deposit. It computes exactly what /card/apply would charge for a given first_deposit_amount — the fee on the excess, the amount credited to the card, and the total wallet freeze — without opening a card, writing anything, or freezing funds.

Use it to render a "what you'll pay" breakdown before the customer confirms, so the numbers match the real open 1:1.

What is the first deposit?

The card config defines a base initial deposit (base_amount) that is credited 1:1 with no fee. A merchant may top this up by sending a larger first_deposit_amount on apply; the part above the base (the excess) is charged a recharge-style fee, and the remainder is credited to the card 1:1 (USDT/USD, no FX). The final first deposit sent to the provider is always an integer.

The config may additionally set a minimum first deposit (min_first_deposit_amount, always ≥ base_amount): the total first_deposit_amount must be at least that value, while only the base part stays fee-free. Example: base_amount=10, min_first_deposit_amount=500 → the customer must deposit at least 500, of which 10 is fee-free and 490 is charged the recharge fee.

Endpoint ​

ItemValue
MethodPOST
Path/api/v1/openapi/card/first_deposit/preview
AuthHMAC
IdempotencyNot required (read-only)

Request Fields ​

FieldTypeRequiredDescription
header_idstring✅hdr_<id> (List Card Headers)
package_idstring✅pkg_<id> (List Card Configs)
first_deposit_amountstringoptionalTotal first deposit, non-negative integer, in the pay/recharge asset unit (e.g. USDT). Empty = use the config base. Must be >= min_first_deposit_amount (which is itself >= base_amount); when the minimum is above the base, an empty value is rejected with first_recharge_below_min. Scientific notation, decimals, and signs are rejected.

Example Request ​

json
{
  "header_id": "hdr_119",
  "package_id": "pkg_33",
  "first_deposit_amount": "16"
}

Response Fields ​

Not submittable is still a success response (graceful)

When the amount — or the package, the account's eligibility or its balance — would make apply fail, this endpoint still returns a success envelope (HTTP 200, code: 0) with is_valid=false and a stable invalid_reason. Read is_valid to decide whether apply would be accepted. Only a malformed request, an unknown or unsupported header, an account-manager restriction on the header, or a server fault return an error envelope (code ≠ 0) — see Common Errors.

Why an unknown package is not an error, but an unknown header is

The header is resolved before the dry run: it decides whether the channel may use this card type and whether your account manager has opened it, so a missing / unknown header is rejected with openapi_invalid_header_id. The package is then evaluated as part of the dry run itself, so an unknown or inactive package_id comes back as is_valid=false + invalid_reason: bank_card_config_not_found (only a malformed package_id is rejected with openapi_invalid_package_id). This is intentional.

Which fields are present ​

The dry run goes through stages and stops at the first problem. Fields of stages that were not reached are omitted from the response (since v1.5; earlier versions sent "" / 0 / false placeholders that looked like real values). When is_valid=true every stage completed and every field below is present (except the per-field exceptions noted in the table). Parse defensively: treat an absent field as "not computed", never as zero.

StageFieldsPresent when
Alwayspackage_id, is_valid, invalid_reason (only when is_valid=false), warnings (only when non-empty)Always
① Packagecurrency, open_card_fee, base_amount, min_first_deposit_amount, request_amount, min_recharge_amount, max_recharge_amountThe package could be loaded — absent when the package does not exist (bank_card_config_not_found)
② Configurationcard_type, pay_asset_symbol, fee_type, fee_rate, fee_fixed, deposit_required, deposit_amount, deposit_asset_symbol, deposit_refund_daysThe package / header / card-type checks passed — absent for every bank_card_* reason
③ Amount breakdownexcess_amount, excess_fee_amount, excess_fee_asset_symbol, excess_settle_amount, excess_card_amount, exchange_rate, first_recharge_card, total_freeze, deposit_in_total_freezeThe first deposit could be computed — present when valid and for insufficient_balance, card_deposit_insufficient_balance, first_recharge_exceeds_max; for first_recharge_excess_too_small, kyc_required and card_deposit_config_invalid only if the amount itself could be computed; absent for the other amount reasons
④ Walletwallet_balance, wallet_balance_sufficient, usd_balance, will_use_usd, usd_needed, deposit_wallet_balance, deposit_wallet_balance_sufficientThe wallet freeze was simulated — only when is_valid=true or invalid_reason is insufficient_balance / card_deposit_insufficient_balance

When invalid_reason is kyc_required or card_deposit_config_invalid, the eligibility check rejected the account before a deposit could be determined: the deposit fields are present with "no deposit" values (deposit_required=false, deposit_amount="0") — do not read them as "no deposit will be needed".

FieldTypeStageDescription
package_idstringAlwaysEcho, pkg_<id>
card_typestring②Lowercase business code, e.g. virtual_v
currencystring①Card currency (e.g. USD)
pay_asset_symbolstring②Pay/recharge asset symbol (e.g. USDT); also omitted if the package has no pay asset configured
open_card_feestring (decimal)①Open-card fee (pay asset)
base_amountstring (decimal)①Base initial deposit — credited 1:1, no fee
min_first_deposit_amountstring (decimal)①Effective minimum total first deposit (max(base_amount, package/header minimum)), base included. first_deposit_amount must be ≥ this; when it is above base_amount the empty default (base) is rejected
request_amountstring (decimal)①The total first deposit being evaluated (when the amount could not be computed, an echo of your input, or base_amount if you sent none)
excess_amountstring (decimal)③Excess above base (request_amount − base_amount)
excess_fee_amountstring (decimal)③Fee charged on the excess (fee asset); "0" when there is no excess
excess_fee_asset_symbolstring③Fee asset symbol; omitted when there is no excess
excess_settle_amountstring (decimal)③Excess after fee, before integer rounding
excess_card_amountstring (decimal)③Excess actually credited to the card (after rounding)
exchange_ratestring③Compatibility field; USDT/USD is 1:1, so it is always omitted
first_recharge_cardstring (decimal)③Total credited to the card (base + excess credited); integer
total_freezestring (decimal)③Total wallet freeze in the pay asset (open_card_fee + amount credited + excess fee + deposit when deposit_in_total_freeze=true); rounding remainder is not charged
deposit_requiredbool②Whether this application will freeze a card-open deposit (same gate decision as /card/apply: mode 2 always; mode 3 only when KYC is not yet passed; mode 4 after KYC passes)
deposit_amountstring (decimal)②Deposit amount in the deposit asset; "0" when no deposit
deposit_asset_symbolstring②Deposit asset symbol (e.g. USDT / USD); "" when no deposit
deposit_refund_daysint②Days after card closure before the deposit refund can be requested (0 = enters refund review right after closure)
deposit_in_total_freezebool③true = deposit asset equals the pay asset and the deposit is already included in total_freeze; false = not included (no deposit, or a different asset — show it separately)
deposit_wallet_balancestring (decimal)④Available balance of the deposit asset; "0" when no deposit
deposit_wallet_balance_sufficientbool④Whether the deposit freeze would succeed, simulated in the real apply order (open fee + first deposit first, then deposit; USDT topped up 1:1 from USD); always true when no deposit
fee_typeint②Recharge fee type: 1=fixed 2=percent 3=mixed
fee_ratestring②Rate (percent / mixed); omitted otherwise
fee_fixedstring②Fixed fee (fixed / mixed); omitted otherwise
min_recharge_amountstring (decimal)①Config min recharge (display)
max_recharge_amountstring (decimal)①Config max recharge — the excess is capped by this
wallet_balancestring (decimal)④Your account's available balance in the pay asset
wallet_balance_sufficientbool④Whether the balance (incl. USD 1:1 top-up) covers total_freeze
usd_balancestring (decimal)④Your USD balance (used only for the USDT→USD 1:1 top-up check)
will_use_usdbool④Whether the USD 1:1 top-up would be used
usd_neededstring (decimal)④USD amount that would be drawn via the top-up
is_validboolAlwaysWhether apply would be accepted with this amount
invalid_reasonstringAlwaysStable reason code when is_valid=false (omitted when valid) — see invalid_reason Codes
warningsstring[]AlwaysOptional advisory codes; omitted when there are none

Example Response (valid) ​

json
{
  "code": 0,
  "message": "Success",
  "data": {
    "package_id": "pkg_33",
    "card_type": "virtual_v",
    "currency": "USD",
    "pay_asset_symbol": "USDT",
    "open_card_fee": "1.000000000000000000",
    "base_amount": "10",
    "min_first_deposit_amount": "10",
    "request_amount": "16",
    "excess_amount": "6",
    "excess_fee_amount": "1.22",
    "excess_fee_asset_symbol": "USDT",
    "excess_settle_amount": "4.78",
    "excess_card_amount": "4",
    "first_recharge_card": "14",
    "total_freeze": "16.22",
    "deposit_required": false,
    "deposit_amount": "0",
    "deposit_asset_symbol": "",
    "deposit_refund_days": 0,
    "deposit_in_total_freeze": false,
    "deposit_wallet_balance": "0",
    "deposit_wallet_balance_sufficient": true,
    "fee_type": 3,
    "fee_rate": "0.020000",
    "fee_fixed": "1.100000000000000000",
    "min_recharge_amount": "10.000000000000000000",
    "max_recharge_amount": "100.000000000000000000",
    "wallet_balance": "70.82999088",
    "wallet_balance_sufficient": true,
    "usd_balance": "0",
    "will_use_usd": false,
    "usd_needed": "0",
    "is_valid": true
  }
}

In this example a 16 first deposit on a base=10 config keeps 10 free (1:1), and the 6 excess is charged a 1.22 fee, leaving 4 credited — so the card receives 14 and the wallet is frozen 16.22.

Example Response (not submittable — amount below the minimum) ​

first_deposit_amount: "100" on a package whose minimum first deposit is 500. The amount breakdown (③) and wallet (④) stages were not reached, so those fields are absent:

json
{
  "code": 0,
  "message": "Success",
  "data": {
    "package_id": "pkg_33",
    "card_type": "virtual_v",
    "currency": "USD",
    "pay_asset_symbol": "USDT",
    "open_card_fee": "1.000000000000000000",
    "base_amount": "10.000000000000000000",
    "min_first_deposit_amount": "500",
    "request_amount": "100",
    "deposit_required": false,
    "deposit_amount": "0",
    "deposit_asset_symbol": "",
    "deposit_refund_days": 0,
    "fee_type": 3,
    "fee_rate": "0.020000",
    "fee_fixed": "1.100000000000000000",
    "min_recharge_amount": "10.000000000000000000",
    "max_recharge_amount": "1000.000000000000000000",
    "is_valid": false,
    "invalid_reason": "first_recharge_below_min"
  }
}

Example Response (not submittable — unknown package) ​

An unknown or inactive package_id is reported in the body, not as an error envelope. Nothing beyond the echo could be evaluated:

json
{
  "code": 0,
  "message": "Success",
  "data": {
    "package_id": "pkg_999",
    "is_valid": false,
    "invalid_reason": "bank_card_config_not_found"
  }
}

invalid_reason Codes ​

is_valid=false is paired with one of these stable codes (mostly the same keys apply returns as error_key). Treat any code not listed here as "not submittable" and show invalid_reason as-is.

Package / header configuration (stage ② and later fields are absent):

invalid_reasonMeaning
bank_card_config_not_foundPackage does not exist or is not active (also when the package's fee / base amount is misconfigured on the platform side)
bank_card_header_not_foundThe header exists but is not active. (A header that does not exist at all is rejected earlier with the error openapi_invalid_header_id.)
bank_card_strategy_not_foundThe header's card type has no issuing integration on the platform — platform configuration, contact support
bank_card_provider_not_foundThe issuer for this card type is disabled — platform configuration, contact support
bank_card_invalid_card_typeThe card type is not configured for its issuer — platform configuration, contact support
bank_card_header_type_mismatchThe package belongs to a different card type than the header — use a package_id returned by /card_configs/list for this header_id
bank_card_config_not_available_for_headerThe package is restricted to other headers — use a package_id returned by /card_configs/list for this header_id

Account eligibility (same rejection /card/apply would return):

invalid_reasonMeaning
kyc_requiredKYC is a hard gate for this card and the account has not passed it
card_deposit_config_invalidThe gate mode requires a deposit but the deposit is not fully configured on the platform side; nobody can open this card until it is fixed

Amount:

invalid_reasonMeaning
invalid_first_deposit_amountNot a plain non-negative integer (decimals / signs / scientific notation / too many digits)
first_recharge_below_baseAmount below base_amount
first_recharge_below_minAmount below min_first_deposit_amount (also returned when first_deposit_amount is omitted and the minimum is above the base)
first_recharge_exceeds_maxExcess exceeds max_recharge_amount
first_recharge_asset_mismatchOpen-fee asset ≠ recharge asset; custom excess unsupported for this config
first_recharge_excess_too_smallAfter fee + integer rounding nothing reaches the card; increase the amount
first_recharge_unavailableThe first deposit could not be computed (platform-side configuration or fee calculation problem) — retry later; contact support if it persists

Balance (all stages computed):

invalid_reasonMeaning
insufficient_balanceWallet (incl. USD top-up) can't cover total_freeze
card_deposit_insufficient_balanceBalance of the deposit asset can't cover deposit_amount (only when the deposit asset differs from the pay asset)

The account recharge limit is checked only by apply

The preview does not evaluate the account's recharge limit. A preview with is_valid=true can still be rejected by /card/apply with first_recharge_limit_exceeded when the excess exceeds that limit.

Common Errors ​

Error responses (code ≠ 0; malformed input / unknown or unsupported header / server fault). Most of them are returned with HTTP 200 — check code / error_key, not the HTTP status:

HTTPcodeerror_keyDescription
20040000openapi_invalid_header_idheader_id missing / wrong prefix, or no such header
20040000openapi_invalid_package_idpackage_id missing / malformed (an unknown package is not an error — see bank_card_config_not_found above)
20040000openapi_card_type_not_supportedHeader's card type not in the virtual range
20040000account_manager_bind_required / account_manager_unavailable / account_manager_open_disabledAccount-manager-controlled header your account cannot apply for (same rule as apply)
20040001validation_failedRequest body cannot be parsed
40140100openapi_invalid_credentialsAuth failure
20050000openapi_first_deposit_preview_failedServer error — retry with backoff

Notes ​

  • Numbers match apply exactly. The preview shares the open-card computation, so total_freeze / first_recharge_card are the same values apply will charge for the same first_deposit_amount.
  • No money moves. This call freezes nothing and writes nothing; safe to call as often as needed (subject to rate limits).
  • wallet_balance is your own account balance — no other party's data is exposed.
  • The excess fee uses the same recharge fee formula as Create Recharge; the formula is also available per package via List Card Configs.

Released under MIT-equivalent terms.