Mocks
πŸ’° Mock Deposit

Mock Deposit Webhook

Simulate deposit webhooks for Direct Exchange quotes and Virtual Bank Account (VBA) deposits. This allows you to test deposit flows without making actual deposits.

Overview

There are two endpoints for simulating deposits:

  1. Simulate VBA Deposit - For Virtual Bank Account deposits (any rail/currency)
  2. Direct Exchange Deposit Webhook - For Direct Exchange quotes (source funding)

Simulate VBA Deposit

Simulates a deposit to a Virtual Bank Account (VBA) by providing an account number or email (for CAD) and amount. This endpoint works for any payment rail and currency.

Endpoint

POST /api/v1/client/mock/simulate-deposit

Description

Simulates deposits to Virtual Bank Accounts (VBAs) for testing purposes. The endpoint:

  • Accepts either account_number or email (for CAD Interac deposits)
  • Automatically detects the currency based on the VBA
  • Builds webhook payloads matching real provider formats
  • Sends webhooks to the same processors as real deposits
  • Supports multiple currencies: NGN, CAD, USD, GBP, EUR
  • Credits the wallet linked to the VBA (VBAs are created with a primary_wallet_id)

Important: The VBA must be created first and linked to a wallet. Deposits will credit the wallet associated with the VBA's primary_wallet_id.

Request Body

{
  "account_number": "string",
  "email": "string",
  "amount": 100.50
}
FieldTypeRequiredDescription
account_numberstringConditionalVirtual Bank Account number (required if email not provided)
emailstringConditionalEmail address for CAD Interac deposits (required if account_number not provided)
amountnumberYesDeposit amount (must be greater than 0)

Note: Provide either account_number or email, but not both.

Success Response (200 OK)

{
  "message": "Deposit simulation sent to webhook processor",
  "currency": "CAD",
  "amount": "100.50",
  "vba_ident": "user@example.com",
  "webhook_sent": true
}

Response Fields

FieldTypeDescription
messagestringHuman-readable message
currencystringCurrency code of the VBA (e.g., "NGN", "CAD", "USD")
amountstringThe deposit amount as a string
vba_identstringThe identifier used (account_number or email)
webhook_sentbooleanIndicates if the webhook was successfully sent

Error Responses

Status CodeDescription
400Invalid request (missing amount, both account_number and email provided, etc.)
401Unauthorized - Invalid or missing API key or signature
403Forbidden - Endpoint blocked in production environment
404VBA not found for the provided account_number or email
500Internal server error

Example: cURL

Using Account Number (NGN, USD, GBP, EUR)

curl -X POST "https://api.sznd.app/api/v1/client/mock/simulate-deposit" \
  -H "x-api-key: your_api_key_here" \
  -H "x-timestamp: 2025-01-30T12:20:15Z" \
  -H "x-signature: generated_signature_here" \
  -H "Content-Type: application/json" \
  -d '{
    "account_number": "1234567890",
    "amount": 1000.00
  }'

Using Email (CAD Interac)

curl -X POST "https://api.sznd.app/api/v1/client/mock/simulate-deposit" \
  -H "x-api-key: your_api_key_here" \
  -H "x-timestamp: 2025-01-30T12:20:15Z" \
  -H "x-signature: generated_signature_here" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "amount": 500.00
  }'

Example: HTTP Request

POST /api/v1/client/mock/simulate-deposit HTTP/1.1
Host: api.sznd.app
x-api-key: your_api_key_here
x-timestamp: 2025-01-30T12:20:15Z
x-signature: generated_signature_here
Content-Type: application/json

{
  "account_number": "1234567890",
  "amount": 1000.00
}

Mock Direct Exchange Deposit Webhook

Simulates the source-leg deposit webhook for an existing Direct Exchange quote. This endpoint is specifically for Direct Exchange transactions where you need to simulate the source funding.

Endpoint

POST /api/v1/client/mock/direct-exchange-deposit-webhook

Description

Simulates source funding webhooks for Direct Exchange quotes only. The endpoint:

  • Accepts only Direct Exchange quote transactions
  • Builds deposit webhook payloads matching real provider formats
  • Sends webhooks to the same processors as real webhooks
  • Supports both successful and failed deposit scenarios

Note: For Virtual Bank Account (VBA) based deposits (any rail), use /mock/simulate-deposit instead.

Request Body

{
  "transaction_reference": "string",
  "expected_status": "successful" | "failed"
}
FieldTypeRequiredDescription
transaction_referencestringYesThe transaction reference of an existing Direct Exchange transaction
expected_statusstringYesExpected webhook status: "successful" or "failed"

Success Response (200 OK)

{
  "success": true,
  "message": "Mock deposit webhook sent successfully",
  "data": {
    "transaction_reference": "TXN123456789",
    "expected_status": "successful",
    "webhook_sent": true
  }
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the mock webhook was sent successfully
messagestringHuman-readable message
data.transaction_referencestringThe transaction reference that was processed
data.expected_statusstringThe expected status that was simulated
data.webhook_sentbooleanIndicates if the webhook was successfully sent

Error Responses

Status CodeDescription
400Invalid request or quote is not Direct Exchange type
401Unauthorized - Invalid or missing API key or signature
403Forbidden - Endpoint blocked in production environment
404Transaction not found
422Unprocessable entity
500Internal server error

Example: cURL

curl -X POST "https://api.sznd.app/api/v1/client/mock/direct-exchange-deposit-webhook" \
  -H "x-api-key: your_api_key_here" \
  -H "x-timestamp: 2025-01-30T12:20:15Z" \
  -H "x-signature: generated_signature_here" \
  -H "Content-Type: application/json" \
  -d '{
    "transaction_reference": "TXN123456789",
    "expected_status": "successful"
  }'

Example: HTTP Request

POST /api/v1/client/mock/direct-exchange-deposit-webhook HTTP/1.1
Host: api.sznd.app
x-api-key: your_api_key_here
x-timestamp: 2025-01-30T12:20:15Z
x-signature: generated_signature_here
Content-Type: application/json

{
  "transaction_reference": "TXN123456789",
  "expected_status": "successful"
}

Use Cases

  1. Testing Deposit Flows - Simulate deposits to test your deposit handling logic
  2. Wallet Balance Testing - Verify wallet balances update correctly after deposits
  3. Webhook Testing - Test webhook handling without real deposits
  4. Integration Testing - Test end-to-end deposit flows in staging environments
  5. Currency Testing - Test deposits for different currencies (NGN, CAD, USD, GBP, EUR)
  6. Direct Exchange Testing - Test Direct Exchange source funding flows

Prerequisites

Before simulating deposits, ensure you have:

  1. Created a Wallet - A wallet must exist for the currency you want to deposit to
  2. Created a VBA - The Virtual Bank Account must be created and linked to the wallet
  3. VBA-Wallet Linkage - VBAs are linked to wallets at creation time; deposits to a VBA will credit the linked wallet

Note: See Virtual Wallets API for creating VBAs and Wallets API for wallet management.

Important Notes

  • CAD Deposits: Use email parameter instead of account_number for CAD Interac deposits
  • VBA Must Exist: The VBA (identified by account_number or email) must exist in the system and be linked to a wallet
  • Wallet Required: A wallet must exist for the VBA's currency before deposits can be simulated
  • VBA-Wallet Relationship: VBAs are created with a primary_wallet_id that links them to a specific wallet; deposits credit this wallet
  • Production Blocked: These endpoints are automatically blocked in production environments
  • Webhook Processing: The simulated webhook goes through the same processors as real webhooks
  • Transaction Creation: Successful deposits will create transactions and update wallet balances
  • Direct Exchange Only: The /direct-exchange-deposit-webhook endpoint only works with Direct Exchange quotes

Related Endpoints