Sales Register Management

Sales registers are specific cash register stations within a branch. For a terminal to process POS transactions, it must be linked to an active Sales Register.

Create Sales Register

Endpoint

POST /api/pos/sales-registers

Request Payload

FieldTypeRequiredDescription
pos_branches_idstringYesBranch ID
namestringYesRegister name (max 100 chars)
register_numberstringYesUnique register number within branch (max 50 chars)
external_idstringNoExternal system ID (max 100 chars)
statusstringNoStatus: active, inactive, maintenance (default: "active")
settingsobjectNoRegister settings
settings.require_operator_loginbooleanNoRequire operator login
settings.auto_print_receiptbooleanNoAuto-print receipts
settings.allow_refundsbooleanNoAllow refunds
settings.max_refund_amountnumberNoMaximum refund amount
settings.require_manager_approvalbooleanNoRequire manager approval for transactions
settings.manager_approval_thresholdnumberNoAmount threshold for manager approval
settings.receipt_copiesnumberNoNumber of receipt copies (1-5)
settings.timeout_minutesnumberNoSession timeout in minutes (1-60)
metadataobjectNoCustom metadata

Response

{
  "message": "Sales register created successfully",
  "data": { ... }
}


Get All Sales Registers

Retrieves all sales registers for the authenticated account.

Endpoint

GET /api/pos/sales-registers

Query Parameters

ParameterTypeDescription
pos_branches_idstringFilter by branch
statusstringFilter by status
has_terminalbooleanFilter by terminal linkage
pagenumberPage number
limitnumberItems per page

Response

{
  "data": [...],
  "pagination": {
    "total": 10,
    "page": 1,
    "limit": 50,
    "pages": 1
  }
}

Get Sales Register by ID

Retrieves a specific sales register with branch and terminal details.

Endpoint

GET /api/pos/sales-registers/:id

Response

{
  "data": {
    "_id": "...",
    "name": "Register 1",
    "pos_branches_id": { ... },
    "pos_information_id": { ... },
    ...
  }
}

Update Sales Register

Updates an existing sales register.

Endpoint

PUT /api/pos/sales-registers/:id

Request Body

FieldTypeRequiredDescription
namestringNoRegister name (max 100 chars)
external_idstringNoExternal system ID (max 100 chars)
statusstringNoStatus: active, inactive, maintenance
settingsobjectNoRegister settings (same as create)
metadataobjectNoCustom metadata

Response

{
  "message": "Sales register updated successfully",
  "data": { ... }
}

Delete Sales Register

Soft-deletes a sales register.

Endpoint

DELETE /api/pos/sales-registers/:id

Request Body

FieldTypeRequiredDescription
reasonstringNoDeletion reason (max 500 chars)

Response

{
  "message": "Sales register deleted successfully",
  "data": {
    "id": "...",
    "deleted_at": "..."
  }
}

Restore Sales Register

Restores a soft-deleted sales register.

Endpoint

POST /api/pos/sales-registers/:id/restore

Response

{
  "message": "Sales register restored successfully",
  "data": { ... }
}

Link Terminal to Register

Links a POS-enabled terminal to a sales register.

Endpoint

PUT /api/pos/sales-registers/:id/link-terminal

Request Body

FieldTypeRequiredDescription
pos_information_idstringYesPOS Information ID to link

Response

{
  "message": "Terminal linked successfully",
  "data": {
    "register_id": "...",
    "pos_information_id": "..."
  }
}

Unlink Terminal from Register

Unlinks a terminal from a sales register.

Endpoint

PUT /api/pos/sales-registers/:id/unlink-terminal

Request Body

FieldTypeRequiredDescription
reasonstringNoReason for unlinking (max 200 chars, default: "Manual unlink")

Response

{
  "message": "Terminal unlinked successfully"
}