List Cash Registers

Requires authentication

HTTP Request

GET connector/api/cash-register

Query Parameters

Parameter Status Description
status optional status of the register (open, close)
user_id optional id of the user
start_date optional format:Y-m-d
end_date optional format:Y-m-d
location_id optional id of the location
per_page optional Total records per page. default: 10, Set -1 for no pagination

Example request:

curl -X GET \
-G "http://erp.dstadvertising.com/connector/api/cash-register?status=open&user_id=10&start_date=2018-06-25&end_date=2018-06-25&location_id=autem&per_page=15" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}"

Example response (200):

{
"data": [
{
"id": 1,
"business_id": 1,
"location_id": 1,
"user_id": 9,
"status": "open",
"closed_at": null,
"closing_amount": "0.0000",
"total_card_slips": 0,
"total_cheques": 0,
"closing_note": null,
"created_at": "2020-07-02 12:03:00",
"updated_at": "2020-07-02 12:03:19",
"cash_register_transactions": [
{
"id": 1,
"cash_register_id": 1,
"amount": "0.0000",
"pay_method": "cash",
"type": "credit",
"transaction_type": "initial",
"transaction_id": null, "created_at": "2018-07-13 07:39:34",
"updated_at": "2018-07-13 07:39:34"
},
{
"id": 2,
"cash_register_id": 1,
"amount": "42.5000",
"pay_method": "cash",
"type": "credit",
"transaction_type": "sell",
"transaction_id": 41,
"created_at": "2018-07-13 07:44:40",
"updated_at": "2018-07-13 07:44:40"
}
]
},
{
"id": 2,
"business_id": 1,
"location_id": 1,
"user_id": 1,
"status": "",
"closed_at": "2020-07-02 12:03:00",
"closing_amount": "0.0000",
"total_card_slips": 0,
"total_cheques": 0,
"closing_note": null,
"created_at": "2020-07-06 15:38:23",
"updated_at": "2020-07-06 15:38:23",
"cash_register_transactions": [
{
"id": 19,
"cash_register_id": 2,
"amount": "10.0000",
"pay_method": "cash",
"type": "credit",
"transaction_type": "initial",
"transaction_id": null,
"created_at": "2020-07-06 15:38:23",
"updated_at": "2020-07-06 15:38:23"
}
]
}
],
"links": {
"first": "http:\/\/local.pos.com\/connector\/api\/cash-register?page=1",
"last": null,
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"path": "http:\/\/local.pos.com\/connector\/api\/cash-register",
"per_page": 10,
"to": 2
}
}

javascript

const url = new URL(
"http://erp.dstadvertising.com/connector/api/cash-register"
);
let params = {
"status": "open",
"user_id": "10",
"start_date": "2018-06-25",
"end_date": "2018-06-25",
"location_id": "autem",
"per_page": "15",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
fetch(url, {
method: "GET",
headers: headers,
})
.then(response => response.json())
.then(json => console.log(json));