PHP SDK for Checkbox.ua
- Installation
- Usage
- Cashier
- Organization
- Shifts
- [Creating a Z-Report and closing the current shift by the user (cashier)](Creating a Z-Report and closing the current shift by the user (cashier))
- Opening a new shift by a cashier
- Getting current cashier shifts
- Receiving information about the current shift
The recommended way to install Guzzle is through Composer.
composer require tdev-agency/checkbox-ua
- SignIn with login and password:
$entity = \TDevAgency\CheckboxUa\Entities\Requests\SignInRequestEntity::create([
'login' => 'login',
'password' => 'password',
'license_key' => 'license_key'
]);
- SignIn with pin code:
$entity = \TDevAgency\CheckboxUa\Entities\Requests\SignInRequestEntity::create([
'pin_code' => 'pin_code',
'license_key' => 'license_key'
]);
// For pin code sign in
$client = new CheckboxUa(CheckboxUa::DRIVER_SIGNIN_PIN_CODE, $entity);
// For sign in with login and password
$client = new CheckboxUa(CheckboxUa::DRIVER_SIGNIN, $entity);
Tags based on the official documentation of the checkbox.ua
There are two ways to call required tag.
E.g.: $cashier = $client->getCashier();
or by using helper method
$cashier = $client->make(\TDevAgency\CheckboxUa\Tags\Cashier::class);
$client->getCashier()->signOut()
$client->getCashier()->me()
$client->getCashier()->shift()
$client->getCashier()->checkSignature()
$client->make(\TDevAgency\CheckboxUa\Tags\Organization::class)->receiptConfig()
$client->make(\TDevAgency\CheckboxUa\Tags\Organization::class)->logoPng()
$client->make(\TDevAgency\CheckboxUa\Tags\Organization::class)->textLogoPng()
$client->make(\TDevAgency\CheckboxUa\Tags\Shifts::class)->closeShift()
Optionally, a Z-Report can be generated on the client side and passed in the body of this request
$entity = \TDevAgency\CheckboxUa\Entities\Requests\ShiftCloseRequestEntity::create($data)
$client->make(\TDevAgency\CheckboxUa\Tags\Shifts::class)->closeShift($entity)
$data
values:
Param | Default | type | Description |
---|---|---|---|
skip_client_name_check |
false |
boolean |
Skip Client Name Check |
fiscal_code |
null |
string |
Offline fiscal number |
fiscal_date |
null |
string |
Offline fiscal number |
report |
null |
\TDevAgency\CheckboxUa\Entities\Requests\ReportRequestEntity |
Offline shift close time (ignored when online shift close) |
$client->make(\TDevAgency\CheckboxUa\Tags\Shifts::class)->createShift($id, $fiscal_code, $fiscal_date)
Param | Default | type | Description |
---|---|---|---|
id |
null |
string |
The shift id is generated on the client side |
fiscal_code |
null |
string |
Offline fiscal number |
fiscal_date |
null |
string |
Offline fiscal number |
$client->make(\TDevAgency\CheckboxUa\Tags\Shifts::class)->getShifts($statuses, $limit, $offset, $desc)
Param | Default | type | Description |
---|---|---|---|
statuses |
[] |
array |
Array of any (Shift Status) Items Enum: "CREATED" "OPENING" "OPENED" "CLOSING" "CLOSED" Shift status |
limit |
25 |
int |
Limit |
offset |
0 |
int |
Offset |
desc |
false |
boolean |
Reverse sort order |
$client->make(\TDevAgency\CheckboxUa\Tags\Shifts::class)->getShift($id, $options)
Param | Default | type | Description |
---|---|---|---|
id |
int |
Required. Shift ID |
$entity = \TDevAgency\CheckboxUa\Entities\Requests\ReceiptQueryRequestEntity::create($data)
$client->getReceipts()->index($requestEntity)
$data
params for ReceiptQueryRequestEntity
:
Param | Default | type | Description |
---|---|---|---|
fiscal_code |
null |
string |
Fiscal number |
serial |
null |
string |
Serial |
desc |
false |
boolean |
Reverse sort order |
limit |
25 |
int |
Limit |
offset |
0 |
int |
Offset |