pos. cart-update. event. observeTarget
An event extension target that observes cart updates
This is part of a POS UI Extensions developer preview. More information to come.
Anchor to cartupdateeventdataCartUpdateEventData
The data object provided to this extension target.
- Anchor to cartcartrequired
- Anchor to connectivityconnectivityrequired
- Anchor to devicedevicerequired
- Anchor to localelocalestringrequired
- Anchor to sessionsessionrequired
CartUpdateEventData
- cart
Cart
- connectivity
ConnectivityState
- device
Device
- locale
string
- session
Session
export interface CartUpdateEventData extends BaseData {
cart: Cart;
}
Cart
- cartDiscount
Discount
- cartDiscounts
Discount[]
- customer
Customer
- grandTotal
string
- lineItems
LineItem[]
- note
string
- properties
Record<string, string>
- subtotal
string
- taxTotal
string
export interface Cart {
subtotal: string;
taxTotal: string;
grandTotal: string;
note?: string;
cartDiscount?: Discount;
cartDiscounts: Discount[];
customer?: Customer;
lineItems: LineItem[];
properties: Record<string, string>;
}
Discount
- amount
number
- discountDescription
string
- type
string
export interface Discount {
amount: number;
discountDescription?: string;
type?: string;
}
Customer
- id
number
export interface Customer {
id: number;
}
LineItem
- attributedUserId
number
- discounts
Discount[]
- isGiftCard
boolean
- price
number
- productId
number
- properties
{ [key: string]: string; }
- quantity
number
- sku
string
- taxable
boolean
- taxLines
TaxLine[]
- title
string
- uuid
string
- variantId
number
- vendor
string
export interface LineItem {
uuid: string;
price?: number;
quantity: number;
title?: string;
variantId?: number;
productId?: number;
discounts: Discount[];
taxable: boolean;
taxLines: TaxLine[];
sku?: string;
vendor?: string;
properties: {[key: string]: string};
isGiftCard: boolean;
attributedUserId?: number;
}
TaxLine
- enabled
boolean
- price
Money
- rate
number
- rateRange
{ min: number; max: number; }
- title
string
- uuid
string
export interface TaxLine {
title: string;
price: Money;
rate: number;
uuid?: string;
rateRange?: {min: number; max: number};
enabled?: boolean;
}
Money
- amount
number
- currency
string
export interface Money {
amount: number;
currency: 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
- 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;
}
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'