Skip to main content

Overview

Cash adjustments represent income (INFLOW) or expense (OUTFLOW) transactions split by tender type. Each adjustment can have multiple lines for CASH, CARD, and TRANSFER payments. Adjustments start as DRAFT and must be posted to affect session balances.

Create Cash Adjustment

POST /api/v1/cash-adjustments

Request Body

cash_session_id
integer
required
Cash session ID
type
string
required
Adjustment type: EXTERNAL_IMPORT (from POS/external system) or CORRECTION (manual correction)
direction
string
required
Cash flow direction: INFLOW (income) or OUTFLOW (expense)
source_system
string
Source system name (e.g., POS, ADMIN) - max 100 characters
notes
string
Adjustment notes (max 1000 characters)
meta
object
Additional metadata
lines
array
required
Adjustment lines by tender type (minimum 1 line)

Response

message
string
Success message
data
object
curl -X POST https://api.sushigo.local/api/v1/cash-adjustments \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "cash_session_id": 15,
    "type": "EXTERNAL_IMPORT",
    "direction": "INFLOW",
    "source_system": "POS",
    "notes": "Daily sales import",
    "lines": [
      {
        "tender_type": "CASH",
        "amount": 500.00,
        "currency": "MXN"
      },
      {
        "tender_type": "CARD",
        "amount": 750.50,
        "currency": "MXN",
        "card_terminal_id": 1,
        "reference": "TXN-12345"
      },
      {
        "tender_type": "TRANSFER",
        "amount": 100.00,
        "currency": "MXN",
        "bank_account_id": 1,
        "reference": "SPEI-67890"
      }
    ]
  }'
{
  "message": "Adjustment created successfully",
  "data": {
    "id": 42,
    "cash_session_id": 15,
    "source_system": "POS",
    "type": "EXTERNAL_IMPORT",
    "direction": "INFLOW",
    "notes": "Daily sales import",
    "posted_by": null,
    "posted_at": null,
    "meta": null,
    "created_at": "2025-12-13T18:00:00+00:00",
    "updated_at": "2025-12-13T18:00:00+00:00",
    "cash_session": {
      "id": 15,
      "operating_date": "2025-12-13"
    },
    "lines": [
      {
        "id": 101,
        "cash_adjustment_id": 42,
        "tender_type": "CASH",
        "amount": "500.0000",
        "currency": "MXN",
        "card_terminal_id": null,
        "bank_account_id": null,
        "reference": null,
        "created_at": "2025-12-13T18:00:00+00:00"
      },
      {
        "id": 102,
        "cash_adjustment_id": 42,
        "tender_type": "CARD",
        "amount": "750.5000",
        "currency": "MXN",
        "card_terminal_id": 1,
        "bank_account_id": null,
        "reference": "TXN-12345",
        "created_at": "2025-12-13T18:00:00+00:00"
      },
      {
        "id": 103,
        "cash_adjustment_id": 42,
        "tender_type": "TRANSFER",
        "amount": "100.0000",
        "currency": "MXN",
        "card_terminal_id": null,
        "bank_account_id": 1,
        "reference": "SPEI-67890",
        "created_at": "2025-12-13T18:00:00+00:00"
      }
    ]
  }
}

List Cash Adjustments

GET /api/v1/cash-adjustments

Query Parameters

cash_session_id
integer
Filter by cash session ID
type
string
Filter by adjustment type: EXTERNAL_IMPORT or CORRECTION
direction
string
Filter by direction: INFLOW or OUTFLOW
status
string
Filter by status: POSTED or DRAFT
sort_by
string
default:"created_at"
Sort field
sort_order
string
default:"desc"
Sort order: asc or desc
per_page
integer
default:"15"
Items per page

Response

Returns paginated list of adjustments with lines, session, and posted user information.
curl https://api.sushigo.local/api/v1/cash-adjustments?cash_session_id=15&status=DRAFT \
  -H "Authorization: Bearer YOUR_TOKEN"

Get Cash Adjustment

GET /api/v1/cash-adjustments/{id}

Path Parameters

id
integer
required
Cash adjustment ID

Response

data
object
Adjustment details with all lines, session, and posted user information

Post Cash Adjustment

Finalizes the adjustment by marking it as posted. Once posted, the adjustment affects the session balance calculation and cannot be modified or deleted.
POST /api/v1/cash-adjustments/{id}/post

Path Parameters

id
integer
required
Cash adjustment ID

Response

message
string
Success message
data
object
Posted adjustment with posted_at timestamp and posted_by user
curl -X POST https://api.sushigo.local/api/v1/cash-adjustments/42/post \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "message": "Adjustment posted successfully",
  "data": {
    "id": 42,
    "cash_session_id": 15,
    "type": "EXTERNAL_IMPORT",
    "direction": "INFLOW",
    "posted_by": 5,
    "posted_at": "2025-12-13T19:00:00+00:00",
    "lines": [...],
    "posted_by": {
      "id": 5,
      "name": "Juan Pérez"
    }
  }
}

Delete Cash Adjustment

Only DRAFT adjustments can be deleted. Posted adjustments are immutable.
DELETE /api/v1/cash-adjustments/{id}

Path Parameters

id
integer
required
Cash adjustment ID

Response

message
string
Success message
curl -X DELETE https://api.sushigo.local/api/v1/cash-adjustments/42 \
  -H "Authorization: Bearer YOUR_TOKEN"
{
  "message": "Adjustment deleted successfully"
}

Adjustment Types

Used for importing sales or transactions from external systems (POS, e-commerce platforms). This is the most common type for daily sales reconciliation.

Tender Type Rules

Each tender type has specific requirements:
  • CASH: No additional fields required. Amount goes directly into cash drawer.
  • CARD: Requires card_terminal_id to track which terminal processed the transaction.
  • TRANSFER: Requires bank_account_id to track which bank account received the funds.
All tender types can optionally include a reference field for external transaction IDs or receipt numbers.

Workflow Example

1

Create Adjustment

Create adjustment with multiple tender type lines (DRAFT status)
2

Review

Review line items, verify amounts against external records
3

Post Adjustment

Post adjustment to finalize and include in session balance
4

Session Closing

When all adjustments are posted, close the cash session

Build docs developers (and LLMs) love