Skip to main content
POST
/
test
/
deposits
curl -X POST 'https://api.sandbox.wealthyhood.com/test/deposits' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_M2M_TOKEN' \
  -d '{
    "userId": "64f0c51e7fb3fc001234abcd",
    "amount": 100.50
  }'
{
  "id": "dep_64f0c51e7fb3fc001234abcd",
  "amount": 10050,
  "currency": "EUR",
  "status": "Settled",
  "reference": "a1B2c3D4e5F6g7H8",
  "createdAt": "2024-01-15T10:30:00.000Z"
}
These test endpoints are only available in development and staging environments. They are disabled in production for security reasons.
Create a settled deposit transaction for a test user. This endpoint immediately creates a deposit with Settled status and updates the user’s cash availability, making it useful for simulating payments in sandbox environments without waiting for actual bank transfers.
curl -X POST 'https://api.sandbox.wealthyhood.com/test/deposits' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_M2M_TOKEN' \
  -d '{
    "userId": "64f0c51e7fb3fc001234abcd",
    "amount": 100.50
  }'
{
  "id": "dep_64f0c51e7fb3fc001234abcd",
  "amount": 10050,
  "currency": "EUR",
  "status": "Settled",
  "reference": "a1B2c3D4e5F6g7H8",
  "createdAt": "2024-01-15T10:30:00.000Z"
}

Request body

userId
string
required
MongoDB ObjectId of the user who will receive the deposit. The user must exist and have a portfolio.Format: Must be a valid 24-character hexadecimal MongoDB ObjectId (e.g., 64f0c51e7fb3fc001234abcd).
amount
number
required
Deposit amount in whole currency units (e.g., 100.50 for €100.50). The amount will be converted to cents internally.Constraints: Must be a positive number greater than 0.

Response fields

id
string
required
Unique identifier of the created deposit transaction.
amount
number
required
Deposit amount in cents (minor currency units). For example, 10050 represents €100.50.
currency
string
required
ISO 4217 currency code (e.g., GBP, EUR, USD). Inherited from the user’s currency setting.
status
string
required
Transaction status. Test deposits are always created with Settled status, meaning the funds are immediately available.
reference
string
Automatically generated bank reference for the deposit. This is a 16-character alphanumeric string that can be used for tracking purposes.
createdAt
string
required
ISO 8601 timestamp indicating when the deposit was created.

Error responses

message
string
Error message describing what went wrong.
code
string
Error code indicating the type of error (e.g., NOT_FOUND, BAD_REQUEST).

Common errors

404 Not Found - User not found
{
  "message": "User not found",
  "code": "NOT_FOUND"
}
400 Bad Request - User does not have a portfolio
{
  "message": "User does not have a portfolio",
  "code": "BAD_REQUEST"
}
400 Bad Request - Invalid userId format
{
  "message": "userId must be a valid MongoDB ObjectId",
  "code": "BAD_REQUEST"
}
400 Bad Request - Invalid amount
{
  "message": "Amount must be a positive number",
  "code": "BAD_REQUEST"
}
The deposit is created with Settled status and the user’s cash availability is immediately updated. The deposit uses the user’s default currency and is associated with their first portfolio. If the user has a bank account, it will be linked to the deposit automatically.
Use this endpoint to quickly fund test user accounts for testing payment flows, investment orders, and other features that require available cash balance.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
userId
string
required

MongoDB ObjectId of the user who will receive the deposit

Example:

"64f0c51e7fb3fc001234abcd"

amount
number
required

Deposit amount in whole currency units (e.g., 100.50 for £100.50)

Required range: x >= 0.01
Example:

100.5

Response

Deposit created successfully

id
string
required
Example:

"dep_64f0c51e7fb3fc001234abcd"

amount
number
required

Deposit amount in cents (minor currency units)

Example:

10050

currency
string
required

ISO 4217 currency code

Example:

"EUR"

status
string
required

Transaction status (always "Settled" for test deposits)

Example:

"Settled"

createdAt
string<date-time>
required
Example:

"2024-01-15T10:30:00.000Z"

reference
string

Automatically generated bank reference

Example:

"a1B2c3D4e5F6g7H8"