Overview /
Operations /
Close the cash day
Close the cash day
post
https://api.flactrum.com/v1/cash-records/{record}/close
Freezes the day-end report. If the counted cash — or any counted card total — differs from what was expected, a note explaining the difference is required: an unexplained discrepancy is the one thing that must not disappear quietly.
| Required scope | cash.write |
| Success status | 200 |
| Returns | One CashRecord object |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| record * | path | string | ULID of the record. |
Request body
| Field | Type | Description |
|---|---|---|
| counted_cash * | number | Cash actually counted in the drawer. |
| cash_breakdown | object | Optional denomination counts, e.g. {"200": 3, "100": 8}. |
| method_counts | object | Counted totals per non-cash payment method, keyed by method id. |
| note | string|null | Required whenever the count differs from the expected amount. |
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | — |
| branch_id | string | — |
| date | string | — |
| status | string | — |
| opening_balance | number | — |
| closing_balance | number|null | What was actually counted at close. |
| expected_balance | number|null | What should have been in the drawer. Frozen at close. |
| difference | number|null | counted − expected. Negative means cash is missing. |
| total_sales | number|null | — |
| cash_sales | number|null | — |
| payment_breakdown | object|null | Sales per payment method, frozen at close. |
| cash_breakdown | object|null | Note and coin counts entered at close. |
| count_code | string|null | 10-character envelope code issued at close (shown as XXXXX-XXXXX). Opens the count page behind count_url. |
| count_url | string|null | Public page encoded in the envelope QR; shows the count only after count_code is entered. |
| method_counts | object|null | Counted amounts per non-cash method. |
| note | string|null | — |
| opened_at | string|null | — |
| closed_at | string|null | — |
Examples
Recorded from the test suite — these are real requests and their real responses.
curl -X POST 'https://api.flactrum.com/v1/cash-records/01m43mzbe84m2anpbf6hrwjmsf/close' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"counted_cash": 500,
"cash_breakdown": {
"200": 2,
"100": 1
}
}'
HTTP 200 · application/json
{
"data": {
"id": "01m43mzbe84m2anpbf6hrwjmsf",
"branch_id": "01m43mzbdnp6xze42d34dfyskp",
"branch": {
"id": "01m43mzbdnp6xze42d34dfyskp",
"name": "Nişantaşı",
"code": "NIS",
"city": "İstanbul",
"region": "Bölge 3",
"address": null,
"phone": null,
"is_active": true,
"opened_at": null,
"monthly_rent": null,
"latitude": null,
"longitude": null,
"working_hours": [],
"created_at": "2026-10-04T14:27:04+00:00",
"updated_at": "2026-10-04T14:27:04+00:00"
},
"date": "2026-10-04",
"status": "closed",
"opening_balance": 500,
"closing_balance": 500,
"expected_balance": 500,
"difference": 0,
"total_sales": 0,
"cash_sales": 0,
"payment_breakdown": [],
"cash_breakdown": {
"200": 2,
"100": 1
},
"method_counts": null,
"note": null,
"count_code": "A3M1T-Z1NFW",
"count_url": "http://test-brand.localhost:8000/sayim/U6detulJwP020R6HHU2jsbJqMFrktpqyK1PVdFvB",
"opened_at": "2026-10-04T14:27:04+00:00",
"closed_at": "2026-10-04T14:27:04+00:00",
"created_at": "2026-10-04T14:27:04+00:00",
"updated_at": "2026-10-04T14:27:04+00:00"
}
}
curl -X POST 'https://api.flactrum.com/v1/cash-records/01m43mzbp4j7j7chyrz301dr0h/close' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"counted_cash": 480
}'
HTTP 422 · application/json
{
"error": {
"code": "validation_failed",
"message": "The submitted data is invalid.",
"details": {
"fields": {
"note": [
"The count does not match the expected amount; a note explaining the difference is required."
]
}
}
}
}