1 | /* eslint-disable */
|
2 | /**
|
3 | * This file was automatically generated by json-schema-to-typescript.
|
4 | * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
5 | * and run json-schema-to-typescript to regenerate this file.
|
6 | */
|
7 |
|
8 | /**
|
9 | * User Id. Persistent between devices, typically on a logged in user.
|
10 | */
|
11 | export type UserId = string | null;
|
12 | /**
|
13 | * Session Id. Unique to a browser/app and stored locally, e.g. cookie or localStorage.
|
14 | */
|
15 | export type SessionId = string | null;
|
16 | /**
|
17 | * Populated for integrations performed by Depict.ai only. Depict.ai Session Id.
|
18 | */
|
19 | export type Dsid = string | null;
|
20 | /**
|
21 | * Unique identifier for the transaction.
|
22 | */
|
23 | export type TransactionId = string;
|
24 | /**
|
25 | * The type identifier for this event: purchase.
|
26 | */
|
27 | export type EventType = "purchase" | null;
|
28 | /**
|
29 | * Currency the purchase was paid in
|
30 | */
|
31 | export type Currency = string;
|
32 | /**
|
33 | * All the products purchased in this transaction
|
34 | *
|
35 | * @minItems 1
|
36 | */
|
37 | export type Products = [PurchasedProduct, ...PurchasedProduct[]];
|
38 | /**
|
39 | * Stock keeping unit, a distinct item for sale. If you are using Google Analytics, it should be the same id used for products there.
|
40 | */
|
41 | export type Sku = string;
|
42 | /**
|
43 | * Price per unit. If there are discounts because of quantity, the unit price should be adjusted accordingly.
|
44 | */
|
45 | export type Price = number;
|
46 | /**
|
47 | * The number of times the product was purchased.
|
48 | */
|
49 | export type Quantity = number;
|
50 | /**
|
51 | * User Id. Persistent between devices, typically on a logged in user.
|
52 | */
|
53 | export type UserId1 = string | null;
|
54 | /**
|
55 | * Session Id. Unique to a browser/app and stored locally, e.g. cookie or localStorage.
|
56 | */
|
57 | export type SessionId1 = string | null;
|
58 | /**
|
59 | * Populated for integrations performed by Depict.ai only. Depict.ai Session Id.
|
60 | */
|
61 | export type Dsid1 = string | null;
|
62 | /**
|
63 | * The type identifier for this event: product_unavailable.
|
64 | */
|
65 | export type EventType1 = "product_unavailable";
|
66 | /**
|
67 | * Main product identifier
|
68 | */
|
69 | export type ProductId = string;
|
70 | export type EUnavailabilityType = "out_of_stock" | "missing";
|
71 |
|
72 | export interface TrackV2Request {
|
73 | /**
|
74 | * Identifier associated with the API integration
|
75 | */
|
76 | tenant: string;
|
77 | /**
|
78 | * Market identifier
|
79 | */
|
80 | market: string;
|
81 | events: (UserTransactionMappingEvent | PurchaseEvent | ProductUnavailableEvent)[];
|
82 | }
|
83 | export interface UserTransactionMappingEvent {
|
84 | /**
|
85 | * User Id. Persistent between devices, typically on a logged in user.
|
86 | */
|
87 | user_id?: string;
|
88 | /**
|
89 | * Session Id. Unique to a browser/app and stored locally, e.g. cookie or localStorage.
|
90 | */
|
91 | session_id?: string;
|
92 | /**
|
93 | * Populated for integrations performed by Depict.ai only. Depict.ai Session Id.
|
94 | */
|
95 | dsid?: string;
|
96 | /**
|
97 | * Unique identifier for the transaction.
|
98 | */
|
99 | transaction_id: string;
|
100 | /**
|
101 | * The type identifier for this event: transaction_mapping.
|
102 | */
|
103 | event_type?: "transaction_mapping";
|
104 | }
|
105 | export interface PurchaseEvent {
|
106 | user_id?: UserId;
|
107 | session_id?: SessionId;
|
108 | dsid?: Dsid;
|
109 | transaction_id: TransactionId;
|
110 | event_type?: EventType;
|
111 | currency: Currency;
|
112 | products: Products;
|
113 | }
|
114 | export interface PurchasedProduct {
|
115 | sku: Sku;
|
116 | price: Price;
|
117 | quantity: Quantity;
|
118 | }
|
119 | export interface ProductUnavailableEvent {
|
120 | user_id?: UserId1;
|
121 | session_id?: SessionId1;
|
122 | dsid?: Dsid1;
|
123 | event_type: EventType1;
|
124 | product_id: ProductId;
|
125 | /**
|
126 | * Reason the product isn't available for purchase
|
127 | */
|
128 | unavailability_type: EUnavailabilityType;
|
129 | }
|