This document covers these APIs from ContractApiController in a quick-to-follow order.
GET /contracts/{id}POST /contracts/device-lockGET /registrationGET /status/{device_id}POST /temperedAll endpoints below are relative to this base URL.
Accept: application/json Content-Type: application/json
imei_number in backend code (spelling must match).
| API | Use Case | Required Input |
|---|---|---|
GET /contracts/{id} |
Get full contract details including payload/store/customer. | id (path) |
POST /contracts/device-lock |
Lock or unlock a contract device from app/backend. | contract_id, devices_lock (0 or 1) |
GET /registration |
Lookup device registration and contact details. | imei_number (query) |
GET /status/{device_id} |
Get app-ready lock and due/payment status. | device_id (path) |
POST /tempered |
Store tempered/tamper event log for a device. | imei_number, event |
Fetch full contract detail by contract ID.
| Field | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | Contract ID. |
curl "https://chronextechnologies.com/demo/pos/api/contracts/123" \ -H "Accept: application/json"
{
"status": true,
"message": "Contract details fetched successfully.",
"data": {
"contract_id": 123,
"store_id": 4,
"customer_id": 88,
"contract_status": "active",
"devices_lock": 1,
"devices_lock_label": "lock",
"payload": {},
"store": {},
"customer": {},
"created_at": "2026-04-08 13:10:10",
"updated_at": "2026-04-08 13:20:20"
}
}
404 {
"status": false,
"message": "Contract not found."
}
Update contract device lock state.
| Field | Type | Required | Description |
|---|---|---|---|
contract_id |
integer | Yes | Existing contract ID. |
devices_lock |
integer | Yes | 1 = lock, 0 = unlock. |
{
"contract_id": 123,
"devices_lock": 1
}
curl -X POST "https://chronextechnologies.com/demo/pos/api/contracts/device-lock" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"contract_id": 123,
"devices_lock": 1
}'
{
"status": true,
"message": "Contract device lock set to locked.",
"data": {
"contract_id": 123,
"devices_lock": 1,
"devices_lock_label": "lock",
"updated_at": "2026-04-16 18:20:00"
}
}
422 Validation error (missing/invalid contract_id or devices_lock)
404 {
"status": false,
"message": "Contract not found."
}
Fetch device registration and contact details by serial/IMEI/phone identifier.
| Field | Type | Required | Description |
|---|---|---|---|
imei_number |
string | Yes | Device identifier. Backend matches against contract payload fields contract.device_serial and contract.device_phone (case-insensitive). |
curl -G "https://chronextechnologies.com/demo/pos/api/registration" \ -H "Accept: application/json" \ --data-urlencode "imei_number=356938035643809"
{
"status": true,
"message": "Registration details fetched successfully.",
"data": {
"contract_id": 123,
"contract_status": "active",
"serial_number": "356938035643809",
"device": {
"serial_number": "356938035643809",
"model": "Samsung A14",
"protocol": "mdm",
"devices_lock": 0,
"devices_lock_label": "unlock"
},
"contact": {
"customer_name": "John Doe",
"customer_phone": "9876543210",
"customer_email": "john@example.com",
"store_name": "Demo Store",
"store_phone": "9000000000",
"store_email": "store@example.com"
},
"created_at": "2026-04-08 13:10:10",
"updated_at": "2026-04-08 13:20:20"
}
}
422 Validation error (missing or invalid imei_number)
404 {
"status": false,
"message": "No device registration found for this serial number."
}
Fetch lock/payment status for a device. This response includes exactly the app parsing fields: isLocked, amountDue, and paymentUrl.
| Field | Type | Required | Description |
|---|---|---|---|
device_id |
string | Yes | Device IMEI/serial/identifier. Backend matches against contract payload fields contract.device_serial and contract.device_phone. |
curl "https://chronextechnologies.com/demo/pos/api/status/356938035643809" \ -H "Accept: application/json"
{
"status": true,
"message": "Device status fetched successfully.",
"data": {
"deviceId": "356938035643809",
"isLocked": true,
"amountDue": 145.75,
"paymentUrl": "https://pay.example.com/invoice/123",
"contractId": 123
}
}
404 {
"status": false,
"message": "No contract found for this device.",
"data": {
"deviceId": "356938035643809",
"isLocked": false,
"amountDue": 0,
"paymentUrl": ""
}
}
Save a tempered event against matched device and contract, and return event snapshot data.
| Field | Type | Required | Description |
|---|---|---|---|
imei_number |
string | Yes | Device identifier. Backend normalizes value (trim/lowercase, removes serial: prefix if present). |
event |
string | Yes | Event details/message (max 1000 chars). |
{
"imei_number": "356938035643809",
"event": "Tamper alert received from device"
}
curl -X POST "https://chronextechnologies.com/demo/pos/api/tempered" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"imei_number": "356938035643809",
"event": "Tamper alert received from device"
}'
{
"status": true,
"message": "Tempered event saved successfully.",
"data": {
"tempered_event_id": 55,
"imei_number": "356938035643809",
"event": "Tamper alert received from device",
"device_id": 18,
"contract_id": 123,
"customer_id": 88,
"store_id": 4,
"device": {
"id": 18,
"serial_number": "356938035643809"
},
"contract": {
"id": 123,
"status": "active"
},
"customer": {
"id": 88,
"name": "John Doe"
},
"store": {
"id": 4,
"business_name": "Demo Store"
},
"created_at": "2026-04-08 13:30:30"
}
}
422 Validation error (missing imei_number/event)
404 {
"status": false,
"message": "Device not found for the provided imei_number."
}
404 {
"status": false,
"message": "Contract not found for the provided device."
}
GET /contracts/{id} returns a full contract envelope including store/customer references and payload.POST /contracts/device-lock accepts only devices_lock values 0 or 1.GET /registration looks up latest non-deleted contract by payload JSON fields.GET /status/{device_id} returns a fixed app-friendly structure with data.isLocked, data.amountDue, and data.paymentUrl.POST /tempered first finds device (serial or variations), then finds latest related contract, then saves to tempered_events.status and message.