Guides
Product API / Feed
Product schema definitions
6min
This article describes the schema definitions that data derived from a your product API gets mapped onto.
TypeScript
1interface Product {
2 /**
3 * Universally unique identifier (v4) assigned by LiSA
4 */
5 readonly id: UUID;
6
7 /**
8 * The product name serves easy identification purposes within the LiSA
9 * backend only. It is publicly used in the LiSA Viewer App only if the
10 * product does not provide a title.
11 */
12 readonly name: string;
13
14 /**
15 * An array of tags assigned to the product.
16 */
17 tags: Tag[];
18
19 /**
20 * A key-value map of product images where key is an identifier to address
21 * a specific product image uniquely and value is an object containing
22 * basic image information such as its UUID and public URL.
23 *
24 * Optional.
25 */
26 assets?: Assets;
27
28 /**
29 * A key-value map of translations of the product description where key is
30 * a language's iso code (eg. 'de', 'en') and value is the translated
31 * product description.
32 *
33 * LocalizedString types provide a fallback (key '*') which their values
34 * default to, either if a specific translation is not available or the
35 * LiSA product is used in a single language only.
36 *
37 * Product descriptions support basic markdown-syntax for enriched text.
38 *
39 * Optional.
40 */
41 description?: LocalizedString;
42
43 /**
44 * An object structure that contains data used to synchronize product
45 * information from a customer's ecom platform.
46 *
47 * Optional.
48 */
49 origin?: ProductOrigin;
50
51 /**
52 * Product price information.
53 *
54 * Optional.
55 */
56 price?: Price;
57
58 /**
59 * An array of per-store specific overrides of either the price, product
60 * URL or both.
61 *
62 * Optional.
63 */
64 stores?: StoreConfig[];
65 /**
66 * A key-value map of translations of the product title where key is
67 * a language's iso code (eg. 'de', 'en') and value is the translated
68 * product title.
69 *
70 * LocalizedString types provide a fallback (key '*') which their values
71 * default to, either if a specific translation is not available or the
72 * LiSA product is used in a single language only.
73 *
74 * Optional.
75 * If not provided, the product's name is used in the LiSA Viewer App.
76 */
77 title?: LocalizedString;
78
79 /**
80 * A key-value map of translations of the product URL where key is
81 * a language's iso code (eg. 'de', 'en') and value is the translated
82 * product URL.
83 *
84 * The value of this property can either be a URL or a custom value -
85 * dependent on the integration scenario and potential custom
86 * implementation of LiSA Viewer App product event processing.
87 *
88 * LocalizedString types provide a fallback (key '*') which their values
89 * default to, either if a specific translation is not available or the
90 * LiSA product is used in a single language only.
91 *
92 * Optional.
93 */
94 url?: LocalizedString;
95}
TypeScript
1interface ProductOrigin {
2 /**
3 * Unique product identifier derived from the customer's ecom platform.
4 */
5 id: string;
6
7 /**
8 * The time of the most recent synchronisation of the product's data
9 * between the customer's ecom platform and the LiSA backend services.
10 *
11 * Optional.
12 */
13 lastSyncedAt?: Date;
14
15 /**
16 * The unique URL addressing the single product resource endpoint of a
17 * customer's product API.
18 *
19 * Optional.
20 */
21 url?: string;
22}
TypeScript
1interface Price {
2 /**
3 * The currency.
4 */
5 currency: Currency;
6
7 /**
8 * The discounted product price.
9 *
10 * Optional.
11 */
12 discounted?: Amount;
13
14 /**
15 * The original product price.
16 */
17 original: Amount;
18}
TypeScript
1interface Amount {
2 /**
3 * The actual price value.
4 *
5 * e.g. 49.99
6 */
7 value: number;
8}
TypeScript
1interface Currency {
2 /**
3 * The currency's name.
4 *
5 * e.g. EUR
6 *
7 * Optional.
8 */
9 name?: string;
10
11 /**
12 * The currency symbol.
13 *
14 * e.g. €
15 */
16 symbol: string;
17}
JS
1interface StoreConfig {
2 /**
3 * The store identifier.
4 */
5 store: string;
6
7 /**
8 * The store specific price.
9 *
10 * Optional.
11 */
12 price?: Price;
13
14 /**
15 * A key-value map of translations of the per-store specific product
16 * URL where key is a language's iso code (eg. 'de', 'en') and value
17 * is the translated product URL.
18 *
19 * The value of this property can either be a URL or a custom value -
20 * dependent on the integration scenario and potential custom
21 * implementation of LiSA Viewer App product event processing.
22 *
23 * LocalizedString types provide a fallback (key '*') which their values
24 * default to, either if a specific translation is not available or the
25 * LiSA product is used in a single language only.
26 *
27 * Optional.
28 */
29 url?: LocalizedString;
30}
Updated 25 Mar 2024
Did this page help you?