Create
curl --request POST \
--url https://api-staging.genuka.com/2023-11/admin/treasuryAccounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounting_account_code": "571",
"balance": 50,
"label": "Espèces",
"medias": [
{
"link": "http://localhost:3000/assets/cash.png"
}
],
"metadata": null,
"shop_id": "",
"type": "cash"
}
'import requests
url = "https://api-staging.genuka.com/2023-11/admin/treasuryAccounts"
payload = {
"accounting_account_code": "571",
"balance": 50,
"label": "Espèces",
"medias": [{ "link": "http://localhost:3000/assets/cash.png" }],
"metadata": None,
"shop_id": "",
"type": "cash"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accounting_account_code: '571',
balance: 50,
label: 'Espèces',
medias: [{link: 'http://localhost:3000/assets/cash.png'}],
metadata: null,
shop_id: '',
type: 'cash'
})
};
fetch('https://api-staging.genuka.com/2023-11/admin/treasuryAccounts', 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-staging.genuka.com/2023-11/admin/treasuryAccounts",
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([
'accounting_account_code' => '571',
'balance' => 50,
'label' => 'Espèces',
'medias' => [
[
'link' => 'http://localhost:3000/assets/cash.png'
]
],
'metadata' => null,
'shop_id' => '',
'type' => 'cash'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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-staging.genuka.com/2023-11/admin/treasuryAccounts"
payload := strings.NewReader("{\n \"accounting_account_code\": \"571\",\n \"balance\": 50,\n \"label\": \"Espèces\",\n \"medias\": [\n {\n \"link\": \"http://localhost:3000/assets/cash.png\"\n }\n ],\n \"metadata\": null,\n \"shop_id\": \"\",\n \"type\": \"cash\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api-staging.genuka.com/2023-11/admin/treasuryAccounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounting_account_code\": \"571\",\n \"balance\": 50,\n \"label\": \"Espèces\",\n \"medias\": [\n {\n \"link\": \"http://localhost:3000/assets/cash.png\"\n }\n ],\n \"metadata\": null,\n \"shop_id\": \"\",\n \"type\": \"cash\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.genuka.com/2023-11/admin/treasuryAccounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounting_account_code\": \"571\",\n \"balance\": 50,\n \"label\": \"Espèces\",\n \"medias\": [\n {\n \"link\": \"http://localhost:3000/assets/cash.png\"\n }\n ],\n \"metadata\": null,\n \"shop_id\": \"\",\n \"type\": \"cash\"\n}"
response = http.request(request)
puts response.read_body{
"accounting_account_code": "571",
"balance": 50,
"company_id": "01hqydxwtxdj3kmzp3bz7jk73g",
"created_at": "2025-10-10T15:02:24.000000Z",
"id": "01k77aa0qxmg81kwc0bp94cc24",
"label": "Espèces",
"medias": [],
"metadata": null,
"shop": null,
"shop_id": null,
"type": "cash",
"updated_at": "2025-10-10T15:02:24.000000Z"
}{
"errors": {
"accounting_account_code": [
"The accounting account code field is required."
],
"balance": [
"The balance field is required."
],
"label": [
"The label field is required."
],
"type": [
"The type field is required."
]
},
"message": "The label field is required. (and 3 more errors)"
}Treasury accounts
Create treasury account
Creates a new treasury account within the authenticated company. This endpoint allows defining account details such as name, type, initial balance, associated currency, and optional metadata. Once created, the account can be used to manage incoming and outgoing financial transactions.
POST
/
2023-11
/
admin
/
treasuryAccounts
Create
curl --request POST \
--url https://api-staging.genuka.com/2023-11/admin/treasuryAccounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accounting_account_code": "571",
"balance": 50,
"label": "Espèces",
"medias": [
{
"link": "http://localhost:3000/assets/cash.png"
}
],
"metadata": null,
"shop_id": "",
"type": "cash"
}
'import requests
url = "https://api-staging.genuka.com/2023-11/admin/treasuryAccounts"
payload = {
"accounting_account_code": "571",
"balance": 50,
"label": "Espèces",
"medias": [{ "link": "http://localhost:3000/assets/cash.png" }],
"metadata": None,
"shop_id": "",
"type": "cash"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accounting_account_code: '571',
balance: 50,
label: 'Espèces',
medias: [{link: 'http://localhost:3000/assets/cash.png'}],
metadata: null,
shop_id: '',
type: 'cash'
})
};
fetch('https://api-staging.genuka.com/2023-11/admin/treasuryAccounts', 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-staging.genuka.com/2023-11/admin/treasuryAccounts",
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([
'accounting_account_code' => '571',
'balance' => 50,
'label' => 'Espèces',
'medias' => [
[
'link' => 'http://localhost:3000/assets/cash.png'
]
],
'metadata' => null,
'shop_id' => '',
'type' => 'cash'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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-staging.genuka.com/2023-11/admin/treasuryAccounts"
payload := strings.NewReader("{\n \"accounting_account_code\": \"571\",\n \"balance\": 50,\n \"label\": \"Espèces\",\n \"medias\": [\n {\n \"link\": \"http://localhost:3000/assets/cash.png\"\n }\n ],\n \"metadata\": null,\n \"shop_id\": \"\",\n \"type\": \"cash\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api-staging.genuka.com/2023-11/admin/treasuryAccounts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accounting_account_code\": \"571\",\n \"balance\": 50,\n \"label\": \"Espèces\",\n \"medias\": [\n {\n \"link\": \"http://localhost:3000/assets/cash.png\"\n }\n ],\n \"metadata\": null,\n \"shop_id\": \"\",\n \"type\": \"cash\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.genuka.com/2023-11/admin/treasuryAccounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accounting_account_code\": \"571\",\n \"balance\": 50,\n \"label\": \"Espèces\",\n \"medias\": [\n {\n \"link\": \"http://localhost:3000/assets/cash.png\"\n }\n ],\n \"metadata\": null,\n \"shop_id\": \"\",\n \"type\": \"cash\"\n}"
response = http.request(request)
puts response.read_body{
"accounting_account_code": "571",
"balance": 50,
"company_id": "01hqydxwtxdj3kmzp3bz7jk73g",
"created_at": "2025-10-10T15:02:24.000000Z",
"id": "01k77aa0qxmg81kwc0bp94cc24",
"label": "Espèces",
"medias": [],
"metadata": null,
"shop": null,
"shop_id": null,
"type": "cash",
"updated_at": "2025-10-10T15:02:24.000000Z"
}{
"errors": {
"accounting_account_code": [
"The accounting account code field is required."
],
"balance": [
"The balance field is required."
],
"label": [
"The label field is required."
],
"type": [
"The type field is required."
]
},
"message": "The label field is required. (and 3 more errors)"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Example:
"{{companyId}}"
Body
application/json
Response
201
Example:
"571"
Example:
50
Example:
"01hqydxwtxdj3kmzp3bz7jk73g"
Example:
"2025-10-10T15:02:24.000000Z"
Example:
"01k77aa0qxmg81kwc0bp94cc24"
Example:
"Espèces"
Example:
[]
Example:
"cash"
Example:
"2025-10-10T15:02:24.000000Z"
⌘I
