Close a cash register session
curl --request POST \
--url https://api.exowpee.com/v1/order/cash-registers/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cash_register_id": "<string>",
"closing_balance": 123
}
'import requests
url = "https://api.exowpee.com/v1/order/cash-registers/close"
payload = {
"cash_register_id": "<string>",
"closing_balance": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cash_register_id: '<string>', closing_balance: 123})
};
fetch('https://api.exowpee.com/v1/order/cash-registers/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/order/cash-registers/close",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cash_register_id' => '<string>',
'closing_balance' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/order/cash-registers/close"
payload := strings.NewReader("{\n \"cash_register_id\": \"<string>\",\n \"closing_balance\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/order/cash-registers/close")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cash_register_id\": \"<string>\",\n \"closing_balance\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/order/cash-registers/close")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cash_register_id\": \"<string>\",\n \"closing_balance\": 123\n}"
response = http.request(request)
puts response.read_body{
"auth": {
"access_token": "<string>",
"token_type": "bearer",
"expires_in": 123
},
"user": {
"is_seller": true,
"is_cashier": true,
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone_number": "<string>",
"type": "<string>",
"is_active": true,
"email_verified_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"current_user_profile_id": "<string>",
"user_profiles": "<array>"
}
}{
"message": "<string>",
"errors": {}
}Run a register session
Close a cash register session
The cashier currently running a register closes the session and declares the closing cash balance. The session ends and the cashier context is dropped.
POST
/
order
/
cash-registers
/
close
Close a cash register session
curl --request POST \
--url https://api.exowpee.com/v1/order/cash-registers/close \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cash_register_id": "<string>",
"closing_balance": 123
}
'import requests
url = "https://api.exowpee.com/v1/order/cash-registers/close"
payload = {
"cash_register_id": "<string>",
"closing_balance": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cash_register_id: '<string>', closing_balance: 123})
};
fetch('https://api.exowpee.com/v1/order/cash-registers/close', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/order/cash-registers/close",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cash_register_id' => '<string>',
'closing_balance' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/order/cash-registers/close"
payload := strings.NewReader("{\n \"cash_register_id\": \"<string>\",\n \"closing_balance\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/order/cash-registers/close")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cash_register_id\": \"<string>\",\n \"closing_balance\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/order/cash-registers/close")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cash_register_id\": \"<string>\",\n \"closing_balance\": 123\n}"
response = http.request(request)
puts response.read_body{
"auth": {
"access_token": "<string>",
"token_type": "bearer",
"expires_in": 123
},
"user": {
"is_seller": true,
"is_cashier": true,
"id": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"phone_number": "<string>",
"type": "<string>",
"is_active": true,
"email_verified_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"current_user_profile_id": "<string>",
"user_profiles": "<array>"
}
}{
"message": "<string>",
"errors": {}
}Company space
For: Cashier and seller
Conditions
- Only the cashier who is currently running the register can close it; the register id must be the one of the connected cashier session.
- The register must be open.
- closing_balance must not be negative, must not have more decimals than the company currency exponent, and cannot be greater than the current balance of the register’s ledger account.
- An open register session for the cashier running the register must exist.
- Marks the register closed and clears its current cashier.
- Closes the register session and stores the declared closing balance in minor units.
- Refreshes the last seen time of the cash register computer used for the register session.
- When the caller closes the register of their own cashier session, answers with a new login token without cash register context; otherwise answers {“detail”: true}. The difference between the register balance and the closing balance is not moved to another account.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Identifier of the register to close. Optional for a connected cashier: when omitted it is taken from the cashier's session. It must belong to the current company.
Required string length:
27Cash counted in the register at closing, in major units, not negative and with at most as many decimals as the company currency exponent. It cannot exceed the balance of the register's ledger account.