Cash Roundings
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 cash roundings
GET/admin/api/v1/accounts/cash-roundingsRetrieve a paginated list of cash roundings 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: profitAccount, lossAccount, creator | profitAccount |
filter[id] | string | No | Comma-separated list of IDs to filter by | |
filter[name] | string | No | Filter by cash rounding name (partial match) | |
filter[strategy] | string | No | Filter by rounding strategy | |
filter[rounding_method] | string | No | Filter by rounding method | |
sort | string | Yes | Sort field | name |
page | integer | Yes | Page number | 1 |
curl -X GET "https://your-domain.com/admin/api/v1/accounts/cash-roundings?include=profitAccount&sort=name&page=1" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/accounts/cash-roundings?include=profitAccount&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
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/accounts/cash-roundings?include=profitAccount&sort=name&page=1', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/accounts/cash-roundings?include=profitAccount&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
{
"data": [
{
"id": null,
"name": "aut adipisci",
"strategy": "biggest_tax",
"rounding_method": "HALF-UP",
"rounding": 0.05,
"profit_account_id": 72,
"loss_account_id": 73,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
{
"id": null,
"name": "enim non",
"strategy": "biggest_tax",
"rounding_method": "HALF-UP",
"rounding": 0.05,
"profit_account_id": 74,
"loss_account_id": 75,
"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
{
"message": "Unauthenticated."
}Create cash rounding
POST/admin/api/v1/accounts/cash-roundingsCreate a new cash rounding
🔒 Requires a valid Bearer token.
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Cash rounding name. Must not be greater than 255 characters. |
strategy | string | Yes | Rounding strategy. |
rounding_method | string | Yes | Rounding method. |
rounding | number | Yes | Rounding precision. Must be at least 0. |
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. |
curl -X POST "https://your-domain.com/admin/api/v1/accounts/cash-roundings" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "0.05 Rounding",
"strategy": "biggest_tax",
"rounding_method": "UP",
"rounding": 0.05,
"profit_account_id": 1,
"loss_account_id": 2
}'const response = await fetch("https://your-domain.com/admin/api/v1/accounts/cash-roundings", {
method: "POST",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "0.05 Rounding",
"strategy": "biggest_tax",
"rounding_method": "UP",
"rounding": 0.05,
"profit_account_id": 1,
"loss_account_id": 2
}),
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-domain.com/admin/api/v1/accounts/cash-roundings', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => '0.05 Rounding',
'strategy' => 'biggest_tax',
'rounding_method' => 'UP',
'rounding' => 0.05,
'profit_account_id' => 1,
'loss_account_id' => 2,
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/accounts/cash-roundings"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"name": "0.05 Rounding",
"strategy": "biggest_tax",
"rounding_method": "UP",
"rounding": 0.05,
"profit_account_id": 1,
"loss_account_id": 2,
}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 201
{
"data": {
"id": null,
"name": "architecto eius",
"strategy": "biggest_tax",
"rounding_method": "HALF-UP",
"rounding": 0.05,
"profit_account_id": 76,
"loss_account_id": 77,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
"message": "Cash rounding created successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Show cash rounding
GET/admin/api/v1/accounts/cash-roundings/{id}Retrieve a specific cash rounding by its ID
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The cash rounding ID |
Query parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
include | string | No | Comma-separated list of relationships to include. Available options: profitAccount, lossAccount, creator | profitAccount,lossAccount |
curl -X GET "https://your-domain.com/admin/api/v1/accounts/cash-roundings/{id}?include=profitAccount%2ClossAccount" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/accounts/cash-roundings/{id}?include=profitAccount%2ClossAccount", {
method: "GET",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/accounts/cash-roundings/{id}?include=profitAccount%2ClossAccount', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/accounts/cash-roundings/{id}?include=profitAccount%2ClossAccount"
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
{
"data": {
"id": null,
"name": "aut adipisci",
"strategy": "biggest_tax",
"rounding_method": "HALF-UP",
"rounding": 0.05,
"profit_account_id": 78,
"loss_account_id": 79,
"creator_id": 1,
"created_at": null,
"updated_at": null
}
}Error response — 401
{
"message": "Unauthenticated."
}Update cash rounding
PUT/admin/api/v1/accounts/cash-roundings/{id}Update an existing cash rounding
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The cash rounding ID |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Cash rounding name. Must not be greater than 255 characters. |
strategy | string | No | Rounding strategy. |
rounding_method | string | No | Rounding method. |
rounding | number | No | Rounding precision. Must be at least 0. |
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. |
curl -X PUT "https://your-domain.com/admin/api/v1/accounts/cash-roundings/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"name": "0.05 Rounding",
"strategy": "biggest_tax",
"rounding_method": "UP",
"rounding": 0.05,
"profit_account_id": 1,
"loss_account_id": 2
}'const response = await fetch("https://your-domain.com/admin/api/v1/accounts/cash-roundings/{id}", {
method: "PUT",
headers: {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "0.05 Rounding",
"strategy": "biggest_tax",
"rounding_method": "UP",
"rounding": 0.05,
"profit_account_id": 1,
"loss_account_id": 2
}),
});
const data = await response.json();
console.log(data);<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://your-domain.com/admin/api/v1/accounts/cash-roundings/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => '0.05 Rounding',
'strategy' => 'biggest_tax',
'rounding_method' => 'UP',
'rounding' => 0.05,
'profit_account_id' => 1,
'loss_account_id' => 2,
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/accounts/cash-roundings/{id}"
headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Accept": "application/json",
"Content-Type": "application/json",
}
payload = {
"name": "0.05 Rounding",
"strategy": "biggest_tax",
"rounding_method": "UP",
"rounding": 0.05,
"profit_account_id": 1,
"loss_account_id": 2,
}
response = requests.put(url, headers=headers, json=payload)
data = response.json()
print(data)Example response 200
{
"data": {
"id": null,
"name": "architecto eius",
"strategy": "biggest_tax",
"rounding_method": "HALF-UP",
"rounding": 0.05,
"profit_account_id": 80,
"loss_account_id": 81,
"creator_id": 1,
"created_at": null,
"updated_at": null
},
"message": "Cash rounding updated successfully."
}Error response — 401
{
"message": "Unauthenticated."
}Delete cash rounding
DELETE/admin/api/v1/accounts/cash-roundings/{id}Delete a cash rounding
🔒 Requires a valid Bearer token.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The cash rounding ID |
curl -X DELETE "https://your-domain.com/admin/api/v1/accounts/cash-roundings/{id}" \
-H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"const response = await fetch("https://your-domain.com/admin/api/v1/accounts/cash-roundings/{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
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://your-domain.com/admin/api/v1/accounts/cash-roundings/{id}', [
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
]);
$data = json_decode($response->getBody(), true);import requests
url = "https://your-domain.com/admin/api/v1/accounts/cash-roundings/{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
{
"message": "Cash rounding deleted successfully."
}Error response — 401
{
"message": "Unauthenticated."
}