Create a balance record
curl --request POST \
--url https://api.wellapp.ai/v1/balances \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "balance",
"attributes": {
"local_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "USD"
},
"accounting_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "EUR"
},
"foreign_exchange": [
{
"currency_rate": "1.2546",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-01T14:30:00Z"
},
{
"currency_rate": "1.2546",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-03T14:30:00Z"
}
],
"balance_at_from": "2025-06-01T10:00:00Z",
"balance_at_to": "2025-06-03T10:00:00Z"
},
"relationships": {
"transactions": {
"data": [
{
"type": "transaction",
"id": "uuid1"
}
]
},
"account": {
"data": {
"type": "payment_mean",
"id": "uuid2"
}
},
"workspaces": {
"data": [
{
"type": "workspace",
"id": "workspace_tenant"
}
]
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/balances"
payload = {
"type": "balance",
"attributes": {
"local_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "USD"
},
"accounting_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "EUR"
},
"foreign_exchange": [
{
"currency_rate": "1.2546",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-01T14:30:00Z"
},
{
"currency_rate": "1.2546",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-03T14:30:00Z"
}
],
"balance_at_from": "2025-06-01T10:00:00Z",
"balance_at_to": "2025-06-03T10:00:00Z"
},
"relationships": {
"transactions": { "data": [
{
"type": "transaction",
"id": "uuid1"
}
] },
"account": { "data": {
"type": "payment_mean",
"id": "uuid2"
} },
"workspaces": { "data": [
{
"type": "workspace",
"id": "workspace_tenant"
}
] }
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'balance',
attributes: {
local_balance: {
opening_booked: '123.32',
opening_value: '124.42',
closing_booked: '123.32',
closing_value: '124.42',
currency: 'USD'
},
accounting_balance: {
opening_booked: '123.32',
opening_value: '124.42',
closing_booked: '123.32',
closing_value: '124.42',
currency: 'EUR'
},
foreign_exchange: [
{
currency_rate: '1.2546',
currency_pair: 'EURUSD',
currency_rate_source: 'European Central Bank',
currency_rate_at: '2025-06-01T14:30:00Z'
},
{
currency_rate: '1.2546',
currency_pair: 'EURUSD',
currency_rate_source: 'European Central Bank',
currency_rate_at: '2025-06-03T14:30:00Z'
}
],
balance_at_from: '2025-06-01T10:00:00Z',
balance_at_to: '2025-06-03T10:00:00Z'
},
relationships: {
transactions: {data: [{type: 'transaction', id: 'uuid1'}]},
account: {data: {type: 'payment_mean', id: 'uuid2'}},
workspaces: {data: [{type: 'workspace', id: 'workspace_tenant'}]}
}
})
};
fetch('https://api.wellapp.ai/v1/balances', 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://api.wellapp.ai/v1/balances",
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([
'type' => 'balance',
'attributes' => [
'local_balance' => [
'opening_booked' => '123.32',
'opening_value' => '124.42',
'closing_booked' => '123.32',
'closing_value' => '124.42',
'currency' => 'USD'
],
'accounting_balance' => [
'opening_booked' => '123.32',
'opening_value' => '124.42',
'closing_booked' => '123.32',
'closing_value' => '124.42',
'currency' => 'EUR'
],
'foreign_exchange' => [
[
'currency_rate' => '1.2546',
'currency_pair' => 'EURUSD',
'currency_rate_source' => 'European Central Bank',
'currency_rate_at' => '2025-06-01T14:30:00Z'
],
[
'currency_rate' => '1.2546',
'currency_pair' => 'EURUSD',
'currency_rate_source' => 'European Central Bank',
'currency_rate_at' => '2025-06-03T14:30:00Z'
]
],
'balance_at_from' => '2025-06-01T10:00:00Z',
'balance_at_to' => '2025-06-03T10:00:00Z'
],
'relationships' => [
'transactions' => [
'data' => [
[
'type' => 'transaction',
'id' => 'uuid1'
]
]
],
'account' => [
'data' => [
'type' => 'payment_mean',
'id' => 'uuid2'
]
],
'workspaces' => [
'data' => [
[
'type' => 'workspace',
'id' => 'workspace_tenant'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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://api.wellapp.ai/v1/balances"
payload := strings.NewReader("{\n \"type\": \"balance\",\n \"attributes\": {\n \"local_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"USD\"\n },\n \"accounting_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"EUR\"\n },\n \"foreign_exchange\": [\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-01T14:30:00Z\"\n },\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-03T14:30:00Z\"\n }\n ],\n \"balance_at_from\": \"2025-06-01T10:00:00Z\",\n \"balance_at_to\": \"2025-06-03T10:00:00Z\"\n },\n \"relationships\": {\n \"transactions\": {\n \"data\": [\n {\n \"type\": \"transaction\",\n \"id\": \"uuid1\"\n }\n ]\n },\n \"account\": {\n \"data\": {\n \"type\": \"payment_mean\",\n \"id\": \"uuid2\"\n }\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_tenant\"\n }\n ]\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://api.wellapp.ai/v1/balances")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"balance\",\n \"attributes\": {\n \"local_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"USD\"\n },\n \"accounting_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"EUR\"\n },\n \"foreign_exchange\": [\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-01T14:30:00Z\"\n },\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-03T14:30:00Z\"\n }\n ],\n \"balance_at_from\": \"2025-06-01T10:00:00Z\",\n \"balance_at_to\": \"2025-06-03T10:00:00Z\"\n },\n \"relationships\": {\n \"transactions\": {\n \"data\": [\n {\n \"type\": \"transaction\",\n \"id\": \"uuid1\"\n }\n ]\n },\n \"account\": {\n \"data\": {\n \"type\": \"payment_mean\",\n \"id\": \"uuid2\"\n }\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_tenant\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"balance\",\n \"attributes\": {\n \"local_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"USD\"\n },\n \"accounting_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"EUR\"\n },\n \"foreign_exchange\": [\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-01T14:30:00Z\"\n },\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-03T14:30:00Z\"\n }\n ],\n \"balance_at_from\": \"2025-06-01T10:00:00Z\",\n \"balance_at_to\": \"2025-06-03T10:00:00Z\"\n },\n \"relationships\": {\n \"transactions\": {\n \"data\": [\n {\n \"type\": \"transaction\",\n \"id\": \"uuid1\"\n }\n ]\n },\n \"account\": {\n \"data\": {\n \"type\": \"payment_mean\",\n \"id\": \"uuid2\"\n }\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_tenant\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"type": "balance",
"id": "balance1",
"attributes": {
"local_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "USD"
},
"accounting_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "EUR"
},
"foreign_exchange": [
{
"currency_rate": "1.2546",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-01T14:30:00Z"
}
],
"balance_at_from": "2025-06-01T10:00:00Z",
"balance_at_to": "2025-06-03T10:00:00Z"
},
"relationships": {
"transactions": {
"data": [
{
"type": "transaction",
"id": "uuid1"
}
]
},
"account": {
"data": {
"type": "payment_mean",
"id": "uuid2"
}
},
"workspaces": {
"data": [
{
"type": "workspace",
"id": "workspace_tenant"
}
]
}
},
"included": {
"transaction": [
{
"type": "transaction",
"id": "uuid1",
"attributes": {
"scheme": "sepa",
"external_ids": {
"transaction_id": "TXN_SEPA_20250601_001",
"payment_request_id": "PAY_REQ_001",
"end_to_end_id": "E2E_20250601_ACME_001"
},
"requested_execution_date": "2025-06-01",
"executed_at": "2025-06-01T10:30:00Z",
"booking_date": "2025-06-01",
"value_date": "2025-06-01",
"instructed_amount": {
"currency": "EUR",
"amount": 50
},
"settlement_amount": {
"currency": "USD",
"amount": 54.25
},
"foreign_exchange": {
"currency_rate": "1.0850",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-01T10:00:00Z"
},
"transaction_type": "transfer",
"status": "completed",
"category_purpose": "CBFF",
"purpose_code": "SALA",
"remittance_information": {
"unstructured": "Balance related transaction",
"structured_reference": "RF18539007547034",
"reference_type": "SCOR"
},
"fees": [
{
"type": "transfer_fee",
"amount": 1.5,
"currency": "EUR"
}
],
"created_at": "2025-06-01T10:30:00Z",
"updated_at": "2025-06-01T10:30:00Z"
}
}
],
"account": [
{
"type": "payment_means",
"id": "uuid2",
"attributes": {
"type": "account_details",
"scheme": "ACH",
"status": "active",
"account_details": {
"account_number": "1234567890",
"routing_number": "021000021",
"account_type": "checking",
"currency": "USD"
},
"bank_details": {
"bank_name": "JPMorgan Chase Bank, N.A.",
"bank_code": "CHASUS33",
"branch_name": "New York Main Branch",
"branch_code": "NY001"
},
"compliance": {
"kyc_status": "verified",
"aml_status": "cleared"
},
"nickname": "Main Operating Account",
"description": "Primary USD account for operations",
"tags": [
"usd",
"operating",
"primary"
],
"created_at": "2025-06-01T10:00:00Z",
"updated_at": "2025-06-01T10:00:00Z"
}
}
],
"workspaces": [
{
"type": "workspace",
"id": "workspace_tenant",
"attributes": {
"name": "Main Workspace",
"description": "Primary workspace for financial operations",
"created_at": "2025-06-01T08:00:00Z",
"updated_at": "2025-06-01T12:00:00Z",
"avatar_color": "#4A90E2",
"external_workspace_id": "workspace-001",
"auto_extract_enabled": true
}
}
]
}
}{
"code": "SCHEMA_VALIDATION_ERROR",
"status": 400,
"title": "Validation Error",
"message": "The request is invalid",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
},
"details": [
{
"instancePath": "<string>",
"schemaPath": "<string>",
"keyword": "<string>",
"params": {},
"message": "<string>"
}
]
}{
"code": "UNAUTHORIZED",
"status": 401,
"title": "Unauthorized",
"message": "You are not authorized to access this resource",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}Balances
Create Balance
Create a new balance record with local and accounting currency information, foreign exchange rates, and account relationships.
POST
/
v1
/
balances
Create a balance record
curl --request POST \
--url https://api.wellapp.ai/v1/balances \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "balance",
"attributes": {
"local_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "USD"
},
"accounting_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "EUR"
},
"foreign_exchange": [
{
"currency_rate": "1.2546",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-01T14:30:00Z"
},
{
"currency_rate": "1.2546",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-03T14:30:00Z"
}
],
"balance_at_from": "2025-06-01T10:00:00Z",
"balance_at_to": "2025-06-03T10:00:00Z"
},
"relationships": {
"transactions": {
"data": [
{
"type": "transaction",
"id": "uuid1"
}
]
},
"account": {
"data": {
"type": "payment_mean",
"id": "uuid2"
}
},
"workspaces": {
"data": [
{
"type": "workspace",
"id": "workspace_tenant"
}
]
}
}
}
'import requests
url = "https://api.wellapp.ai/v1/balances"
payload = {
"type": "balance",
"attributes": {
"local_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "USD"
},
"accounting_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "EUR"
},
"foreign_exchange": [
{
"currency_rate": "1.2546",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-01T14:30:00Z"
},
{
"currency_rate": "1.2546",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-03T14:30:00Z"
}
],
"balance_at_from": "2025-06-01T10:00:00Z",
"balance_at_to": "2025-06-03T10:00:00Z"
},
"relationships": {
"transactions": { "data": [
{
"type": "transaction",
"id": "uuid1"
}
] },
"account": { "data": {
"type": "payment_mean",
"id": "uuid2"
} },
"workspaces": { "data": [
{
"type": "workspace",
"id": "workspace_tenant"
}
] }
}
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
type: 'balance',
attributes: {
local_balance: {
opening_booked: '123.32',
opening_value: '124.42',
closing_booked: '123.32',
closing_value: '124.42',
currency: 'USD'
},
accounting_balance: {
opening_booked: '123.32',
opening_value: '124.42',
closing_booked: '123.32',
closing_value: '124.42',
currency: 'EUR'
},
foreign_exchange: [
{
currency_rate: '1.2546',
currency_pair: 'EURUSD',
currency_rate_source: 'European Central Bank',
currency_rate_at: '2025-06-01T14:30:00Z'
},
{
currency_rate: '1.2546',
currency_pair: 'EURUSD',
currency_rate_source: 'European Central Bank',
currency_rate_at: '2025-06-03T14:30:00Z'
}
],
balance_at_from: '2025-06-01T10:00:00Z',
balance_at_to: '2025-06-03T10:00:00Z'
},
relationships: {
transactions: {data: [{type: 'transaction', id: 'uuid1'}]},
account: {data: {type: 'payment_mean', id: 'uuid2'}},
workspaces: {data: [{type: 'workspace', id: 'workspace_tenant'}]}
}
})
};
fetch('https://api.wellapp.ai/v1/balances', 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://api.wellapp.ai/v1/balances",
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([
'type' => 'balance',
'attributes' => [
'local_balance' => [
'opening_booked' => '123.32',
'opening_value' => '124.42',
'closing_booked' => '123.32',
'closing_value' => '124.42',
'currency' => 'USD'
],
'accounting_balance' => [
'opening_booked' => '123.32',
'opening_value' => '124.42',
'closing_booked' => '123.32',
'closing_value' => '124.42',
'currency' => 'EUR'
],
'foreign_exchange' => [
[
'currency_rate' => '1.2546',
'currency_pair' => 'EURUSD',
'currency_rate_source' => 'European Central Bank',
'currency_rate_at' => '2025-06-01T14:30:00Z'
],
[
'currency_rate' => '1.2546',
'currency_pair' => 'EURUSD',
'currency_rate_source' => 'European Central Bank',
'currency_rate_at' => '2025-06-03T14:30:00Z'
]
],
'balance_at_from' => '2025-06-01T10:00:00Z',
'balance_at_to' => '2025-06-03T10:00:00Z'
],
'relationships' => [
'transactions' => [
'data' => [
[
'type' => 'transaction',
'id' => 'uuid1'
]
]
],
'account' => [
'data' => [
'type' => 'payment_mean',
'id' => 'uuid2'
]
],
'workspaces' => [
'data' => [
[
'type' => 'workspace',
'id' => 'workspace_tenant'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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://api.wellapp.ai/v1/balances"
payload := strings.NewReader("{\n \"type\": \"balance\",\n \"attributes\": {\n \"local_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"USD\"\n },\n \"accounting_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"EUR\"\n },\n \"foreign_exchange\": [\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-01T14:30:00Z\"\n },\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-03T14:30:00Z\"\n }\n ],\n \"balance_at_from\": \"2025-06-01T10:00:00Z\",\n \"balance_at_to\": \"2025-06-03T10:00:00Z\"\n },\n \"relationships\": {\n \"transactions\": {\n \"data\": [\n {\n \"type\": \"transaction\",\n \"id\": \"uuid1\"\n }\n ]\n },\n \"account\": {\n \"data\": {\n \"type\": \"payment_mean\",\n \"id\": \"uuid2\"\n }\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_tenant\"\n }\n ]\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
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://api.wellapp.ai/v1/balances")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"balance\",\n \"attributes\": {\n \"local_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"USD\"\n },\n \"accounting_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"EUR\"\n },\n \"foreign_exchange\": [\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-01T14:30:00Z\"\n },\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-03T14:30:00Z\"\n }\n ],\n \"balance_at_from\": \"2025-06-01T10:00:00Z\",\n \"balance_at_to\": \"2025-06-03T10:00:00Z\"\n },\n \"relationships\": {\n \"transactions\": {\n \"data\": [\n {\n \"type\": \"transaction\",\n \"id\": \"uuid1\"\n }\n ]\n },\n \"account\": {\n \"data\": {\n \"type\": \"payment_mean\",\n \"id\": \"uuid2\"\n }\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_tenant\"\n }\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wellapp.ai/v1/balances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"balance\",\n \"attributes\": {\n \"local_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"USD\"\n },\n \"accounting_balance\": {\n \"opening_booked\": \"123.32\",\n \"opening_value\": \"124.42\",\n \"closing_booked\": \"123.32\",\n \"closing_value\": \"124.42\",\n \"currency\": \"EUR\"\n },\n \"foreign_exchange\": [\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-01T14:30:00Z\"\n },\n {\n \"currency_rate\": \"1.2546\",\n \"currency_pair\": \"EURUSD\",\n \"currency_rate_source\": \"European Central Bank\",\n \"currency_rate_at\": \"2025-06-03T14:30:00Z\"\n }\n ],\n \"balance_at_from\": \"2025-06-01T10:00:00Z\",\n \"balance_at_to\": \"2025-06-03T10:00:00Z\"\n },\n \"relationships\": {\n \"transactions\": {\n \"data\": [\n {\n \"type\": \"transaction\",\n \"id\": \"uuid1\"\n }\n ]\n },\n \"account\": {\n \"data\": {\n \"type\": \"payment_mean\",\n \"id\": \"uuid2\"\n }\n },\n \"workspaces\": {\n \"data\": [\n {\n \"type\": \"workspace\",\n \"id\": \"workspace_tenant\"\n }\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"type": "balance",
"id": "balance1",
"attributes": {
"local_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "USD"
},
"accounting_balance": {
"opening_booked": "123.32",
"opening_value": "124.42",
"closing_booked": "123.32",
"closing_value": "124.42",
"currency": "EUR"
},
"foreign_exchange": [
{
"currency_rate": "1.2546",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-01T14:30:00Z"
}
],
"balance_at_from": "2025-06-01T10:00:00Z",
"balance_at_to": "2025-06-03T10:00:00Z"
},
"relationships": {
"transactions": {
"data": [
{
"type": "transaction",
"id": "uuid1"
}
]
},
"account": {
"data": {
"type": "payment_mean",
"id": "uuid2"
}
},
"workspaces": {
"data": [
{
"type": "workspace",
"id": "workspace_tenant"
}
]
}
},
"included": {
"transaction": [
{
"type": "transaction",
"id": "uuid1",
"attributes": {
"scheme": "sepa",
"external_ids": {
"transaction_id": "TXN_SEPA_20250601_001",
"payment_request_id": "PAY_REQ_001",
"end_to_end_id": "E2E_20250601_ACME_001"
},
"requested_execution_date": "2025-06-01",
"executed_at": "2025-06-01T10:30:00Z",
"booking_date": "2025-06-01",
"value_date": "2025-06-01",
"instructed_amount": {
"currency": "EUR",
"amount": 50
},
"settlement_amount": {
"currency": "USD",
"amount": 54.25
},
"foreign_exchange": {
"currency_rate": "1.0850",
"currency_pair": "EURUSD",
"currency_rate_source": "European Central Bank",
"currency_rate_at": "2025-06-01T10:00:00Z"
},
"transaction_type": "transfer",
"status": "completed",
"category_purpose": "CBFF",
"purpose_code": "SALA",
"remittance_information": {
"unstructured": "Balance related transaction",
"structured_reference": "RF18539007547034",
"reference_type": "SCOR"
},
"fees": [
{
"type": "transfer_fee",
"amount": 1.5,
"currency": "EUR"
}
],
"created_at": "2025-06-01T10:30:00Z",
"updated_at": "2025-06-01T10:30:00Z"
}
}
],
"account": [
{
"type": "payment_means",
"id": "uuid2",
"attributes": {
"type": "account_details",
"scheme": "ACH",
"status": "active",
"account_details": {
"account_number": "1234567890",
"routing_number": "021000021",
"account_type": "checking",
"currency": "USD"
},
"bank_details": {
"bank_name": "JPMorgan Chase Bank, N.A.",
"bank_code": "CHASUS33",
"branch_name": "New York Main Branch",
"branch_code": "NY001"
},
"compliance": {
"kyc_status": "verified",
"aml_status": "cleared"
},
"nickname": "Main Operating Account",
"description": "Primary USD account for operations",
"tags": [
"usd",
"operating",
"primary"
],
"created_at": "2025-06-01T10:00:00Z",
"updated_at": "2025-06-01T10:00:00Z"
}
}
],
"workspaces": [
{
"type": "workspace",
"id": "workspace_tenant",
"attributes": {
"name": "Main Workspace",
"description": "Primary workspace for financial operations",
"created_at": "2025-06-01T08:00:00Z",
"updated_at": "2025-06-01T12:00:00Z",
"avatar_color": "#4A90E2",
"external_workspace_id": "workspace-001",
"auto_extract_enabled": true
}
}
]
}
}{
"code": "SCHEMA_VALIDATION_ERROR",
"status": 400,
"title": "Validation Error",
"message": "The request is invalid",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
},
"details": [
{
"instancePath": "<string>",
"schemaPath": "<string>",
"keyword": "<string>",
"params": {},
"message": "<string>"
}
]
}{
"code": "UNAUTHORIZED",
"status": 401,
"title": "Unauthorized",
"message": "You are not authorized to access this resource",
"meta": {
"log_id": "65c669d4-679c-4a8b-b8c0-fbe37699bb5b"
}
}⌘I