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
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).
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
Unique identifier of the created deposit transaction.
Deposit amount in cents (minor currency units). For example, 10050 represents €100.50.
ISO 4217 currency code (e.g., GBP, EUR, USD). Inherited from the user’s currency setting.
Transaction status. Test deposits are always created with Settled status, meaning the funds are immediately available.
Automatically generated bank reference for the deposit. This is a 16-character alphanumeric string that can be used for tracking purposes.
ISO 8601 timestamp indicating when the deposit was created.
Error responses
Error message describing what went wrong.
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.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
MongoDB ObjectId of the user who will receive the deposit
Example:"64f0c51e7fb3fc001234abcd"
Deposit amount in whole currency units (e.g., 100.50 for £100.50)
Required range: x >= 0.01
Deposit created successfully
Example:"dep_64f0c51e7fb3fc001234abcd"
Deposit amount in cents (minor currency units)
Transaction status (always "Settled" for test deposits)
createdAt
string<date-time>
required
Example:"2024-01-15T10:30:00.000Z"
Automatically generated bank reference