Table of Contents
List Cash Registers #
Requires authentication
Example request:
const url = new URL(
"https://pos.ultimatefosters.com/connector/api/cash-register"
);
let params = {
"status": "open",
"user_id": "10",
"start_date": "2018-06-25",
"end_date": "2018-06-25",
"location_id": "qui",
"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));
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
}
}
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 |
Create Cash Register #
Requires authentication
Example request:
const url = new URL(
"https://pos.ultimatefosters.com/connector/api/cash-register"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"location_id": 19,
"initial_amount": 147905884.875259,
"created_at": "2020-5-7 15:20:22",
"closed_at": "2020-5-7 15:20:22",
"status": "close",
"closing_amount": 0,
"total_card_slips": 5,
"total_cheques": 5,
"closing_note": "voluptas",
"transaction_ids": "1,2,3"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));
HTTP Request #
POST connector/api/cash-register
Body Parameters #
| Parameter | Type | Status | Description |
|---|---|---|---|
location_id |
integer | required | id of the business location |
initial_amount |
float | optional | Initial amount |
created_at |
string | optional | Register open datetime format:Y-m-d H:i:s, |
closed_at |
string | optional | Register closed datetime format:Y-m-d H:i:s, |
status |
register | optional | status (open, close) |
closing_amount |
float | optional | Closing amount |
total_card_slips |
integer | optional | total number of card slips |
total_cheques |
integer | optional | total number of checks |
closing_note |
string | optional | Closing note |
transaction_ids |
string | optional | Comma separated ids of sells associated with the register |
Get the specified Register #
Requires authentication
Example request:
const url = new URL(
"https://pos.ultimatefosters.com/connector/api/cash-register/59"
);
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));
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"
}
]
}
]
}
