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.
- Create or reuse a sandbox customer via
POST https://api-v2.honeycoin.app/api/sandbox/b2b/customersand savedata.idascustomerId. - Create and submit an application via
POST /applicationsusing a fixture email inholderInfo.email(for example,[email protected]), optionalaccountSettings, andX-Idempotency-Key. - Inspect missing requirements (if
submit: falseor incomplete) viaGET /applications/{applicationId}, patch missing fields withPATCH /applications/{applicationId}, and submit viaPOST /applications/{applicationId}/submit. - Confirm provisioning via
GET /applications/{applicationId}untilstatusisapproved, then fetch the active sandbox account viaGET /?customerId={customerId}. Provisioned sandbox accounts receive a deterministic 10-digit account number starting with99(99XXXXXXXX) andbankName: "HoneyCoin Sandbox Bank". - Verify scheduled ledger events & transfers:
- For
deposit@...,reversal@..., andnetting@...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.enabledistrue, each posted deposit automatically triggers akind: "transfer"debit (transferId: "sweep_<hash>") and credits your sandbox merchant ledger balance. - If
settings.autoSweep.enabledisfalse, callPOST /{accountId}/transferswithdestination: { "type": "ledger_balance" }to sweep manually, or toggleautoSweepviaPATCH /{id}/settings.
- For
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.email | Application status | Account status | Details / Recovery Path |
|---|---|---|---|
Any standard email (e.g. [email protected], [email protected]) | approved | active | Provisions 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@... | approved | failed | Application approves, then account provisioning transitions to failed |
Note: Submitting an incomplete application still returns
400 VALIDATION_ERRORwithdetailslistingmissing.fields,missing.problems, andmissing.documents, regardless of the email fixture. Non-reapplyable statuses (pending,awaiting_action,needs_review, andapproved) retain the(customerId, product)claim, so use a separate sandboxcustomerIdwhen testing those fixtures. Unlike production merchant-level defaults, sandbox accounts defaultautoSweep.enabledtofalseunless you passaccountSettingsonPOST /applicationsor update them viaPATCH /{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.email | Scheduled 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
| Scenario | Setup | Expected Behavior |
|---|---|---|
| Happy-path approval & provisioning | Complete application with [email protected] (or [email protected]) and submit: true | Status transitions to approved; GET / returns active account 99XXXXXXXX at HoneyCoin Sandbox Bank with capabilities.transferDestinations: ["ledger_balance"] |
needs_information recovery | Submit with [email protected], then PATCH email to [email protected] and resubmit | Transitions to needs_information (SANDBOX_NEEDS_INFORMATION), then approved after resubmission |
| Rejection and re-application | Submit with [email protected], then open a new application for the same customer and product | First application transitions to rejected (SANDBOX_REJECTED); second application is allowed and succeeds |
| Pending, OTP, and manual review states | Submit with [email protected], [email protected], or [email protected] | Transitions to pending, awaiting_action (stepRequired: "otp"), or needs_review (SANDBOX_NEEDS_REVIEW) |
| Provisioning failure | Submit with [email protected] | Application approves; account transitions to status: "failed" |
| Auto-sweep on deposit | Submit 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 repeatedly | Call PATCH /{id}/settings with true, then false, then true | Every toggle succeeds with 200 OK and updates settings.autoSweep.enabled immediately |
Manual ledger_balance transfer | Submit 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 & conflict | Repeat the same transferId with identical fields, then repeat the same transferId with a different amountMinor | Identical retry replays the posted transfer; mismatched parameters return 422 TRANSFER_ID_CONFLICT with details.transferId |
| Insufficient virtual account balance | Call POST /{accountId}/transfers with amountMinor greater than available balance | Returns 409 INSUFFICIENT_AVAILABLE_BALANCE |
| Reversal after sweep & deposit netting | Submit with [email protected] and autoSweep.enabled: true | Initial "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
Updated about 21 hours ago
