Create Cash Register

Requires authentication

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

Example request:

curl -X POST \
"http://erp.dstadvertising.com/connector/api/cash-register" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"location_id":1,"initial_amount":10399915.568592248,"created_at":"2020-5-7 15:20:22","closed_at":"2020-5-7 15:20:22","status":"close","closing_amount":4319,"total_card_slips":15,"total_cheques":9,"closing_note":"sed","transaction_ids":"1,2,3"}'

javascript

const url = new URL(
"http://erp.dstadvertising.com/connector/api/cash-register"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"location_id": 1,
"initial_amount": 10399915.568592248,
"created_at": "2020-5-7 15:20:22",
"closed_at": "2020-5-7 15:20:22",
"status": "close",
"closing_amount": 4319,
"total_card_slips": 15,
"total_cheques": 9,
"closing_note": "sed",
"transaction_ids": "1,2,3"
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));