Skip to main content

Overview

This guide walks you through enabling users to move cash in and out of Wealthyhood: link a bank account for ownership verification, register and track deposits, and withdraw back to the bank.
All endpoints require an M2M bearer token and the x-user-id header to scope operations to the acting user.

Prerequisites

  • API access and M2M credentials
  • x-user-id value for the target user

Before users can deposit funds, they must link a bank account. This is required to verify account ownership and match incoming payments to the correct user. Use POST /bank-accounts to register a bank account for the user.
Bank account linking is mandatory for deposits. The system verifies that the sending bank account matches a linked account to confirm ownership and prevent unauthorized deposits.
Persist the returned id (e.g., ba_...) to reference this account for deposits and withdrawals.

2) Create and track payments

Before the user sends a bank transfer, register a deposit expectation with POST /deposits/expectations, including a unique payment reference (e.g. wallet-topup-${crypto.randomUUID()}). Have the user include that same reference in their bank transfer so it can be reconciled automatically.
cURL
Once the payment is executed, poll GET /deposits with the bankReference query parameter to detect the matching deposit record:
Use a new random reference for each payment to simplify tracking. The deposit response indicates the current status, allowing you to monitor when the funds become available to the user.

3) Withdraw funds

Use POST /withdrawals to send funds back to the user’s bank account.
Validate sufficient available balance and supported currencies before creating withdrawals.