$cashDrawersApi = $client->getCashDrawersApi();
CashDrawersApi
Provides the details for all of the cash drawer shifts for a location in a date range.
function listCashDrawerShifts(
string $locationId,
?string $sortOrder = null,
?string $beginTime = null,
?string $endTime = null,
?int $limit = null,
?string $cursor = null
): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
locationId |
string |
Query, Required | The ID of the location to query for a list of cash drawer shifts. |
sortOrder |
?string(SortOrder) |
Query, Optional | The order in which cash drawer shifts are listed in the response, based on their opened_at field. Default value: ASC |
beginTime |
?string |
Query, Optional | The inclusive start time of the query on opened_at, in ISO 8601 format. |
endTime |
?string |
Query, Optional | The exclusive end date of the query on opened_at, in ISO 8601 format. |
limit |
?int |
Query, Optional | Number of cash drawer shift events in a page of results (200 by default, 1000 max). |
cursor |
?string |
Query, Optional | Opaque cursor for fetching the next page of results. |
This method returns a Square\Utils\ApiResponse
instance. The getResult()
method on this instance returns the response data which is of type ListCashDrawerShiftsResponse
.
$locationId = 'location_id4';
$apiResponse = $cashDrawersApi->listCashDrawerShifts($locationId);
if ($apiResponse->isSuccess()) {
$listCashDrawerShiftsResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());
Provides the summary details for a single cash drawer shift. See ListCashDrawerShiftEvents for a list of cash drawer shift events.
function retrieveCashDrawerShift(string $locationId, string $shiftId): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
locationId |
string |
Query, Required | The ID of the location to retrieve cash drawer shifts from. |
shiftId |
string |
Template, Required | The shift ID. |
This method returns a Square\Utils\ApiResponse
instance. The getResult()
method on this instance returns the response data which is of type RetrieveCashDrawerShiftResponse
.
$locationId = 'location_id4';
$shiftId = 'shift_id0';
$apiResponse = $cashDrawersApi->retrieveCashDrawerShift(
$locationId,
$shiftId
);
if ($apiResponse->isSuccess()) {
$retrieveCashDrawerShiftResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());
Provides a paginated list of events for a single cash drawer shift.
function listCashDrawerShiftEvents(
string $locationId,
string $shiftId,
?int $limit = null,
?string $cursor = null
): ApiResponse
Parameter | Type | Tags | Description |
---|---|---|---|
locationId |
string |
Query, Required | The ID of the location to list cash drawer shifts for. |
shiftId |
string |
Template, Required | The shift ID. |
limit |
?int |
Query, Optional | Number of resources to be returned in a page of results (200 by default, 1000 max). |
cursor |
?string |
Query, Optional | Opaque cursor for fetching the next page of results. |
This method returns a Square\Utils\ApiResponse
instance. The getResult()
method on this instance returns the response data which is of type ListCashDrawerShiftEventsResponse
.
$locationId = 'location_id4';
$shiftId = 'shift_id0';
$apiResponse = $cashDrawersApi->listCashDrawerShiftEvents(
$locationId,
$shiftId
);
if ($apiResponse->isSuccess()) {
$listCashDrawerShiftEventsResponse = $apiResponse->getResult();
} else {
$errors = $apiResponse->getErrors();
}
// Getting more response information
var_dump($apiResponse->getStatusCode());
var_dump($apiResponse->getHeaders());