Testing Virtual Accounts

Test virtual account applications, provisioning outcomes, simulated deposits and reversals, auto-sweep, and ledger balance transfers using deterministic email fixtures in sandbox.

Use sandbox credentials and https://api-v2.honeycoin.app/api/sandbox/b2b/virtual-accounts as {virtualAccountsBaseUrl}. Generate a sandbox bearer token at POST https://api-v2.honeycoin.app/api/sandbox/b2b/auth/generate-bearer-token.

Sandbox uses the exact same endpoints and request contracts as production—there are no sandbox-only simulation endpoints. Instead, deterministic holderInfo.email prefixes trigger application review outcomes, provisioning failures, inbound deposits, reversals, and reversal netting automatically. Customers, applications, accounts, transactions, and balances created in sandbox are completely isolated from production and never move real money.

Sandbox still enforces every product requirement, holderInfo schema check, missing-field rule, duplicate-application claim, and idempotency rule. Fixture emails select a simulated path only after the request is accepted; they do not bypass required fields or validation.

End-to-End Checklist

All paths below are relative to {virtualAccountsBaseUrl} unless noted.

  1. Create or reuse a sandbox customer via POST https://api-v2.honeycoin.app/api/sandbox/b2b/customers and save data.id as customerId.
  2. Create and submit an application via POST /applications using a fixture email in holderInfo.email (for example, [email protected]), optional accountSettings, and X-Idempotency-Key.
  3. Inspect missing requirements (if submit: false or incomplete) via GET /applications/{applicationId}, patch missing fields with PATCH /applications/{applicationId}, and submit via POST /applications/{applicationId}/submit.
  4. Confirm provisioning via GET /applications/{applicationId} until status is approved, then fetch the active sandbox account via GET /?customerId={customerId}. Provisioned sandbox accounts receive a deterministic 10-digit account number starting with 99 (99XXXXXXXX) and bankName: "HoneyCoin Sandbox Bank".
  5. Verify scheduled ledger events & transfers:
    • For deposit@..., reversal@..., and netting@... email fixtures, sandbox automatically posts the simulated deposit (and any follow-up reversal or netting deposit) a few seconds after provisioning completes.
    • If settings.autoSweep.enabled is true, each posted deposit automatically triggers a kind: "transfer" debit (transferId: "sweep_<hash>") and credits your sandbox merchant ledger balance.
    • If settings.autoSweep.enabled is false, call POST /{accountId}/transfers with destination: { "type": "ledger_balance" } to sweep manually, or toggle autoSweep via PATCH /{id}/settings.

Application & Provisioning Email Fixtures

When a complete sandbox application is submitted, HoneyCoin determines the review and provisioning outcome deterministically from the prefix of holderInfo.email (case-insensitive, before @ or +):

holderInfo.emailApplication statusAccount statusDetails / Recovery Path
Any standard email (e.g. [email protected], [email protected])approvedactiveProvisions an active account (99XXXXXXXX, HoneyCoin Sandbox Bank) with 0 balance
needsinfo@...needs_information—statusReason.code: "SANDBOX_NEEDS_INFORMATION". Patch holderInfo.email to a standard email via PATCH /applications/{applicationId} and resubmit to test recovery
reject@...rejected—statusReason.code: "SANDBOX_REJECTED". Terminal status; open a new application for the same customerId and product to test re-applying
pending@...pending—Remains in pending so you can test pending/polling UI states
otp@...awaiting_action—Sets stepRequired: "otp" so you can test action-required handling
review@...needs_review—statusReason.code: "SANDBOX_NEEDS_REVIEW". Tests uncertain submission handling
failprovision@...approvedfailedApplication approves, then account provisioning transitions to failed

Note: Submitting an incomplete application still returns 400 VALIDATION_ERROR with details listing missing.fields, missing.problems, and missing.documents, regardless of the email fixture. Non-reapplyable statuses (pending, awaiting_action, needs_review, and approved) retain the (customerId, product) claim, so use a separate sandbox customerId when testing those fixtures. Unlike production merchant-level defaults, sandbox accounts default autoSweep.enabled to false unless you pass accountSettings on POST /applications or update them via PATCH /{id}/settings.

Deposit, Reversal & Netting Email Fixtures

Use the prefixes below on holderInfo.email to approve and provision the account and automatically schedule simulated ledger transactions a few seconds after activation. Append +<amountMinor> (a positive integer minor-unit string, e.g. +25000) to customize the initial deposit amount; omitting it defaults to "50000":

holderInfo.emailScheduled Ledger Sequence
deposit@... or deposit+<amountMinor>@...Approves & provisions account → posts a kind: "deposit" credit of amountMinor (default "50000")
reversal@... or reversal+<amountMinor>@...Approves & provisions account → posts a kind: "deposit" credit of amountMinor → posts a kind: "reversal" debit referencing the deposit in reversalOf
netting@... or netting+<amountMinor>@...Approves & provisions account → posts a kind: "deposit" of amountMinor (default "50000") → posts its kind: "reversal" → posts a follow-up kind: "deposit" of amountMinor + 20000 (default "70000"). When autoSweep.enabled is true, the follow-up deposit nets the negative virtual account balance and sweeps only "20000"

Example: Auto-Sweep Deposit Test

curl --request POST \
  --url https://api-v2.honeycoin.app/api/sandbox/b2b/virtual-accounts/applications \
  --header 'Authorization: Bearer YOUR_SANDBOX_BEARER_TOKEN' \
  --header 'Content-Type: application/json' \
  --header 'X-Idempotency-Key: sbx-va-deposit-0194f1c2-7b3a' \
  --data '{
    "customerId": "cust_sbx_1234567890",
    "country": "NG",
    "currency": "NGN",
    "holderInfo": {
      "email": "[email protected]",
      "identification": {
        "type": "bvn",
        "number": "12345678901",
        "country": "NG"
      }
    },
    "accountSettings": {
      "autoSweep": {
        "enabled": true
      }
    },
    "submit": true
  }'

Within a few seconds, the application approves, the sandbox account activates, the "50000" deposit posts to GET /{accountId}/transactions, auto-sweep posts a kind: "transfer" debit (transferId: "sweep_<hash>"), and your sandbox B2B balance is credited 500.00 NGN.

Scenarios to Verify

ScenarioSetupExpected Behavior
Happy-path approval & provisioningComplete application with [email protected] (or [email protected]) and submit: trueStatus transitions to approved; GET / returns active account 99XXXXXXXX at HoneyCoin Sandbox Bank with capabilities.transferDestinations: ["ledger_balance"]
needs_information recoverySubmit with [email protected], then PATCH email to [email protected] and resubmitTransitions to needs_information (SANDBOX_NEEDS_INFORMATION), then approved after resubmission
Rejection and re-applicationSubmit with [email protected], then open a new application for the same customer and productFirst application transitions to rejected (SANDBOX_REJECTED); second application is allowed and succeeds
Pending, OTP, and manual review statesSubmit with [email protected], [email protected], or [email protected]Transitions to pending, awaiting_action (stepRequired: "otp"), or needs_review (SANDBOX_NEEDS_REVIEW)
Provisioning failureSubmit with [email protected]Application approves; account transitions to status: "failed"
Auto-sweep on depositSubmit with [email protected] and accountSettings: { "autoSweep": { "enabled": true } }Deposit posts, an automatic kind: "transfer" debit (transferId: "sweep_<hash>") posts, and your sandbox B2B balance increases by 500.00
Toggle autoSweep repeatedlyCall PATCH /{id}/settings with true, then false, then trueEvery toggle succeeds with 200 OK and updates settings.autoSweep.enabled immediately
Manual ledger_balance transferSubmit with [email protected] and autoSweep.enabled: false; once deposit posts, call POST /{accountId}/transfers for "25000" with destination: { "type": "ledger_balance" }Returns 201 Created with kind: "transfer", debits "25000" from the virtual account, and credits 250.00 to your sandbox B2B balance
Transfer idempotency & conflictRepeat the same transferId with identical fields, then repeat the same transferId with a different amountMinorIdentical retry replays the posted transfer; mismatched parameters return 422 TRANSFER_ID_CONFLICT with details.transferId
Insufficient virtual account balanceCall POST /{accountId}/transfers with amountMinor greater than available balanceReturns 409 INSUFFICIENT_AVAILABLE_BALANCE
Reversal after sweep & deposit nettingSubmit with [email protected] and autoSweep.enabled: trueInitial "50000" deposit sweeps to your B2B balance; reversal posts without clawing back your merchant ledger balance (VA balance -50000); follow-up "70000" deposit nets the shortfall and auto-sweeps only "20000"

Related Guides