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
| Item | Value |
|---|---|
| Method | POST |
| Path | /api/v1/openapi/card/first_deposit/preview |
| Auth | HMAC |
| Idempotency | Not required (read-only) |
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
header_id | string | ✅ | hdr_<id> (List Card Headers) |
package_id | string | ✅ | pkg_<id> (List Card Configs) |
first_deposit_amount | string | optional | Total 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
{
"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.
| Stage | Fields | Present when |
|---|---|---|
| Always | package_id, is_valid, invalid_reason (only when is_valid=false), warnings (only when non-empty) | Always |
| ① Package | currency, open_card_fee, base_amount, min_first_deposit_amount, request_amount, min_recharge_amount, max_recharge_amount | The package could be loaded — absent when the package does not exist (bank_card_config_not_found) |
| ② Configuration | card_type, pay_asset_symbol, fee_type, fee_rate, fee_fixed, deposit_required, deposit_amount, deposit_asset_symbol, deposit_refund_days | The package / header / card-type checks passed — absent for every bank_card_* reason |
| ③ Amount breakdown | excess_amount, excess_fee_amount, excess_fee_asset_symbol, excess_settle_amount, excess_card_amount, exchange_rate, first_recharge_card, total_freeze, deposit_in_total_freeze | The 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 |
| ④ Wallet | wallet_balance, wallet_balance_sufficient, usd_balance, will_use_usd, usd_needed, deposit_wallet_balance, deposit_wallet_balance_sufficient | The 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".
| Field | Type | Stage | Description |
|---|---|---|---|
package_id | string | Always | Echo, pkg_<id> |
card_type | string | ② | Lowercase business code, e.g. virtual_v |
currency | string | ① | Card currency (e.g. USD) |
pay_asset_symbol | string | ② | Pay/recharge asset symbol (e.g. USDT); also omitted if the package has no pay asset configured |
open_card_fee | string (decimal) | ① | Open-card fee (pay asset) |
base_amount | string (decimal) | ① | Base initial deposit — credited 1:1, no fee |
min_first_deposit_amount | string (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_amount | string (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_amount | string (decimal) | ③ | Excess above base (request_amount − base_amount) |
excess_fee_amount | string (decimal) | ③ | Fee charged on the excess (fee asset); "0" when there is no excess |
excess_fee_asset_symbol | string | ③ | Fee asset symbol; omitted when there is no excess |
excess_settle_amount | string (decimal) | ③ | Excess after fee, before integer rounding |
excess_card_amount | string (decimal) | ③ | Excess actually credited to the card (after rounding) |
exchange_rate | string | ③ | Compatibility field; USDT/USD is 1:1, so it is always omitted |
first_recharge_card | string (decimal) | ③ | Total credited to the card (base + excess credited); integer |
total_freeze | string (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_required | bool | ② | 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_amount | string (decimal) | ② | Deposit amount in the deposit asset; "0" when no deposit |
deposit_asset_symbol | string | ② | Deposit asset symbol (e.g. USDT / USD); "" when no deposit |
deposit_refund_days | int | ② | Days after card closure before the deposit refund can be requested (0 = enters refund review right after closure) |
deposit_in_total_freeze | bool | ③ | 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_balance | string (decimal) | ④ | Available balance of the deposit asset; "0" when no deposit |
deposit_wallet_balance_sufficient | bool | ④ | 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_type | int | ② | Recharge fee type: 1=fixed 2=percent 3=mixed |
fee_rate | string | ② | Rate (percent / mixed); omitted otherwise |
fee_fixed | string | ② | Fixed fee (fixed / mixed); omitted otherwise |
min_recharge_amount | string (decimal) | ① | Config min recharge (display) |
max_recharge_amount | string (decimal) | ① | Config max recharge — the excess is capped by this |
wallet_balance | string (decimal) | ④ | Your account's available balance in the pay asset |
wallet_balance_sufficient | bool | ④ | Whether the balance (incl. USD 1:1 top-up) covers total_freeze |
usd_balance | string (decimal) | ④ | Your USD balance (used only for the USDT→USD 1:1 top-up check) |
will_use_usd | bool | ④ | Whether the USD 1:1 top-up would be used |
usd_needed | string (decimal) | ④ | USD amount that would be drawn via the top-up |
is_valid | bool | Always | Whether apply would be accepted with this amount |
invalid_reason | string | Always | Stable reason code when is_valid=false (omitted when valid) — see invalid_reason Codes |
warnings | string[] | Always | Optional advisory codes; omitted when there are none |
Example Response (valid)
{
"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:
{
"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:
{
"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_reason | Meaning |
|---|---|
bank_card_config_not_found | Package 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_found | The 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_found | The header's card type has no issuing integration on the platform — platform configuration, contact support |
bank_card_provider_not_found | The issuer for this card type is disabled — platform configuration, contact support |
bank_card_invalid_card_type | The card type is not configured for its issuer — platform configuration, contact support |
bank_card_header_type_mismatch | The 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_header | The 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_reason | Meaning |
|---|---|
kyc_required | KYC is a hard gate for this card and the account has not passed it |
card_deposit_config_invalid | The 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_reason | Meaning |
|---|---|
invalid_first_deposit_amount | Not a plain non-negative integer (decimals / signs / scientific notation / too many digits) |
first_recharge_below_base | Amount below base_amount |
first_recharge_below_min | Amount below min_first_deposit_amount (also returned when first_deposit_amount is omitted and the minimum is above the base) |
first_recharge_exceeds_max | Excess exceeds max_recharge_amount |
first_recharge_asset_mismatch | Open-fee asset ≠ recharge asset; custom excess unsupported for this config |
first_recharge_excess_too_small | After fee + integer rounding nothing reaches the card; increase the amount |
first_recharge_unavailable | The 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_reason | Meaning |
|---|---|
insufficient_balance | Wallet (incl. USD top-up) can't cover total_freeze |
card_deposit_insufficient_balance | Balance 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:
| HTTP | code | error_key | Description |
|---|---|---|---|
| 200 | 40000 | openapi_invalid_header_id | header_id missing / wrong prefix, or no such header |
| 200 | 40000 | openapi_invalid_package_id | package_id missing / malformed (an unknown package is not an error — see bank_card_config_not_found above) |
| 200 | 40000 | openapi_card_type_not_supported | Header's card type not in the virtual range |
| 200 | 40000 | account_manager_bind_required / account_manager_unavailable / account_manager_open_disabled | Account-manager-controlled header your account cannot apply for (same rule as apply) |
| 200 | 40001 | validation_failed | Request body cannot be parsed |
| 401 | 40100 | openapi_invalid_credentials | Auth failure |
| 200 | 50000 | openapi_first_deposit_preview_failed | Server error — retry with backoff |
Notes
- Numbers match apply exactly. The preview shares the open-card computation, so
total_freeze/first_recharge_cardare the same values apply will charge for the samefirst_deposit_amount. - No money moves. This call freezes nothing and writes nothing; safe to call as often as needed (subject to rate limits).
wallet_balanceis 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.