Skip to content

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/journals

Retrieve a paginated list of journals with filtering and sorting

🔒 Requires a valid Bearer token.

Query parameters

ParameterTypeRequiredDescriptionExample
includestringNoComma-separated list of relationships to include. Available options: company, currency, defaultAccount, suspenseAccount, profitAccount, lossAccount, bankAccount, creator, inboundPaymentMethodLines, outboundPaymentMethodLinescompany,currency
filter[id]stringNoComma-separated list of IDs to filter by
filter[name]stringNoFilter by journal name (partial match)
filter[code]stringNoFilter by journal code (partial match)
filter[type]stringNoFilter by journal type
filter[company_id]integerNoFilter by company ID
filter[show_on_dashboard]booleanNoFilter by dashboard visibility
sortstringYesSort fieldname
pageintegerYesPage number1
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": "&laquo; Previous",
        "page": null,
        "active": false
      },
      {
        "url": "/?page=1",
        "label": "1",
        "page": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "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/journals

Create a new journal

🔒 Requires a valid Bearer token.

Body parameters

ParameterTypeRequiredDescription
namestringYesJournal name. Must not be greater than 255 characters.
codestringYesJournal code (max 5 chars). Must not be greater than 5 characters.
typestringYesJournal type.
company_idintegerNoCompany ID. Must match an existing stored value.
currency_idintegerNoCurrency ID. Must match an existing stored value.
default_account_idintegerNoDefault account ID. Must match an existing stored value.
suspense_account_idintegerNoSuspense account ID. Must match an existing stored value.
profit_account_idintegerNoProfit account ID. Must match an existing stored value.
loss_account_idintegerNoLoss account ID. Must match an existing stored value.
bank_account_idintegerNoBank account ID. Must match an existing stored value.
colorstringNoJournal color (hex). Must not be greater than 7 characters.
show_on_dashboardbooleanNoShow on dashboard.
refund_orderbooleanNoRefund order flag.
payment_orderbooleanNoPayment order flag.
inbound_payment_method_linesobject[]NoInbound payment method lines (for BANK, CASH, CREDIT_CARD journals). Include id for update, omit for create.
outbound_payment_method_linesobject[]NoOutbound payment method lines (for BANK, CASH, CREDIT_CARD journals). Include id for update, omit for create.
inbound_payment_method_lines[].idintegerNoMust match an existing stored value.
inbound_payment_method_lines[].payment_method_idintegerYesMust match an existing stored value.
inbound_payment_method_lines[].namestringYesMust not be greater than 255 characters.
inbound_payment_method_lines[].payment_account_idintegerNoMust match an existing stored value.
outbound_payment_method_lines[].idintegerNoMust match an existing stored value.
outbound_payment_method_lines[].payment_method_idintegerYesMust match an existing stored value.
outbound_payment_method_lines[].namestringYesMust not be greater than 255 characters.
outbound_payment_method_lines[].payment_account_idintegerNoMust 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

ParameterTypeRequiredDescription
idintegerYesThe journal ID

Query parameters

ParameterTypeRequiredDescriptionExample
includestringNoComma-separated list of relationships to include. Available options: company, currency, defaultAccount, suspenseAccount, profitAccount, lossAccount, bankAccount, creator, inboundPaymentMethodLines, outboundPaymentMethodLinescompany,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

ParameterTypeRequiredDescription
idintegerYesThe journal ID

Body parameters

ParameterTypeRequiredDescription
namestringNoJournal name. Must not be greater than 255 characters.
codestringNoJournal code (max 5 chars). Must not be greater than 5 characters.
typestringNoJournal type.
company_idintegerNoCompany ID. Must match an existing stored value.
currency_idintegerNoCurrency ID. Must match an existing stored value.
default_account_idintegerNoDefault account ID. Must match an existing stored value.
suspense_account_idintegerNoSuspense account ID. Must match an existing stored value.
profit_account_idintegerNoProfit account ID. Must match an existing stored value.
loss_account_idintegerNoLoss account ID. Must match an existing stored value.
bank_account_idintegerNoBank account ID. Must match an existing stored value.
colorstringNoJournal color (hex). Must not be greater than 7 characters.
show_on_dashboardbooleanNoShow on dashboard.
refund_orderbooleanNoRefund order flag.
payment_orderbooleanNoPayment order flag.
inbound_payment_method_linesobject[]NoInbound payment method lines (for BANK, CASH, CREDIT_CARD journals). Include id for update, omit for create.
outbound_payment_method_linesobject[]NoOutbound payment method lines (for BANK, CASH, CREDIT_CARD journals). Include id for update, omit for create.
inbound_payment_method_lines[].idintegerNoMust match an existing stored value.
inbound_payment_method_lines[].payment_method_idintegerYesMust match an existing stored value.
inbound_payment_method_lines[].namestringYesMust not be greater than 255 characters.
inbound_payment_method_lines[].payment_account_idintegerNoMust match an existing stored value.
outbound_payment_method_lines[].idintegerNoMust match an existing stored value.
outbound_payment_method_lines[].payment_method_idintegerYesMust match an existing stored value.
outbound_payment_method_lines[].namestringYesMust not be greater than 255 characters.
outbound_payment_method_lines[].payment_account_idintegerNoMust 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

ParameterTypeRequiredDescription
idintegerYesThe 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."
}

Released under the MIT License.