Deposits
Create deposit expectation
Register an expected incoming bank transfer for a user bank account.
POST
/
deposits
/
expectations
Create deposit expectation
curl --request POST \
--url https://{host}/deposits/expectations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"bankAccountId": "64f0c51e7fb3fc001234abcd",
"reference": "wallet-topup-5f91ce",
"consideration": {
"amount": 250
}
}
'import requests
url = "https://{host}/deposits/expectations"
payload = {
"bankAccountId": "64f0c51e7fb3fc001234abcd",
"reference": "wallet-topup-5f91ce",
"consideration": { "amount": 250 }
}
headers = {
"x-user-id": "<x-user-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-id': '<x-user-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
bankAccountId: '64f0c51e7fb3fc001234abcd',
reference: 'wallet-topup-5f91ce',
consideration: {amount: 250}
})
};
fetch('https://{host}/deposits/expectations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/deposits/expectations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bankAccountId' => '64f0c51e7fb3fc001234abcd',
'reference' => 'wallet-topup-5f91ce',
'consideration' => [
'amount' => 250
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-user-id: <x-user-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/deposits/expectations"
payload := strings.NewReader("{\n \"bankAccountId\": \"64f0c51e7fb3fc001234abcd\",\n \"reference\": \"wallet-topup-5f91ce\",\n \"consideration\": {\n \"amount\": 250\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-id", "<x-user-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/deposits/expectations")
.header("x-user-id", "<x-user-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bankAccountId\": \"64f0c51e7fb3fc001234abcd\",\n \"reference\": \"wallet-topup-5f91ce\",\n \"consideration\": {\n \"amount\": 250\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/deposits/expectations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-id"] = '<x-user-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bankAccountId\": \"64f0c51e7fb3fc001234abcd\",\n \"reference\": \"wallet-topup-5f91ce\",\n \"consideration\": {\n \"amount\": 250\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Invalid amount",
"code": "INVALID_AMOUNT"
}{
"message": "Authentication required",
"code": "UNAUTHORIZED"
}{
"message": "Access denied",
"code": "FORBIDDEN"
}{
"message": "Bank account not found",
"code": "NOT_FOUND"
}{
"message": "A pending deposit expectation with this reference and amount already exists",
"code": "CONFLICT"
}Use this endpoint to register a deposit expectation when the user sends a bank transfer. When
the transfer arrives, Wealthyhood matches it against pending expectations by reference and amount,
then automatically reconciles it as a completed deposit.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
The external user identifier of the acting customer.
Example:
"bank-user-12345"
Body
application/json
MongoDB ObjectId of the bank account to credit
Pattern:
^[a-f0-9]{24}$Example:
"64f0c51e7fb3fc001234abcd"
Payment reference the user will include in their bank transfer. Leading and trailing whitespace are trimmed; the value is stored and matched in lowercase (ASCII) so it aligns with the bank statement reference field.
Minimum string length:
1Example:
"wallet-topup-5f91ce"
Show child attributes
Show child attributes
Response
Deposit expectation created successfully
⌘I
Create deposit expectation
curl --request POST \
--url https://{host}/deposits/expectations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-user-id: <x-user-id>' \
--data '
{
"bankAccountId": "64f0c51e7fb3fc001234abcd",
"reference": "wallet-topup-5f91ce",
"consideration": {
"amount": 250
}
}
'import requests
url = "https://{host}/deposits/expectations"
payload = {
"bankAccountId": "64f0c51e7fb3fc001234abcd",
"reference": "wallet-topup-5f91ce",
"consideration": { "amount": 250 }
}
headers = {
"x-user-id": "<x-user-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-user-id': '<x-user-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
bankAccountId: '64f0c51e7fb3fc001234abcd',
reference: 'wallet-topup-5f91ce',
consideration: {amount: 250}
})
};
fetch('https://{host}/deposits/expectations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/deposits/expectations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bankAccountId' => '64f0c51e7fb3fc001234abcd',
'reference' => 'wallet-topup-5f91ce',
'consideration' => [
'amount' => 250
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-user-id: <x-user-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/deposits/expectations"
payload := strings.NewReader("{\n \"bankAccountId\": \"64f0c51e7fb3fc001234abcd\",\n \"reference\": \"wallet-topup-5f91ce\",\n \"consideration\": {\n \"amount\": 250\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-user-id", "<x-user-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/deposits/expectations")
.header("x-user-id", "<x-user-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"bankAccountId\": \"64f0c51e7fb3fc001234abcd\",\n \"reference\": \"wallet-topup-5f91ce\",\n \"consideration\": {\n \"amount\": 250\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/deposits/expectations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-user-id"] = '<x-user-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"bankAccountId\": \"64f0c51e7fb3fc001234abcd\",\n \"reference\": \"wallet-topup-5f91ce\",\n \"consideration\": {\n \"amount\": 250\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Invalid amount",
"code": "INVALID_AMOUNT"
}{
"message": "Authentication required",
"code": "UNAUTHORIZED"
}{
"message": "Access denied",
"code": "FORBIDDEN"
}{
"message": "Bank account not found",
"code": "NOT_FOUND"
}{
"message": "A pending deposit expectation with this reference and amount already exists",
"code": "CONFLICT"
}