Skip to content

Instantly share code, notes, and snippets.

@elephantsneverforget
Last active September 8, 2023 19:36
Show Gist options
  • Save elephantsneverforget/2745337addcc2ee00956cc4a919f11de to your computer and use it in GitHub Desktop.
Save elephantsneverforget/2745337addcc2ee00956cc4a919f11de to your computer and use it in GitHub Desktop.
export type IterableEventPayload = {
eventName: string;
email?: string;
campaignId?: string;
dataFields: {
updatedShoppingCartItems?: Array<IterableItem>; // used for add to cart events
items?: Array<IterableItem>; // used for view item and view item list
};
};
export type IterableItem = {
image_url?: string;
price: number; // 65
// We could use some clarity here on which price belongs where an if we don't have discount info (which is not uncommon whether these fields should be left blank)
// original_line_price: number; // 65
// original_price: number; // 65
// discounted_price: number; // 65
list?: string;
quantity?: number; // 1
inventory_management: string;
vendor?: string; // "Core"
name?: string; // "Crew Ring Set"
url?: string; // product url "https://store.myshopify.com/products/crew-ring-set"
product_id?: string; // "6544869851267"
variant_id?: string;
sku?: string;
currency: string;
categories?: Array<string>; // ["rings"]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment