Journals
Part of the Accounts API. Base URL https://your-domain.com/admin/api/v1 — replace the host with your own installation and the token placeholder with a real Bearer token (see Authentication).
List journals
GET/admin/api/v1/accounts/journalsRetrieve a paginated list of journals with filtering and sorting
🔒 Requires a valid Bearer token.
Query parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
include | string | No | Comma-separated list of relationships to include. Available options: company, currency, defaultAccount, suspenseAccount, profitAccount, lossAccount, bankAccount, creator, inboundPaymentMethodLines, outboundPaymentMethodLines | company,currency |
filter[id] | string | No | Comma-separated list of IDs to filter by | |
filter[name] | string | No | Filter by journal name (partial match) | |
filter[code] | string | No | Filter by journal code (partial match) | |
filter[type] | string | No | Filter by journal type | |
filter[company_id] | integer | No | Filter by company ID | |
filter[show_on_dashboard] | boolean | No | Filter by dashboard visibility | |
sort | string | Yes | Sort field | name |
page | integer | Yes | Page number | 1 |
bash
curl -X GET "https://your-domain.com/admin/api/v1/accounts/journals?include=company%2Ccurrency&sort=name&page=1" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"javascript
const response = await fetch("https://your-domain.com/admin/api/v1/accounts/journals?include=company%2Ccurrency&sort=name&page=1", {
method: "GET",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);php
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/accounts/journals?include=company%2Ccurrency&sort=name&page=1', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);python
import requests
url = "https://your-domain.com/admin/api/v1/accounts/journals?include=company%2Ccurrency&sort=name&page=1"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
data = response.json()
print(data)Example response 200
json
{
"data": [
{
"id": 1,
"name": "Customer Invoices",
"code": "INV",
"type": "sale",
"color": "11",
"sort": 5,
"show_on_dashboard": 1,
"refund_order": 1,
"payment_order": 0,
"company_id": 1,
"currency_id": 20,
"default_account_id": 27,
"suspense_account_id": null,
"profit_account_id": null,
"loss_account_id": null,
"bank_account_id": null,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
{
"id": 1,
"name": "Customer Invoices",
"code": "INV",
"type": "sale",
"color": "11",
"sort": 5,
"show_on_dashboard": 1,
"refund_order": 1,
"payment_order": 0,
"company_id": 1,
"currency_id": 20,
"default_account_id": 27,
"suspense_account_id": null,
"profit_account_id": null,
"loss_account_id": null,
"bank_account_id": null,
"creator_id": 1,
"created_at": null,
"updated_at": null
}
],
"links": {
"first": "/?page=1",
"last": "/?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"page": null,
"active": false
},
{
"url": "/?page=1",
"label": "1",
"page": 1,
"active": true
},
{
"url": null,
"label": "Next »",
"page": null,
"active": false
}
],
"path": "/",
"per_page": 10,
"to": 2,
"total": 2
}
}Error response — 401
json
{
"message": "Unauthenticated."
}Create journal
POST/admin/api/v1/accounts/journalsCreate a new journal
🔒 Requires a valid Bearer token.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Journal name. Must not be greater than 255 characters. |
code | string | Yes | Journal code (max 5 chars). Must not be greater than 5 characters. |
type | string | Yes | Journal type. |
company_id | integer | No | Company ID. Must match an existing stored value. |
currency_id | integer | No | Currency ID. Must match an existing stored value. |
default_account_id | integer | No | Default account ID. Must match an existing stored value. |
suspense_account_id | integer | No | Suspense account ID. Must match an existing stored value. |
profit_account_id | integer | No | Profit account ID. Must match an existing stored value. |
loss_account_id | integer | No | Loss account ID. Must match an existing stored value. |
bank_account_id | integer | No | Bank account ID. Must match an existing stored value. |
color | string | No | Journal color (hex). Must not be greater than 7 characters. |
show_on_dashboard | boolean | No | Show on dashboard. |
refund_order | boolean | No | Refund order flag. |
payment_order | boolean | No | Payment order flag. |
inbound_payment_method_lines | object[] | No | Inbound payment method lines (for BANK, CASH, CREDIT_CARD journals). Include id for update, omit for create. |
outbound_payment_method_lines | object[] | No | Outbound payment method lines (for BANK, CASH, CREDIT_CARD journals). Include id for update, omit for create. |
inbound_payment_method_lines[].id | integer | No | Must match an existing stored value. |
inbound_payment_method_lines[].payment_method_id | integer | Yes | Must match an existing stored value. |
inbound_payment_method_lines[].name | string | Yes | Must not be greater than 255 characters. |
inbound_payment_method_lines[].payment_account_id | integer | No | Must match an existing stored value. |
outbound_payment_method_lines[].id | integer | No | Must match an existing stored value. |
outbound_payment_method_lines[].payment_method_id | integer | Yes | Must match an existing stored value. |
outbound_payment_method_lines[].name | string | Yes | Must not be greater than 255 characters. |
outbound_payment_method_lines[].payment_account_id | integer | No | Must match an existing stored value. |
bash
curl -X POST "https://your-domain.com/admin/api/v1/accounts/journals" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Bank Journal",
"code": "BNK",
"type": "bank",
"company_id": 1,
"currency_id": 1,
"default_account_id": 1,
"suspense_account_id": 2,
"profit_account_id": 3,
"loss_account_id": 4,
"bank_account_id": 1,
"color": "#3b82f6",
"show_on_dashboard": true,
"refund_order": false,
"payment_order": false,
"inbound_payment_method_lines": [
{
"payment_method_id": 1,
"name": "Manual",
"payment_account_id": 5
}
],
"outbound_payment_method_lines": [
{
"payment_method_id": 2,
"name": "Electronic",
"payment_account_id": 6
}
]
}'javascript
const response = await fetch("https://your-domain.com/admin/api/v1/accounts/journals", {
method: "POST",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Bank Journal",
"code": "BNK",
"type": "bank",
"company_id": 1,
"currency_id": 1,
"default_account_id": 1,
"suspense_account_id": 2,
"profit_account_id": 3,
"loss_account_id": 4,
"bank_account_id": 1,
"color": "#3b82f6",
"show_on_dashboard": true,
"refund_order": false,
"payment_order": false,
"inbound_payment_method_lines": [
{
"payment_method_id": 1,
"name": "Manual",
"payment_account_id": 5
}
],
"outbound_payment_method_lines": [
{
"payment_method_id": 2,
"name": "Electronic",
"payment_account_id": 6
}
]
}),
});
const data = await response.json();
console.log(data);php
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-domain.com/admin/api/v1/accounts/journals', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'Bank Journal',
'code' => 'BNK',
'type' => 'bank',
'company_id' => 1,
'currency_id' => 1,
'default_account_id' => 1,
'suspense_account_id' => 2,
'profit_account_id' => 3,
'loss_account_id' => 4,
'bank_account_id' => 1,
'color' => '#3b82f6',
'show_on_dashboard' => true,
'refund_order' => false,
'payment_order' => false,
'inbound_payment_method_lines' => [
[
'payment_method_id' => 1,
'name' => 'Manual',
'payment_account_id' => 5,
],
],
'outbound_payment_method_lines' => [
[
'payment_method_id' => 2,
'name' => 'Electronic',
'payment_account_id' => 6,
],
],
],
]);
$data = json_decode($response->getBody(), true);python
import requests
url = "https://your-domain.com/admin/api/v1/accounts/journals"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"name": "Bank Journal",
"code": "BNK",
"type": "bank",
"company_id": 1,
"currency_id": 1,
"default_account_id": 1,
"suspense_account_id": 2,
"profit_account_id": 3,
"loss_account_id": 4,
"bank_account_id": 1,
"color": "#3b82f6",
"show_on_dashboard": True,
"refund_order": False,
"payment_order": False,
"inbound_payment_method_lines": [
{
"payment_method_id": 1,
"name": "Manual",
"payment_account_id": 5,
},
],
"outbound_payment_method_lines": [
{
"payment_method_id": 2,
"name": "Electronic",
"payment_account_id": 6,
},
],
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 201
json
{
"data": {
"id": 1,
"name": "Customer Invoices",
"code": "INV",
"type": "sale",
"color": "11",
"sort": 5,
"show_on_dashboard": 1,
"refund_order": 1,
"payment_order": 0,
"company_id": 1,
"currency_id": 20,
"default_account_id": 27,
"suspense_account_id": null,
"profit_account_id": null,
"loss_account_id": null,
"bank_account_id": null,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
"message": "Journal created successfully."
}Error response — 401
json
{
"message": "Unauthenticated."
}Show journal
GET/admin/api/v1/accounts/journals/{id}Retrieve a specific journal by its ID
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The journal ID |
Query parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
include | string | No | Comma-separated list of relationships to include. Available options: company, currency, defaultAccount, suspenseAccount, profitAccount, lossAccount, bankAccount, creator, inboundPaymentMethodLines, outboundPaymentMethodLines | company,currency |
bash
curl -X GET "https://your-domain.com/admin/api/v1/accounts/journals/{id}?include=company%2Ccurrency" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"javascript
const response = await fetch("https://your-domain.com/admin/api/v1/accounts/journals/{id}?include=company%2Ccurrency", {
method: "GET",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);php
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/accounts/journals/{id}?include=company%2Ccurrency', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);python
import requests
url = "https://your-domain.com/admin/api/v1/accounts/journals/{id}?include=company%2Ccurrency"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
data = response.json()
print(data)Example response 200
json
{
"data": {
"id": 1,
"name": "Customer Invoices",
"code": "INV",
"type": "sale",
"color": "11",
"sort": 5,
"show_on_dashboard": 1,
"refund_order": 1,
"payment_order": 0,
"company_id": 1,
"currency_id": 20,
"default_account_id": 27,
"suspense_account_id": null,
"profit_account_id": null,
"loss_account_id": null,
"bank_account_id": null,
"creator_id": 1,
"created_at": null,
"updated_at": null
}
}Error response — 401
json
{
"message": "Unauthenticated."
}Update journal
PUT/admin/api/v1/accounts/journals/{id}Update an existing journal
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The journal ID |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Journal name. Must not be greater than 255 characters. |
code | string | No | Journal code (max 5 chars). Must not be greater than 5 characters. |
type | string | No | Journal type. |
company_id | integer | No | Company ID. Must match an existing stored value. |
currency_id | integer | No | Currency ID. Must match an existing stored value. |
default_account_id | integer | No | Default account ID. Must match an existing stored value. |
suspense_account_id | integer | No | Suspense account ID. Must match an existing stored value. |
profit_account_id | integer | No | Profit account ID. Must match an existing stored value. |
loss_account_id | integer | No | Loss account ID. Must match an existing stored value. |
bank_account_id | integer | No | Bank account ID. Must match an existing stored value. |
color | string | No | Journal color (hex). Must not be greater than 7 characters. |
show_on_dashboard | boolean | No | Show on dashboard. |
refund_order | boolean | No | Refund order flag. |
payment_order | boolean | No | Payment order flag. |
inbound_payment_method_lines | object[] | No | Inbound payment method lines (for BANK, CASH, CREDIT_CARD journals). Include id for update, omit for create. |
outbound_payment_method_lines | object[] | No | Outbound payment method lines (for BANK, CASH, CREDIT_CARD journals). Include id for update, omit for create. |
inbound_payment_method_lines[].id | integer | No | Must match an existing stored value. |
inbound_payment_method_lines[].payment_method_id | integer | Yes | Must match an existing stored value. |
inbound_payment_method_lines[].name | string | Yes | Must not be greater than 255 characters. |
inbound_payment_method_lines[].payment_account_id | integer | No | Must match an existing stored value. |
outbound_payment_method_lines[].id | integer | No | Must match an existing stored value. |
outbound_payment_method_lines[].payment_method_id | integer | Yes | Must match an existing stored value. |
outbound_payment_method_lines[].name | string | Yes | Must not be greater than 255 characters. |
outbound_payment_method_lines[].payment_account_id | integer | No | Must match an existing stored value. |
bash
curl -X PUT "https://your-domain.com/admin/api/v1/accounts/journals/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "Bank Journal",
"code": "BNK",
"type": "bank",
"company_id": 1,
"currency_id": 1,
"default_account_id": 1,
"suspense_account_id": 2,
"profit_account_id": 3,
"loss_account_id": 4,
"bank_account_id": 1,
"color": "#3b82f6",
"show_on_dashboard": true,
"refund_order": false,
"payment_order": false,
"inbound_payment_method_lines": [
{
"payment_method_id": 1,
"name": "Manual",
"payment_account_id": 5
}
],
"outbound_payment_method_lines": [
{
"payment_method_id": 2,
"name": "Electronic",
"payment_account_id": 6
}
]
}'javascript
const response = await fetch("https://your-domain.com/admin/api/v1/accounts/journals/{id}", {
method: "PUT",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Bank Journal",
"code": "BNK",
"type": "bank",
"company_id": 1,
"currency_id": 1,
"default_account_id": 1,
"suspense_account_id": 2,
"profit_account_id": 3,
"loss_account_id": 4,
"bank_account_id": 1,
"color": "#3b82f6",
"show_on_dashboard": true,
"refund_order": false,
"payment_order": false,
"inbound_payment_method_lines": [
{
"payment_method_id": 1,
"name": "Manual",
"payment_account_id": 5
}
],
"outbound_payment_method_lines": [
{
"payment_method_id": 2,
"name": "Electronic",
"payment_account_id": 6
}
]
}),
});
const data = await response.json();
console.log(data);php
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://your-domain.com/admin/api/v1/accounts/journals/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'Bank Journal',
'code' => 'BNK',
'type' => 'bank',
'company_id' => 1,
'currency_id' => 1,
'default_account_id' => 1,
'suspense_account_id' => 2,
'profit_account_id' => 3,
'loss_account_id' => 4,
'bank_account_id' => 1,
'color' => '#3b82f6',
'show_on_dashboard' => true,
'refund_order' => false,
'payment_order' => false,
'inbound_payment_method_lines' => [
[
'payment_method_id' => 1,
'name' => 'Manual',
'payment_account_id' => 5,
],
],
'outbound_payment_method_lines' => [
[
'payment_method_id' => 2,
'name' => 'Electronic',
'payment_account_id' => 6,
],
],
],
]);
$data = json_decode($response->getBody(), true);python
import requests
url = "https://your-domain.com/admin/api/v1/accounts/journals/{id}"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"name": "Bank Journal",
"code": "BNK",
"type": "bank",
"company_id": 1,
"currency_id": 1,
"default_account_id": 1,
"suspense_account_id": 2,
"profit_account_id": 3,
"loss_account_id": 4,
"bank_account_id": 1,
"color": "#3b82f6",
"show_on_dashboard": True,
"refund_order": False,
"payment_order": False,
"inbound_payment_method_lines": [
{
"payment_method_id": 1,
"name": "Manual",
"payment_account_id": 5,
},
],
"outbound_payment_method_lines": [
{
"payment_method_id": 2,
"name": "Electronic",
"payment_account_id": 6,
},
],
}
response = requests.put(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 200
json
{
"data": {
"id": 1,
"name": "Customer Invoices",
"code": "INV",
"type": "sale",
"color": "11",
"sort": 5,
"show_on_dashboard": 1,
"refund_order": 1,
"payment_order": 0,
"company_id": 1,
"currency_id": 20,
"default_account_id": 27,
"suspense_account_id": null,
"profit_account_id": null,
"loss_account_id": null,
"bank_account_id": null,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
"message": "Journal updated successfully."
}Error response — 401
json
{
"message": "Unauthenticated."
}Delete journal
DELETE/admin/api/v1/accounts/journals/{id}Delete a journal
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The journal ID |
bash
curl -X DELETE "https://your-domain.com/admin/api/v1/accounts/journals/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"javascript
const response = await fetch("https://your-domain.com/admin/api/v1/accounts/journals/{id}", {
method: "DELETE",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);php
<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://your-domain.com/admin/api/v1/accounts/journals/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);python
import requests
url = "https://your-domain.com/admin/api/v1/accounts/journals/{id}"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
response = requests.delete(url, headers=headers)
data = response.json()
print(data)Example response 200
json
{
"message": "Journal deleted successfully."
}Error response — 401
json
{
"message": "Unauthenticated."
}