pos. cash-tracking-session-complete. event. observeTarget
An event extension target that observes when cash tracking session completes
This is part of a POS UI Extensions developer preview. More information to come.
Anchor to cashtrackingsessioncompletedataCashTrackingSessionCompleteData
The data object provided to this extension target.
- Anchor to cashTrackingSessionCompletecashTrackingSessionComplete{ id: number; openingTime: string; closingTime: string; }required
- Anchor to connectivityconnectivityrequired
- Anchor to devicedevicerequired
- Anchor to localelocalestringrequired
- Anchor to sessionsessionrequired
- Anchor to storagestoragerequired
CashTrackingSessionCompleteData
- cashTrackingSessionComplete
{ id: number; openingTime: string; closingTime: string; }
- connectivity
ConnectivityState
- device
Device
- locale
string
- session
Session
- storage
Storage
export interface CashTrackingSessionCompleteData extends BaseData, BaseApi {
cashTrackingSessionComplete: {
id: number;
openingTime: string;
closingTime: string;
};
}
ConnectivityState
- internetConnected
Whether the device is connected to the internet
ConnectivityStateSeverity
export interface ConnectivityState {
/**
* Whether the device is connected to the internet
*/
internetConnected: ConnectivityStateSeverity;
}
ConnectivityStateSeverity
'Connected' | 'Disconnected'
Device
- deviceId
The ID of the device
number
- isTablet
Whether the device is a tablet
boolean
- name
The name of the device
string
export interface Device {
/**
* The name of the device
*/
name: string;
/**
* The ID of the device
*/
deviceId: number;
/**
* Whether the device is a tablet
*/
isTablet: boolean;
}
Session
- currency
The currency code associated with the location currently in on POS.
CurrencyCode
- locationId
The location ID associated with the POS' current location.
number
- posVersion
The POS version.
string
- shopDomain
The shop domain associated with the shop currently logged into POS.
string
- shopId
The shop ID associated with the shop currently logged into POS.
number
- staffMemberId
The staff ID who is currently pinned into the POS. Note that this staff member ID may be different to the User ID, as the staff member who enters their PIN may be different to the User who logged onto POS.
number
- userId
The user ID associated with the Shopify account currently authenticated on POS.
number
export interface Session {
/**
* The shop ID associated with the shop currently logged into POS.
*/
shopId: number;
/**
* The user ID associated with the Shopify account currently authenticated on POS.
*/
userId: number;
/**
* The shop domain associated with the shop currently logged into POS.
*/
shopDomain: string;
/**
* The location ID associated with the POS' current location.
*/
locationId: number;
/**
* The staff ID who is currently pinned into the POS.
* Note that this staff member ID may be different to the User ID, as the staff member who enters their PIN may be different to the User who logged onto POS.
*/
staffMemberId?: number;
/**
* The currency code associated with the location currently in on POS.
*/
currency: CurrencyCode;
/**
* The POS version.
*/
posVersion: string;
}
CurrencyCode
'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL'
Storage
- clear
Clears the storage.
() => Promise<void>
- delete
Deletes a key from the storage.
<StorageTypes extends BaseStorageTypes = BaseStorageTypes, Keys extends keyof StorageTypes = keyof StorageTypes>(key: Keys) => Promise<boolean>
- entries
Gets all the keys and values in the storage.
<StorageTypes extends BaseStorageTypes = BaseStorageTypes, Keys extends keyof StorageTypes = keyof StorageTypes>() => Promise<[Keys, StorageTypes[Keys]][]>
- get
Gets the value of a key in the storage.
<StorageTypes extends BaseStorageTypes = BaseStorageTypes, Keys extends keyof StorageTypes = keyof StorageTypes>(key: Keys) => Promise<StorageTypes[Keys]>
- set
Sets the value of a key in the storage.
<StorageTypes extends BaseStorageTypes = BaseStorageTypes, Keys extends keyof StorageTypes = keyof StorageTypes>(key: Keys, value: StorageTypes[Keys]) => Promise<void>
export interface Storage<
BaseStorageTypes extends Record<string, any> = Record<string, unknown>,
> {
/**
* Sets the value of a key in the storage.
*
* @param key - The key to set the value for.
* @param value - The value to set for the key.
* Can be any primitive type supported by `JSON.stringify`.
* @throws StorageError when:
* the extension exceeds its allotted storage limit.
* the value exceeds its allotted storage limit.
* the key is not a string or exceeds its allotted size.
*/
set<
StorageTypes extends BaseStorageTypes = BaseStorageTypes,
Keys extends keyof StorageTypes = keyof StorageTypes,
>(
key: Keys,
value: StorageTypes[Keys],
): Promise<void>;
/**
* Gets the value of a key in the storage.
*
* @param key - The key to get the value for.
* @returns The value of the key.
* If no value for the key exists, the resolved value is undefined.
* @throws StorageError when the key is not a string or exceeds its allotted size.
*/
get<
StorageTypes extends BaseStorageTypes = BaseStorageTypes,
Keys extends keyof StorageTypes = keyof StorageTypes,
>(
key: Keys,
): Promise<StorageTypes[Keys] | undefined>;
/**
* Clears the storage.
*/
clear: () => Promise<void>;
/**
* Deletes a key from the storage.
*
* @param key - The key to delete.
*/
delete<
StorageTypes extends BaseStorageTypes = BaseStorageTypes,
Keys extends keyof StorageTypes = keyof StorageTypes,
>(
key: Keys,
): Promise<boolean>;
/**
* Gets all the keys and values in the storage.
*
* @returns An array containing all the keys and values in the storage.
*/
entries<
StorageTypes extends BaseStorageTypes = BaseStorageTypes,
Keys extends keyof StorageTypes = keyof StorageTypes,
>(): Promise<[Keys, StorageTypes[Keys]][]>;
}