@cohostvip/cohost-node 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +997 -886
- package/dist/index.d.ts +997 -886
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,48 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supported HTTP methods.
|
|
3
|
-
*/
|
|
4
|
-
type RequestMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
5
|
-
/**
|
|
6
|
-
* A function that performs a request to the Cohost API.
|
|
7
|
-
* The generic <T> allows you to specify the expected response type.
|
|
8
|
-
*/
|
|
9
|
-
type RequestFn = <T = any>(path: string, options?: {
|
|
10
|
-
method?: RequestMethod;
|
|
11
|
-
data?: any;
|
|
12
|
-
query?: Record<string, string | number | boolean | undefined>;
|
|
13
|
-
headers?: Record<string, string>;
|
|
14
|
-
}) => Promise<T>;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Optional settings for customizing the behavior of the CohostClient.
|
|
18
|
-
*/
|
|
19
|
-
interface CohostClientSettings {
|
|
20
|
-
/** Enable verbose debug output for all API requests. */
|
|
21
|
-
debug?: boolean;
|
|
22
|
-
/** Override the default API base URL (defaults to apiBaseUrl). */
|
|
23
|
-
apiUrl?: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Base class for all API endpoint groups within the Cohost SDK.
|
|
28
|
-
* Provides shared access to the configured request function and settings.
|
|
29
|
-
*/
|
|
30
|
-
declare class CohostEndpoint {
|
|
31
|
-
/** Shared request function injected from the client */
|
|
32
|
-
protected request: RequestFn;
|
|
33
|
-
/** Client settings passed during instantiation */
|
|
34
|
-
protected settings: CohostClientSettings;
|
|
35
|
-
/**
|
|
36
|
-
* Constructs a new endpoint group.
|
|
37
|
-
*
|
|
38
|
-
* @param request - The shared request function for performing API calls
|
|
39
|
-
* @param settings - The client-wide settings passed from the parent client
|
|
40
|
-
*/
|
|
41
|
-
constructor(request: RequestFn, settings: CohostClientSettings);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Generated by dts-bundle-generator v9.5.1
|
|
45
|
-
|
|
46
1
|
/**
|
|
47
2
|
* A namespaced identifier representing the entity an order is associated with.
|
|
48
3
|
*
|
|
@@ -63,55 +18,76 @@ type ApiVersion = "2025-04-15";
|
|
|
63
18
|
* A rich content object that supports multiple representations of text.
|
|
64
19
|
*/
|
|
65
20
|
interface MultipartText {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
21
|
+
/** HTML version of the content. */
|
|
22
|
+
html?: string;
|
|
23
|
+
/** Plain text version of the content. */
|
|
24
|
+
text?: string;
|
|
25
|
+
/** Markdown version of the content. */
|
|
26
|
+
md?: string;
|
|
27
|
+
/** Optional rich editor blocks (if structured editing is supported). */
|
|
28
|
+
blocks?: any[] | null;
|
|
74
29
|
}
|
|
75
30
|
/**
|
|
76
31
|
* A photo object with resolution options and optional metadata.
|
|
77
32
|
*/
|
|
78
33
|
interface Photo {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
34
|
+
/** High-resolution (2x) image URL. */
|
|
35
|
+
"2x"?: string;
|
|
36
|
+
/** Internal photo ID, if stored in a media system. */
|
|
37
|
+
id?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Primary image URL.
|
|
40
|
+
* This is the default image URL to be used when no other resolution is specified.
|
|
41
|
+
*
|
|
42
|
+
* @example "https://picsum.photos/500"
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
* @x-faker image.imageUrl
|
|
46
|
+
*/
|
|
47
|
+
url: string;
|
|
48
|
+
/** Width of the image in pixels. */
|
|
49
|
+
width?: number;
|
|
50
|
+
/** Height of the image in pixels. */
|
|
51
|
+
height?: number;
|
|
52
|
+
/** Optional caption for the image. */
|
|
53
|
+
caption?: string;
|
|
99
54
|
}
|
|
100
55
|
/**
|
|
101
56
|
* A repeating or structured date schedule for an event or item.
|
|
102
57
|
*/
|
|
103
58
|
interface Schedule {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
59
|
+
/** Days of the week (0 = Sunday, 6 = Saturday). */
|
|
60
|
+
daysOfWeek?: number[];
|
|
61
|
+
/** ISO-formatted UTC start datetime. */
|
|
62
|
+
start: string;
|
|
63
|
+
/** ISO-formatted UTC end datetime. */
|
|
64
|
+
end: string;
|
|
65
|
+
/** Specific dates to exclude in "YYYY-MM-DD" format. */
|
|
66
|
+
excludeDates?: string[];
|
|
67
|
+
/** Specific dates to include in "YYYY-MM-DD" format. */
|
|
68
|
+
includeDates?: string[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Pagination parameters for a paginated API request.
|
|
72
|
+
*/
|
|
73
|
+
interface Pagination$1 {
|
|
74
|
+
/** Number of results per page. */
|
|
75
|
+
size: number;
|
|
76
|
+
/** Page number (starting from 1). */
|
|
77
|
+
page: number;
|
|
78
|
+
/** Continuation */
|
|
79
|
+
continuation?: string;
|
|
80
|
+
}
|
|
81
|
+
interface PaginationResponse extends Pagination$1 {
|
|
82
|
+
/** Total number of results available. */
|
|
83
|
+
total: number;
|
|
114
84
|
}
|
|
85
|
+
type PaginatedResponse<T> = {
|
|
86
|
+
/** Array of results. */
|
|
87
|
+
results: T[];
|
|
88
|
+
/** Pagination metadata. */
|
|
89
|
+
pagination: PaginationResponse;
|
|
90
|
+
};
|
|
115
91
|
/**
|
|
116
92
|
* Base metadata for any record stored in the system.
|
|
117
93
|
* Includes an ID and timestamps for creation and optional updates.
|
|
@@ -119,21 +95,21 @@ interface Schedule {
|
|
|
119
95
|
* @export
|
|
120
96
|
*/
|
|
121
97
|
interface DataRecord {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Unique identifier for the record.
|
|
100
|
+
* @example "rec_123abc"
|
|
101
|
+
*/
|
|
102
|
+
id: string;
|
|
103
|
+
/**
|
|
104
|
+
* ISO 8601 timestamp indicating when the record was created.
|
|
105
|
+
* @example "2025-04-16T10:15:00Z"
|
|
106
|
+
*/
|
|
107
|
+
created: string;
|
|
108
|
+
/**
|
|
109
|
+
* ISO 8601 timestamp indicating when the record was last updated, if applicable.
|
|
110
|
+
* @example "2025-04-18T08:00:00Z"
|
|
111
|
+
*/
|
|
112
|
+
changed?: string;
|
|
137
113
|
}
|
|
138
114
|
/**
|
|
139
115
|
* Extension of `DataRecord` for resources returned from RESTful APIs.
|
|
@@ -142,15 +118,15 @@ interface DataRecord {
|
|
|
142
118
|
* @export
|
|
143
119
|
*/
|
|
144
120
|
interface VersionedDataRecord extends DataRecord {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Schema version identifier for this record.
|
|
123
|
+
* Helps manage compatibility across client-server contracts.
|
|
124
|
+
* @example "2025-01-10"
|
|
125
|
+
*/
|
|
126
|
+
version: ApiVersion;
|
|
151
127
|
}
|
|
152
128
|
interface VCDataRecord extends VersionedDataRecord {
|
|
153
|
-
|
|
129
|
+
companyId: string;
|
|
154
130
|
}
|
|
155
131
|
/**
|
|
156
132
|
* Represents either an absolute or a relative time constraint.
|
|
@@ -161,19 +137,28 @@ interface VCDataRecord extends VersionedDataRecord {
|
|
|
161
137
|
* @export
|
|
162
138
|
*/
|
|
163
139
|
type TimeOrOffset = {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Absolute time in ISO 8601 format.
|
|
142
|
+
* @example "2025-06-30T23:59:59"
|
|
143
|
+
*/
|
|
144
|
+
date: string;
|
|
145
|
+
secondsBefore?: never;
|
|
170
146
|
} | {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
147
|
+
/**
|
|
148
|
+
* Relative time before an anchor point (e.g. event start), in seconds.
|
|
149
|
+
* @example 3600
|
|
150
|
+
*/
|
|
151
|
+
secondsBefore: number;
|
|
152
|
+
date?: never;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* A request structure that includes both query parameters and pagination.
|
|
156
|
+
*
|
|
157
|
+
* @ignore
|
|
158
|
+
*/
|
|
159
|
+
type PaginatedRequest<T> = T & {
|
|
160
|
+
/** Pagination settings. */
|
|
161
|
+
pagination: Pagination$1;
|
|
177
162
|
};
|
|
178
163
|
/**
|
|
179
164
|
* @description A string representing a currency amount in the format `"USD,1000"` where:
|
|
@@ -191,44 +176,44 @@ type TimeOrOffset = {
|
|
|
191
176
|
*/
|
|
192
177
|
type CurrencyAmount = string;
|
|
193
178
|
interface CostBase {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
179
|
+
/**
|
|
180
|
+
* The base value of the cost. This is the value before any operations are applied.
|
|
181
|
+
* in OrderItem this is the cost of a single item.
|
|
182
|
+
*
|
|
183
|
+
* @example "USD,1000"
|
|
184
|
+
*/
|
|
185
|
+
cost: CurrencyAmount;
|
|
186
|
+
/**
|
|
187
|
+
* Delivery fee for a single item.
|
|
188
|
+
*
|
|
189
|
+
* @example "USD,1000"
|
|
190
|
+
*/
|
|
191
|
+
delivery: CurrencyAmount;
|
|
192
|
+
/**
|
|
193
|
+
* Fee per item.
|
|
194
|
+
* @example "USD,1000"
|
|
195
|
+
*/
|
|
196
|
+
fee: CurrencyAmount;
|
|
197
|
+
/**
|
|
198
|
+
* Total discount amount applied to this item.
|
|
199
|
+
* @example "USD,1000"
|
|
200
|
+
*/
|
|
201
|
+
tax: CurrencyAmount;
|
|
217
202
|
}
|
|
218
203
|
interface CostComponentCap {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
204
|
+
op: "cap";
|
|
205
|
+
type: "percentage" | "absolute";
|
|
206
|
+
/**
|
|
207
|
+
* The value of the cap. If type is percentage, it is a percentage of the base value.
|
|
208
|
+
* If type is absolute, it is an absolute value.
|
|
209
|
+
*
|
|
210
|
+
* Absolute value is represented in the same denomination as the cost.
|
|
211
|
+
* i.e. if the cost is in cents, the absolute value should be in cents.
|
|
212
|
+
*
|
|
213
|
+
* percentage value is represented as a decimal.
|
|
214
|
+
* For example, 10% is represented as 0.1.
|
|
215
|
+
*/
|
|
216
|
+
value: number;
|
|
232
217
|
}
|
|
233
218
|
/**
|
|
234
219
|
* Represents a cost operation to be applied in a pricing formula.
|
|
@@ -237,27 +222,27 @@ interface CostComponentCap {
|
|
|
237
222
|
* { op: '*', value: 0.9 }
|
|
238
223
|
*/
|
|
239
224
|
interface CostOp {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
225
|
+
/**
|
|
226
|
+
* The operation to apply to the cost value.
|
|
227
|
+
*
|
|
228
|
+
* Allowed values:
|
|
229
|
+
* - "+" (addition)
|
|
230
|
+
* - "-" (subtraction)
|
|
231
|
+
* - "*" (multiplication)
|
|
232
|
+
* - "/" (division)
|
|
233
|
+
* @ignore
|
|
234
|
+
* @enum {string}
|
|
235
|
+
*/
|
|
236
|
+
op: "+" | "-" | "*" | "/";
|
|
237
|
+
/**
|
|
238
|
+
* The operand value used in the cost operation.
|
|
239
|
+
*
|
|
240
|
+
* The unit should match the denomination of the cost.
|
|
241
|
+
* For example, if cost is expressed in cents, this value should also be in cents.
|
|
242
|
+
*
|
|
243
|
+
* @example 100
|
|
244
|
+
*/
|
|
245
|
+
value: number;
|
|
261
246
|
}
|
|
262
247
|
/**
|
|
263
248
|
* A set of comparison operators used for evaluating conditional expressions.
|
|
@@ -274,34 +259,34 @@ interface CostOp {
|
|
|
274
259
|
*/
|
|
275
260
|
type EqualOperator = "==" | "!=" | "<" | "<=" | ">" | ">=";
|
|
276
261
|
interface CostComponentRuleCondition {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
262
|
+
/**
|
|
263
|
+
* The field to evaluate the condition against.
|
|
264
|
+
* For example, "item.price" or "order.total".
|
|
265
|
+
* The field should be a valid path to the field in the cost component base.
|
|
266
|
+
*/
|
|
267
|
+
field: string;
|
|
268
|
+
/**
|
|
269
|
+
*
|
|
270
|
+
*/
|
|
271
|
+
operator: EqualOperator;
|
|
272
|
+
/**
|
|
273
|
+
* Can be a value such as number, currencyAmount, an ISO date string, etc...
|
|
274
|
+
*/
|
|
275
|
+
value: string | number | any;
|
|
276
|
+
/**
|
|
277
|
+
* evaluator, will define a function or endpoint to evaluate the condition.
|
|
278
|
+
*/
|
|
279
|
+
eval?: string;
|
|
295
280
|
}
|
|
296
281
|
interface CostComponentRule {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
282
|
+
/**
|
|
283
|
+
* Friendly name of the rule.
|
|
284
|
+
*/
|
|
285
|
+
name: string;
|
|
286
|
+
/**
|
|
287
|
+
* The rule will be applied to the cost component if the conditions are met.
|
|
288
|
+
*/
|
|
289
|
+
conditions: CostComponentRuleCondition[];
|
|
305
290
|
}
|
|
306
291
|
/**
|
|
307
292
|
* Represents the costs associated with an offering.
|
|
@@ -314,43 +299,43 @@ interface CostComponentRule {
|
|
|
314
299
|
* @property {CurrencyAmount} total - The total cost including tax.
|
|
315
300
|
*/
|
|
316
301
|
interface OfferingCosts extends CostBase {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
302
|
+
/**
|
|
303
|
+
* cost + fee - discount , not including tax
|
|
304
|
+
*
|
|
305
|
+
* In an order item, this is the gross cost of a single item.
|
|
306
|
+
*
|
|
307
|
+
* @x-faker {"random.arrayElement": ["\"USD,100000\"", "\"USD,25000\""]}
|
|
308
|
+
*/
|
|
309
|
+
gross: CurrencyAmount;
|
|
310
|
+
/**
|
|
311
|
+
* total cost including tax
|
|
312
|
+
*
|
|
313
|
+
* In an order item, this is the total cost * Quantity.
|
|
314
|
+
*/
|
|
315
|
+
total: CurrencyAmount;
|
|
331
316
|
}
|
|
332
317
|
type CostBucket = "item" | "fee" | "tax" | "delivery";
|
|
333
318
|
interface CostComponent {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
319
|
+
id: string;
|
|
320
|
+
name: string;
|
|
321
|
+
details?: any;
|
|
322
|
+
currency: string | "*";
|
|
323
|
+
base: "order" | "item" | string;
|
|
324
|
+
bucket: CostBucket;
|
|
325
|
+
recipient: "organizer" | "platform" | "tax" | string;
|
|
326
|
+
payer: "attendee" | "organizer";
|
|
327
|
+
/**
|
|
328
|
+
* @ignore
|
|
329
|
+
*/
|
|
330
|
+
ops: CostOp[];
|
|
331
|
+
cap?: CostComponentCap;
|
|
332
|
+
rules: CostComponentRule[];
|
|
333
|
+
version: "2025-03-25";
|
|
349
334
|
}
|
|
350
335
|
interface CalculatedCostComponent extends Omit<CostComponent, "ops" | "cap" | "rules" | "details" | "currency"> {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
336
|
+
cost: CurrencyAmount;
|
|
337
|
+
value: number;
|
|
338
|
+
discount: null;
|
|
354
339
|
}
|
|
355
340
|
/**
|
|
356
341
|
* @zod .string()
|
|
@@ -360,126 +345,164 @@ type ActiveOfferingStatus = "live" | "hidden" | "sold-out";
|
|
|
360
345
|
type OfferingStatus = ActiveOfferingStatus | "draft" | "deleted" | "unavailable";
|
|
361
346
|
type PriceCategory = "donation" | "free" | "paid" | "other";
|
|
362
347
|
interface Offering extends DataRecord {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
348
|
+
/**
|
|
349
|
+
* Offering name, can be ticket name, vaucher name, etc...
|
|
350
|
+
* @example "General Admission" (ticket) | "T-shirt" (merch) | "Donation" (donation) | "Membership" (membership) | "Gift Card" (voucher) | "Service Fee" (service) | "Other" (other)
|
|
351
|
+
*
|
|
352
|
+
* @x-faker commerce.productName
|
|
353
|
+
*/
|
|
354
|
+
name: string;
|
|
355
|
+
type: OfferingType;
|
|
356
|
+
/**
|
|
357
|
+
* @description The maximum number of tickets that can be sold for this offering.
|
|
358
|
+
*
|
|
359
|
+
* @example 100
|
|
360
|
+
*
|
|
361
|
+
* @x-faker {"datatype.number": { "min": 10, "max": 100 }}
|
|
362
|
+
*/
|
|
363
|
+
capacity: number;
|
|
364
|
+
quantitySold: number;
|
|
365
|
+
status: OfferingStatus;
|
|
366
|
+
priceCategory: PriceCategory;
|
|
367
|
+
sorting: number;
|
|
368
|
+
/**
|
|
369
|
+
* @ignore
|
|
370
|
+
*/
|
|
371
|
+
schedule?: Schedule;
|
|
372
|
+
description?: string;
|
|
373
|
+
instructions?: string;
|
|
374
|
+
/**
|
|
375
|
+
* @description Maximum number of tickets that can be purchased in a single order.
|
|
376
|
+
*
|
|
377
|
+
* @example 10
|
|
378
|
+
*
|
|
379
|
+
* @x-faker {"datatype.number": { "min": 4, "max": 15 }}
|
|
380
|
+
*/
|
|
381
|
+
maximumQuantity: number;
|
|
382
|
+
/**
|
|
383
|
+
* @description Minimum number of tickets that can be purchased in a single order.
|
|
384
|
+
*
|
|
385
|
+
* @example 1
|
|
386
|
+
*
|
|
387
|
+
* @x-faker {"datatype.number": { "min": 1, "max": 4 }}
|
|
388
|
+
*/
|
|
389
|
+
minimumQuantity: number;
|
|
390
|
+
package?: boolean;
|
|
391
|
+
/**
|
|
392
|
+
* @description Items, products ,and vouchers included in this offering.
|
|
393
|
+
*
|
|
394
|
+
*
|
|
395
|
+
* @x-faker {"array.length": 0}
|
|
396
|
+
*/
|
|
397
|
+
included?: PackageInclude[];
|
|
398
|
+
/**
|
|
399
|
+
* Any constraints that apply to this offering.
|
|
400
|
+
* it can be time limit, quantity limit, etc...
|
|
401
|
+
*/
|
|
402
|
+
constraints?: any;
|
|
403
|
+
hidden: boolean;
|
|
404
|
+
order_confirmation_message?: string | null;
|
|
405
|
+
costs: OfferingCosts;
|
|
406
|
+
/**
|
|
407
|
+
* Describe fees and other costs associated with purchasing tickets
|
|
408
|
+
* to this offering
|
|
409
|
+
*
|
|
410
|
+
* @ignore
|
|
411
|
+
*/
|
|
412
|
+
costComponents?: CostComponent[];
|
|
428
413
|
}
|
|
429
414
|
interface PackageInclude {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
415
|
+
id: string;
|
|
416
|
+
quantity: number;
|
|
417
|
+
type: OfferingType;
|
|
418
|
+
description: string;
|
|
419
|
+
ref?: any;
|
|
435
420
|
}
|
|
436
421
|
interface Ticket extends Omit<Offering, "hidden" | "constraints" | "type"> {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
422
|
+
category: string;
|
|
423
|
+
type: "admission" | "package" | "admission.tableCommitment";
|
|
424
|
+
source: string;
|
|
425
|
+
display_name?: string;
|
|
426
|
+
description?: string;
|
|
427
|
+
ticketParentId?: string;
|
|
428
|
+
salesEnd: string;
|
|
429
|
+
salesStart: string;
|
|
430
|
+
parentId?: string;
|
|
431
|
+
refId?: string;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Person interface
|
|
435
|
+
*/
|
|
436
|
+
interface Person {
|
|
437
|
+
name: string;
|
|
438
|
+
photoURL?: string | null;
|
|
439
|
+
displayName: string;
|
|
440
|
+
first: string;
|
|
441
|
+
last: string;
|
|
442
|
+
gender: null | string | "male" | "female" | "other";
|
|
443
|
+
birthdate?: string | null;
|
|
444
|
+
age?: number;
|
|
445
|
+
}
|
|
446
|
+
interface PersonContact {
|
|
447
|
+
email: string | null;
|
|
448
|
+
phone: string | null;
|
|
449
|
+
}
|
|
450
|
+
type Customer = Person & PersonContact & {
|
|
451
|
+
uid: string | null;
|
|
452
|
+
};
|
|
453
|
+
type AttendeeStatus = "attending" | "checkedIn" | "cancelled" | "refunded" | "noShow" | "unknown" | string;
|
|
454
|
+
interface Attendee3 extends DataRecord {
|
|
455
|
+
/**
|
|
456
|
+
* Order ID, from /orders/:orderId
|
|
457
|
+
*/
|
|
458
|
+
orderId: string;
|
|
459
|
+
/**
|
|
460
|
+
* For event it will be the ticket's id
|
|
461
|
+
*/
|
|
462
|
+
offeringId: string;
|
|
463
|
+
offeringSnapshot: Partial<Offering>;
|
|
464
|
+
profile: Customer | null;
|
|
465
|
+
checkedIn: boolean;
|
|
466
|
+
barcodes: string[];
|
|
467
|
+
version: ApiVersion;
|
|
468
|
+
status: AttendeeStatus | string;
|
|
469
|
+
index: number;
|
|
447
470
|
}
|
|
448
471
|
interface BuzzBuilder {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
472
|
+
countLabel: string;
|
|
473
|
+
profiles: {
|
|
474
|
+
id: string;
|
|
475
|
+
name: string;
|
|
476
|
+
photoURL: string;
|
|
477
|
+
}[];
|
|
455
478
|
}
|
|
456
479
|
interface EventFeature {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
480
|
+
id: string;
|
|
481
|
+
title: string;
|
|
482
|
+
enabled: boolean;
|
|
483
|
+
order: number;
|
|
484
|
+
widgetUri: string;
|
|
485
|
+
iconName?: string;
|
|
486
|
+
logoUri?: string;
|
|
487
|
+
description: string;
|
|
488
|
+
type: string;
|
|
489
|
+
version?: string;
|
|
490
|
+
key: string;
|
|
491
|
+
meta?: any;
|
|
492
|
+
data: any;
|
|
470
493
|
}
|
|
471
494
|
interface Address {
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
495
|
+
address_1: string;
|
|
496
|
+
address_2?: string;
|
|
497
|
+
city: string;
|
|
498
|
+
country: string;
|
|
499
|
+
premise?: string;
|
|
500
|
+
formattedAddress?: string;
|
|
501
|
+
localized_address_display?: string;
|
|
502
|
+
localized_area_display?: string;
|
|
503
|
+
localized_multi_line_address_display?: string[];
|
|
504
|
+
postal_code: string;
|
|
505
|
+
region: string;
|
|
483
506
|
}
|
|
484
507
|
/**
|
|
485
508
|
* A simple point geometry consisting of latitude and longitude.
|
|
@@ -495,8 +518,8 @@ interface Address {
|
|
|
495
518
|
* }
|
|
496
519
|
*/
|
|
497
520
|
interface GeometryPoint {
|
|
498
|
-
|
|
499
|
-
|
|
521
|
+
lat: number;
|
|
522
|
+
lng: number;
|
|
500
523
|
}
|
|
501
524
|
/**
|
|
502
525
|
* Represents the geometry of a location, including optional viewport and zoom level.
|
|
@@ -527,15 +550,15 @@ interface GeometryPoint {
|
|
|
527
550
|
* }
|
|
528
551
|
*/
|
|
529
552
|
interface LocationGeometry extends GeometryPoint {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
553
|
+
zoom?: number;
|
|
554
|
+
viewport?: {
|
|
555
|
+
northeast: GeometryPoint;
|
|
556
|
+
southwest: GeometryPoint;
|
|
557
|
+
};
|
|
558
|
+
vicinity?: string;
|
|
559
|
+
region?: string;
|
|
560
|
+
locality?: string;
|
|
561
|
+
geoHash?: string;
|
|
539
562
|
}
|
|
540
563
|
/**
|
|
541
564
|
* A structured representation of a physical location, including address and coordinates.
|
|
@@ -573,23 +596,38 @@ interface LocationGeometry extends GeometryPoint {
|
|
|
573
596
|
* }
|
|
574
597
|
*/
|
|
575
598
|
interface Location {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
599
|
+
venueId: string | null;
|
|
600
|
+
placeId: string | null;
|
|
601
|
+
name: string;
|
|
602
|
+
geometry: LocationGeometry | null;
|
|
603
|
+
address: Address | null;
|
|
604
|
+
timezone?: string;
|
|
582
605
|
}
|
|
583
606
|
interface VenueBase {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
607
|
+
id: string;
|
|
608
|
+
name: string;
|
|
609
|
+
formattedAddress: string;
|
|
610
|
+
placeId?: string | null;
|
|
611
|
+
tz: string;
|
|
612
|
+
logo: Photo | null;
|
|
613
|
+
public: boolean;
|
|
614
|
+
address: Address | null;
|
|
615
|
+
slug: string | null;
|
|
616
|
+
}
|
|
617
|
+
interface Venue extends VenueBase {
|
|
618
|
+
claimed: boolean;
|
|
619
|
+
refId?: string;
|
|
620
|
+
description?: MultipartText;
|
|
621
|
+
capacity?: number | null;
|
|
622
|
+
types: string[];
|
|
623
|
+
photos?: Photo[];
|
|
624
|
+
hoursOfOperation: string[];
|
|
625
|
+
phoneNumber?: string | null;
|
|
626
|
+
priceLevel: number | null;
|
|
627
|
+
rating: {
|
|
628
|
+
google: number | null;
|
|
629
|
+
};
|
|
630
|
+
[key: string]: any;
|
|
593
631
|
}
|
|
594
632
|
/**
|
|
595
633
|
* @description Status of the event lifecycle.
|
|
@@ -603,80 +641,80 @@ interface VenueBase {
|
|
|
603
641
|
* - `canceled`: The event was canceled and is no longer active.
|
|
604
642
|
*/
|
|
605
643
|
type EventStatus = "archived" | "draft" | "live" | "started" | "ended" | "completed" | "canceled";
|
|
606
|
-
interface EventBase {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
644
|
+
interface EventBase extends DataRecord {
|
|
645
|
+
/**
|
|
646
|
+
* @example "Spring Concert"
|
|
647
|
+
* @faker name.firstName
|
|
648
|
+
* @x-faker name.firstName
|
|
649
|
+
*/
|
|
650
|
+
name: string;
|
|
651
|
+
summary: string;
|
|
652
|
+
companyId: string;
|
|
653
|
+
/**
|
|
654
|
+
* @description The timezone in which the event is taking place.
|
|
655
|
+
* @example "America/New_York"
|
|
656
|
+
* @example "Europe/London"
|
|
657
|
+
* @example "Asia/Tokyo"
|
|
658
|
+
*/
|
|
659
|
+
tz: string;
|
|
660
|
+
/**
|
|
661
|
+
* @description The start date and time of the event in ISO 8601 format.
|
|
662
|
+
* @example "2023-10-01T12:00:00Z"
|
|
663
|
+
*/
|
|
664
|
+
start: string;
|
|
665
|
+
/**
|
|
666
|
+
* @description The end date and time of the event in ISO 8601 format.
|
|
667
|
+
* @example "2023-10-01T14:00:00Z"
|
|
668
|
+
*/
|
|
669
|
+
end: string;
|
|
670
|
+
isSeries?: boolean;
|
|
671
|
+
/**
|
|
672
|
+
* @description The status of the event in its lifecycle.
|
|
673
|
+
* @example "draft"
|
|
674
|
+
* @example "live"
|
|
675
|
+
* @example "ended"
|
|
676
|
+
*/
|
|
677
|
+
status: EventStatus;
|
|
678
|
+
/**
|
|
679
|
+
* @x-faker { url: faker.image.imageUrl() }
|
|
680
|
+
*/
|
|
681
|
+
flyer?: Photo | null;
|
|
682
|
+
venue?: VenueBase | null;
|
|
683
|
+
/**
|
|
684
|
+
* @description Curerncy used for the event.
|
|
685
|
+
* @example "USD"
|
|
686
|
+
*/
|
|
687
|
+
currency: string;
|
|
688
|
+
/**
|
|
689
|
+
* @description Is the event public?
|
|
690
|
+
* @example true
|
|
691
|
+
*/
|
|
692
|
+
public: boolean;
|
|
693
|
+
location?: Location;
|
|
694
|
+
organizerId: string;
|
|
657
695
|
}
|
|
658
696
|
/**
|
|
659
697
|
* @openapi
|
|
660
698
|
* @description EventProfile respresent a public view of an event
|
|
661
699
|
*/
|
|
662
700
|
interface EventProfile extends EventBase {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
701
|
+
meta?: any;
|
|
702
|
+
organizer: any;
|
|
703
|
+
url?: string;
|
|
704
|
+
slug: string;
|
|
705
|
+
channels: string[];
|
|
706
|
+
description: MultipartText;
|
|
707
|
+
widgets: EventFeature[];
|
|
708
|
+
ticketPrices: string[];
|
|
709
|
+
buzzBuilder?: BuzzBuilder | null;
|
|
710
|
+
venue?: VenueBase | null;
|
|
711
|
+
tags: string[];
|
|
712
|
+
searchTags: string[];
|
|
713
|
+
sections: string[];
|
|
714
|
+
priceRange?: {
|
|
715
|
+
min?: string;
|
|
716
|
+
max?: string;
|
|
717
|
+
};
|
|
680
718
|
}
|
|
681
719
|
/**
|
|
682
720
|
* Represents a discount coupon that can be applied to one or more offerings in an event platform.
|
|
@@ -684,152 +722,98 @@ interface EventProfile extends EventBase {
|
|
|
684
722
|
* @export
|
|
685
723
|
*/
|
|
686
724
|
interface Coupon extends VersionedDataRecord {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* Captures metadata and request/session context at the time the cart is created.
|
|
782
|
-
* Supports fraud detection, attribution, analytics, and partner session tracking.
|
|
783
|
-
*
|
|
784
|
-
* This interface is extensible — additional custom fields may be included as needed.
|
|
785
|
-
*
|
|
786
|
-
* @export
|
|
787
|
-
*/
|
|
788
|
-
interface OrderContext {
|
|
789
|
-
/**
|
|
790
|
-
* IP addresses associated with the user request.
|
|
791
|
-
* Typically includes forwarded IPs and direct client IP.
|
|
792
|
-
* @example ["203.0.113.1", "10.0.0.1"]
|
|
793
|
-
*/
|
|
794
|
-
ipAddresses: string[];
|
|
795
|
-
/**
|
|
796
|
-
* Raw User-Agent header from the client request.
|
|
797
|
-
* @example "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
|
|
798
|
-
*/
|
|
799
|
-
userAgent: string;
|
|
800
|
-
/**
|
|
801
|
-
* The referring URL from which the cart or checkout was initiated.
|
|
802
|
-
* May be a partner site, marketing page, or event listing.
|
|
803
|
-
* @example "https://partner.example.com/tickets/event123"
|
|
804
|
-
*/
|
|
805
|
-
referrer: string;
|
|
806
|
-
/**
|
|
807
|
-
* Authenticated user ID, or null for anonymous guests.
|
|
808
|
-
* @example "uid_456def"
|
|
809
|
-
*/
|
|
810
|
-
uid: string | null;
|
|
811
|
-
/**
|
|
812
|
-
* The unique cart session ID assigned at the time the cart was created.
|
|
813
|
-
* Helps track cart attribution across systems.
|
|
814
|
-
* @example "cart_sess_abc123"
|
|
815
|
-
*/
|
|
816
|
-
cartSessionId: string;
|
|
817
|
-
/**
|
|
818
|
-
* (Optional) Origin domain name if embedded or white-labeled.
|
|
819
|
-
* Can help identify partner portals or iframe referrers.
|
|
820
|
-
* @example "examplepartner.com"
|
|
821
|
-
*/
|
|
822
|
-
originDomain?: string;
|
|
823
|
-
/**
|
|
824
|
-
* (Optional) Campaign ID, UTM source, or tracking label.
|
|
825
|
-
* Useful for affiliate and analytics systems.
|
|
826
|
-
* @example "utm_campaign=spring_launch"
|
|
827
|
-
*/
|
|
828
|
-
trackingId?: string;
|
|
829
|
-
/**
|
|
830
|
-
* Allows custom fields for analytics, partners, or experiment data.
|
|
831
|
-
*/
|
|
832
|
-
[custom: string]: unknown;
|
|
725
|
+
/**
|
|
726
|
+
* ID of the company that issued this coupon.
|
|
727
|
+
* @example "company_123abc"
|
|
728
|
+
*/
|
|
729
|
+
companyId: string;
|
|
730
|
+
/**
|
|
731
|
+
* Internal description for the coupon.
|
|
732
|
+
* This is not necessarily visible to users.
|
|
733
|
+
* @example "Early bird discount for spring events"
|
|
734
|
+
*/
|
|
735
|
+
description: string;
|
|
736
|
+
/**
|
|
737
|
+
* The code used to redeem this coupon during checkout.
|
|
738
|
+
* For public or coded discounts.
|
|
739
|
+
* @example "SPRING2025"
|
|
740
|
+
*/
|
|
741
|
+
code: string;
|
|
742
|
+
/**
|
|
743
|
+
* Type of coupon — determines how it's distributed or applied.
|
|
744
|
+
* @example "coded"
|
|
745
|
+
*/
|
|
746
|
+
type: "access" | "coded" | "public" | "hold";
|
|
747
|
+
/**
|
|
748
|
+
* Fixed amount to deduct from the order total.
|
|
749
|
+
* This is a currency-less value that matches the event or order currency.
|
|
750
|
+
* Example: `10.00` = $10.00 off.
|
|
751
|
+
* @minimum 0
|
|
752
|
+
* @maximum 99999
|
|
753
|
+
* @example 10.0
|
|
754
|
+
*/
|
|
755
|
+
amountOff: number;
|
|
756
|
+
/**
|
|
757
|
+
* Percentage to deduct from the item or order total.
|
|
758
|
+
* Range is 0–100. Use 0 for no percentage-based discount.
|
|
759
|
+
* @minimum 0
|
|
760
|
+
* @maximum 100
|
|
761
|
+
* @example 20.0
|
|
762
|
+
*/
|
|
763
|
+
percentOff: number;
|
|
764
|
+
/**
|
|
765
|
+
* Total number of times this coupon can be used.
|
|
766
|
+
* A value of `0` means unlimited usage.
|
|
767
|
+
* @example 100
|
|
768
|
+
*/
|
|
769
|
+
limit: number;
|
|
770
|
+
/**
|
|
771
|
+
* Number of times this coupon has been redeemed.
|
|
772
|
+
* Read-only field.
|
|
773
|
+
* @readonly
|
|
774
|
+
* @example 42
|
|
775
|
+
*/
|
|
776
|
+
quantitySold: number;
|
|
777
|
+
/**
|
|
778
|
+
* List of offering IDs (e.g., ticket classes) this coupon applies to.
|
|
779
|
+
* If empty, the coupon applies to all eligible offerings in its context.
|
|
780
|
+
* @example ["off_123abc", "off_456def"]
|
|
781
|
+
*/
|
|
782
|
+
offeringIds: string[];
|
|
783
|
+
/**
|
|
784
|
+
* List of context IDs (e.g., event, venue, or organizer) this coupon is valid for.
|
|
785
|
+
* Follows the format: "evt_xxx", "org_xxx", etc.
|
|
786
|
+
* @example ["evt_abc123", "org_def456"]
|
|
787
|
+
*/
|
|
788
|
+
contextIds: ContextId[];
|
|
789
|
+
/**
|
|
790
|
+
* Time-based constraints that control when the coupon is active and when it expires.
|
|
791
|
+
* Supports absolute dates or relative time offsets (in seconds) from event start.
|
|
792
|
+
*
|
|
793
|
+
* - If `start` is omitted, the coupon is valid immediately.
|
|
794
|
+
* - If `end` is omitted, the coupon remains valid until the event ends.
|
|
795
|
+
*
|
|
796
|
+
* @example {
|
|
797
|
+
* start: { date: "2025-04-01T00:00:00" },
|
|
798
|
+
* end: { secondsBefore: 3600 }
|
|
799
|
+
* }
|
|
800
|
+
*/
|
|
801
|
+
constraints: {
|
|
802
|
+
start?: TimeOrOffset;
|
|
803
|
+
end?: TimeOrOffset;
|
|
804
|
+
};
|
|
805
|
+
/**
|
|
806
|
+
* Current status of the coupon for administrative purposes.
|
|
807
|
+
* Determines whether it can be redeemed at checkout.
|
|
808
|
+
* @example "active"
|
|
809
|
+
*/
|
|
810
|
+
status: "active" | "expired" | "disabled" | "sold_out";
|
|
811
|
+
/**
|
|
812
|
+
* Schema version identifier.
|
|
813
|
+
* Used to ensure compatibility between coupon formats.
|
|
814
|
+
* @example "2025-01-10"
|
|
815
|
+
*/
|
|
816
|
+
version: ApiVersion;
|
|
833
817
|
}
|
|
834
818
|
/**
|
|
835
819
|
* Cost breakdown for a specific item in the order.
|
|
@@ -838,22 +822,22 @@ interface OrderContext {
|
|
|
838
822
|
* @export
|
|
839
823
|
*/
|
|
840
824
|
interface OrderItemCosts extends OfferingCosts {
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
825
|
+
/**
|
|
826
|
+
* Total cost of tickets before taxes, fees, and discounts.
|
|
827
|
+
* @example { amount: 5000, currency: "USD" }
|
|
828
|
+
*/
|
|
829
|
+
subtotal: CurrencyAmount;
|
|
830
|
+
/**
|
|
831
|
+
* Total discount amount applied to this item.
|
|
832
|
+
* @example { amount: 1000, currency: "USD" }
|
|
833
|
+
*/
|
|
834
|
+
discount: CurrencyAmount;
|
|
835
|
+
/**
|
|
836
|
+
* Total price before discounts.
|
|
837
|
+
* Equal to subtotal + fee, before subtracting discount.
|
|
838
|
+
* @example { amount: 6000, currency: "USD" }
|
|
839
|
+
*/
|
|
840
|
+
preDiscount: CurrencyAmount;
|
|
857
841
|
}
|
|
858
842
|
/**
|
|
859
843
|
* Represents an individual item within an order.
|
|
@@ -861,87 +845,126 @@ interface OrderItemCosts extends OfferingCosts {
|
|
|
861
845
|
* @export
|
|
862
846
|
*/
|
|
863
847
|
interface OrderItem {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
848
|
+
/**
|
|
849
|
+
* Unique ID for this order item.
|
|
850
|
+
* @example "item_abc123"
|
|
851
|
+
*/
|
|
852
|
+
id: string;
|
|
853
|
+
/**
|
|
854
|
+
* Type of offering (e.g., ticket, package, merch).
|
|
855
|
+
* @example "ticket"
|
|
856
|
+
*/
|
|
857
|
+
offeringType: OfferingType;
|
|
858
|
+
/**
|
|
859
|
+
* ID of the offering purchased.
|
|
860
|
+
* @example "evt_abc123_off_001"
|
|
861
|
+
*/
|
|
862
|
+
offeringId: string;
|
|
863
|
+
/**
|
|
864
|
+
* Quantity purchased of this item.
|
|
865
|
+
* @example 2
|
|
866
|
+
*/
|
|
867
|
+
quantity: number;
|
|
868
|
+
/**
|
|
869
|
+
* Full cost breakdown for this item.
|
|
870
|
+
*/
|
|
871
|
+
costs: OrderItemCosts;
|
|
872
|
+
/**
|
|
873
|
+
* If this item is included as part of a package, this is the ID of the parent item.
|
|
874
|
+
* Otherwise, null.
|
|
875
|
+
* @example null
|
|
876
|
+
*/
|
|
877
|
+
includedWithItemId: string | null;
|
|
878
|
+
/**
|
|
879
|
+
* Breakdown of cost components (e.g., base, service fee, delivery).
|
|
880
|
+
*/
|
|
881
|
+
costComponents: CalculatedCostComponent[];
|
|
882
|
+
/**
|
|
883
|
+
* Any relevant metadata associated with this item.
|
|
884
|
+
* This can include custom fields or additional information.
|
|
885
|
+
* @example { "customField": "value" }
|
|
886
|
+
*/
|
|
887
|
+
meta: any;
|
|
888
|
+
offering: OrderItemOffering;
|
|
905
889
|
}
|
|
906
890
|
interface OrderItemOffering extends Pick<Offering, "name" | "costs" | "type"> {
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
891
|
+
/**
|
|
892
|
+
* doc assicated with this offering in the DB.
|
|
893
|
+
*
|
|
894
|
+
* @example "events/1234567890/tickets/0987654321"
|
|
895
|
+
*/
|
|
896
|
+
docPath: string;
|
|
913
897
|
}
|
|
914
898
|
/**
|
|
915
|
-
*
|
|
899
|
+
* Represents the resolved context associated with a cart session.
|
|
900
|
+
* This may be an event, venue, or organizer, and is used to enrich the cart with metadata
|
|
901
|
+
* needed for UI rendering and pricing logic without requiring repeated DB lookups.
|
|
902
|
+
*
|
|
903
|
+
* Typically stored in `cart.meta.resolvedContext`.
|
|
904
|
+
*
|
|
905
|
+
* @export
|
|
916
906
|
*/
|
|
917
|
-
interface
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
907
|
+
interface ResolvedCartContext {
|
|
908
|
+
/**
|
|
909
|
+
* Unique identifier of the context entity.
|
|
910
|
+
* Typically matches the cart's `contextId` (e.g., "evt_abc123").
|
|
911
|
+
* @example "evt_abc123"
|
|
912
|
+
*/
|
|
913
|
+
id: string;
|
|
914
|
+
/**
|
|
915
|
+
* Human-readable title or name of the context entity.
|
|
916
|
+
* Used for display in headers, summaries, and confirmations.
|
|
917
|
+
* @example "Downtown Comedy Night"
|
|
918
|
+
*/
|
|
919
|
+
title: string;
|
|
920
|
+
/**
|
|
921
|
+
* Optional physical or virtual location of the event or venue.
|
|
922
|
+
* Can include address, coordinates, or virtual link.
|
|
923
|
+
*/
|
|
924
|
+
location?: Location;
|
|
925
|
+
/**
|
|
926
|
+
* Optional logo, banner, or primary image representing the context.
|
|
927
|
+
* Used in UI to visually identify the entity during checkout.
|
|
928
|
+
*/
|
|
929
|
+
logo?: Photo;
|
|
930
|
+
/**
|
|
931
|
+
* Optional description or summary of the context entity.
|
|
932
|
+
* Provides additional information to the customer during checkout.
|
|
933
|
+
* @example "Join us for a night of laughter with top comedians!"
|
|
934
|
+
*/
|
|
935
|
+
start: string;
|
|
936
|
+
/**
|
|
937
|
+
* Optional end date or time of the event or context entity.
|
|
938
|
+
* Useful for events with a specific duration or schedule.
|
|
939
|
+
* @example "2023-10-15T22:00:00Z"
|
|
940
|
+
*/
|
|
941
|
+
end?: string;
|
|
942
|
+
/**
|
|
943
|
+
* A map of offerings relevant to this context (e.g., ticket types, merch).
|
|
944
|
+
* Stored as a record keyed by offering ID to allow fast lookup.
|
|
945
|
+
* Each value is a partial offering object, intended for display, validation, or pricing.
|
|
946
|
+
* @example {
|
|
947
|
+
* "off_123abc": { path: "events/ev_1234/tickets/tkt_567", offering: { name: "VIP Ticket", price: 3000 }),
|
|
948
|
+
* "off_456def": { path: "events/ev_1234/tickets/tkt_567", offering: { name: "T-Shirt", price: 2000 }}
|
|
949
|
+
* }
|
|
950
|
+
*/
|
|
951
|
+
offerings?: Record<string, ResolvedCartContextOffering>;
|
|
926
952
|
}
|
|
927
|
-
interface
|
|
928
|
-
|
|
929
|
-
|
|
953
|
+
interface ResolvedCartContextOffering {
|
|
954
|
+
path: string;
|
|
955
|
+
offering: Offering;
|
|
930
956
|
}
|
|
931
|
-
type Customer = Person & PersonContact & {
|
|
932
|
-
uid: string | null;
|
|
933
|
-
};
|
|
934
957
|
type CouponSummary = Pick<Coupon, "id" | "code" | "amountOff" | "percentOff" | "offeringIds">;
|
|
935
958
|
type OrderStatus = "placed" | "completed" | "attending" | "cancelled" | "refunded" | "started" | "pending" | "abandoned";
|
|
936
959
|
interface OrderCosts {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
960
|
+
subtotal: CurrencyAmount;
|
|
961
|
+
fee: CurrencyAmount;
|
|
962
|
+
tax: CurrencyAmount;
|
|
963
|
+
discount: CurrencyAmount;
|
|
964
|
+
delivery: CurrencyAmount;
|
|
965
|
+
gross: CurrencyAmount;
|
|
966
|
+
preDiscount: CurrencyAmount;
|
|
967
|
+
total: CurrencyAmount;
|
|
945
968
|
}
|
|
946
969
|
/**
|
|
947
970
|
* Represents an order in the system.
|
|
@@ -949,145 +972,178 @@ interface OrderCosts {
|
|
|
949
972
|
* @export
|
|
950
973
|
*/
|
|
951
974
|
interface Order extends VCDataRecord {
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
* Can include address, coordinates, or virtual link.
|
|
1070
|
-
*/
|
|
1071
|
-
location?: Location;
|
|
1072
|
-
/**
|
|
1073
|
-
* Optional logo, banner, or primary image representing the context.
|
|
1074
|
-
* Used in UI to visually identify the entity during checkout.
|
|
1075
|
-
*/
|
|
1076
|
-
logo?: Photo;
|
|
1077
|
-
/**
|
|
1078
|
-
* A map of offerings relevant to this context (e.g., ticket types, merch).
|
|
1079
|
-
* Stored as a record keyed by offering ID to allow fast lookup.
|
|
1080
|
-
* Each value is a partial offering object, intended for display, validation, or pricing.
|
|
1081
|
-
* @example {
|
|
1082
|
-
* "off_123abc": { path: "events/ev_1234/tickets/tkt_567", offering: { name: "VIP Ticket", price: 3000 }),
|
|
1083
|
-
* "off_456def": { path: "events/ev_1234/tickets/tkt_567", offering: { name: "T-Shirt", price: 2000 }}
|
|
1084
|
-
* }
|
|
1085
|
-
*/
|
|
1086
|
-
offerings?: Record<string, ResolvedCartContextOffering>;
|
|
975
|
+
/**
|
|
976
|
+
* Human-readable order number for customer reference.
|
|
977
|
+
* Often used in emails and receipts.
|
|
978
|
+
* @example "GW-12345679"
|
|
979
|
+
*/
|
|
980
|
+
orderNumber: string;
|
|
981
|
+
/**
|
|
982
|
+
* @description The currency code used for this order in ISO 4217 format.
|
|
983
|
+
* @example "USD"
|
|
984
|
+
*
|
|
985
|
+
* @pattern ^[A-Z]{3}$
|
|
986
|
+
*/
|
|
987
|
+
currency: string;
|
|
988
|
+
/**
|
|
989
|
+
* List of applied coupons used in the order.
|
|
990
|
+
* Supports multiple entries based on organizer preferences.
|
|
991
|
+
*/
|
|
992
|
+
coupons?: CouponSummary[];
|
|
993
|
+
organizerId: string;
|
|
994
|
+
/**
|
|
995
|
+
* Namespaced identifier indicating what the order is associated with.
|
|
996
|
+
* Format: "{type}_{id}", where type is "evt", "ven", or "org".
|
|
997
|
+
* @example "evt_56k2cf348"
|
|
998
|
+
* @example "org_9912ff8"
|
|
999
|
+
*/
|
|
1000
|
+
contextId: ContextId;
|
|
1001
|
+
/**
|
|
1002
|
+
* Detailed cost breakdown for this order.
|
|
1003
|
+
*/
|
|
1004
|
+
costs: OrderCosts;
|
|
1005
|
+
/**
|
|
1006
|
+
* Customer information related to this order.
|
|
1007
|
+
*/
|
|
1008
|
+
customer: Customer;
|
|
1009
|
+
/**
|
|
1010
|
+
* The current status of the order.
|
|
1011
|
+
* @example "paid"
|
|
1012
|
+
*/
|
|
1013
|
+
status: OrderStatus;
|
|
1014
|
+
/**
|
|
1015
|
+
* A list of individual items included in the order.
|
|
1016
|
+
*/
|
|
1017
|
+
items: OrderItem[];
|
|
1018
|
+
/**
|
|
1019
|
+
* Agreement flags for terms and marketing opt-ins.
|
|
1020
|
+
*/
|
|
1021
|
+
agreements: {
|
|
1022
|
+
/**
|
|
1023
|
+
* Whether the customer accepted the organizer’s custom terms.
|
|
1024
|
+
* @example true
|
|
1025
|
+
*/
|
|
1026
|
+
agreedToOrganizerTerms?: boolean;
|
|
1027
|
+
/**
|
|
1028
|
+
* Whether the customer accepted the platform-wide terms of service.
|
|
1029
|
+
* @example true
|
|
1030
|
+
*/
|
|
1031
|
+
agreedToTerms?: boolean;
|
|
1032
|
+
/**
|
|
1033
|
+
* Whether the customer opted in to receive marketing emails.
|
|
1034
|
+
* @example false
|
|
1035
|
+
*/
|
|
1036
|
+
emailOptIn?: boolean;
|
|
1037
|
+
/**
|
|
1038
|
+
* Whether the customer opted in to receive marketing SMS messages.
|
|
1039
|
+
* @example false
|
|
1040
|
+
*/
|
|
1041
|
+
textOptIn?: boolean;
|
|
1042
|
+
};
|
|
1043
|
+
/**
|
|
1044
|
+
* Responses to dynamic questions during checkout (e.g. survey or registration).
|
|
1045
|
+
* @example { "tshirtSize": "M", "vipNewsletter": true }
|
|
1046
|
+
*/
|
|
1047
|
+
answers: {
|
|
1048
|
+
[questionId: string]: string | boolean;
|
|
1049
|
+
};
|
|
1050
|
+
/**
|
|
1051
|
+
* Freeform object containing metadata forwarded from the partner site
|
|
1052
|
+
* or embedding context. Can include UTM tags, user traits, campaign IDs, etc.
|
|
1053
|
+
* @example { utm_campaign: "spring_launch", partner: "venue_123" }
|
|
1054
|
+
*/
|
|
1055
|
+
forwarded: any;
|
|
1056
|
+
/**
|
|
1057
|
+
* Internal or computed metadata associated with the order.
|
|
1058
|
+
* May include fulfillment flags, debugging info, or derived calculations.
|
|
1059
|
+
* @example { preview: true, manuallyAdjusted: true }
|
|
1060
|
+
*/
|
|
1061
|
+
meta: {
|
|
1062
|
+
/**
|
|
1063
|
+
* Display context (event, venue, organizer) for rendering and logic.
|
|
1064
|
+
*/
|
|
1065
|
+
resolvedContext?: ResolvedCartContext;
|
|
1066
|
+
/**
|
|
1067
|
+
* Cost components to calculate the cart costs.
|
|
1068
|
+
*
|
|
1069
|
+
* @ignore
|
|
1070
|
+
*/
|
|
1071
|
+
costComponents?: CostComponent[];
|
|
1072
|
+
/**
|
|
1073
|
+
* Snapshot of when pricing was calculated and locked.
|
|
1074
|
+
* Useful for honoring totals during a grace window.
|
|
1075
|
+
*/
|
|
1076
|
+
priceLock?: {
|
|
1077
|
+
lockedAt: string;
|
|
1078
|
+
ttl?: number;
|
|
1079
|
+
};
|
|
1080
|
+
/**
|
|
1081
|
+
* Any additional internal system flags, A/B test conditions, or
|
|
1082
|
+
* non-critical partner payloads.
|
|
1083
|
+
*/
|
|
1084
|
+
[key: string]: any;
|
|
1085
|
+
};
|
|
1086
|
+
/**
|
|
1087
|
+
* Session and request context captured at the time of order creation.
|
|
1088
|
+
* Includes IPs, referrer, user agent, cart session ID, and tracking info.
|
|
1089
|
+
*/
|
|
1090
|
+
context: OrderContext;
|
|
1091
|
+
version: ApiVersion;
|
|
1087
1092
|
}
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1093
|
+
type OrderContext = {
|
|
1094
|
+
type: "event";
|
|
1095
|
+
event: EventProfile;
|
|
1096
|
+
venue?: Venue;
|
|
1097
|
+
} | {
|
|
1098
|
+
type: "venue";
|
|
1099
|
+
event?: EventProfile;
|
|
1100
|
+
venue: Venue;
|
|
1101
|
+
};
|
|
1102
|
+
interface OrderContext$1 {
|
|
1103
|
+
/**
|
|
1104
|
+
* IP addresses associated with the user request.
|
|
1105
|
+
* Typically includes forwarded IPs and direct client IP.
|
|
1106
|
+
* @example ["203.0.113.1", "10.0.0.1"]
|
|
1107
|
+
*/
|
|
1108
|
+
ipAddresses: string[];
|
|
1109
|
+
/**
|
|
1110
|
+
* Raw User-Agent header from the client request.
|
|
1111
|
+
* @example "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)..."
|
|
1112
|
+
*/
|
|
1113
|
+
userAgent: string;
|
|
1114
|
+
/**
|
|
1115
|
+
* The referring URL from which the cart or checkout was initiated.
|
|
1116
|
+
* May be a partner site, marketing page, or event listing.
|
|
1117
|
+
* @example "https://partner.example.com/tickets/event123"
|
|
1118
|
+
*/
|
|
1119
|
+
referrer: string;
|
|
1120
|
+
/**
|
|
1121
|
+
* Authenticated user ID, or null for anonymous guests.
|
|
1122
|
+
* @example "uid_456def"
|
|
1123
|
+
*/
|
|
1124
|
+
uid: string | null;
|
|
1125
|
+
/**
|
|
1126
|
+
* The unique cart session ID assigned at the time the cart was created.
|
|
1127
|
+
* Helps track cart attribution across systems.
|
|
1128
|
+
* @example "cart_sess_abc123"
|
|
1129
|
+
*/
|
|
1130
|
+
cartSessionId: string;
|
|
1131
|
+
/**
|
|
1132
|
+
* (Optional) Origin domain name if embedded or white-labeled.
|
|
1133
|
+
* Can help identify partner portals or iframe referrers.
|
|
1134
|
+
* @example "examplepartner.com"
|
|
1135
|
+
*/
|
|
1136
|
+
originDomain?: string;
|
|
1137
|
+
/**
|
|
1138
|
+
* (Optional) Campaign ID, UTM source, or tracking label.
|
|
1139
|
+
* Useful for affiliate and analytics systems.
|
|
1140
|
+
* @example "utm_campaign=spring_launch"
|
|
1141
|
+
*/
|
|
1142
|
+
trackingId?: string;
|
|
1143
|
+
/**
|
|
1144
|
+
* Allows custom fields for analytics, partners, or experiment data.
|
|
1145
|
+
*/
|
|
1146
|
+
[custom: string]: unknown;
|
|
1091
1147
|
}
|
|
1092
1148
|
/**
|
|
1093
1149
|
* Represents a temporary or persisted cart before order placement.
|
|
@@ -1095,87 +1151,118 @@ interface ResolvedCartContextOffering {
|
|
|
1095
1151
|
*
|
|
1096
1152
|
* @export
|
|
1097
1153
|
*/
|
|
1098
|
-
interface CartSession extends DataRecord, Pick<Order, "currency" | "contextId" | "version" | "coupons"> {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
meta: {
|
|
1151
|
-
/**
|
|
1152
|
-
* Display context (event, venue, organizer) for rendering and logic.
|
|
1153
|
-
*/
|
|
1154
|
-
resolvedContext?: ResolvedCartContext;
|
|
1155
|
-
/**
|
|
1156
|
-
* Cost components to calculate the cart costs.
|
|
1157
|
-
*
|
|
1158
|
-
* @ignore
|
|
1159
|
-
*/
|
|
1160
|
-
costComponents?: CostComponent[];
|
|
1161
|
-
/**
|
|
1162
|
-
* Snapshot of when pricing was calculated and locked.
|
|
1163
|
-
* Useful for honoring totals during a grace window.
|
|
1164
|
-
*/
|
|
1165
|
-
priceLock?: {
|
|
1166
|
-
lockedAt: string;
|
|
1167
|
-
ttl?: number;
|
|
1168
|
-
};
|
|
1169
|
-
/**
|
|
1170
|
-
* Any additional internal system flags, A/B test conditions, or
|
|
1171
|
-
* non-critical partner payloads.
|
|
1172
|
-
*/
|
|
1173
|
-
[key: string]: any;
|
|
1174
|
-
};
|
|
1175
|
-
status: "started" | "completed" | "abandoned" | "cancelled";
|
|
1154
|
+
interface CartSession extends DataRecord, Pick<Order, "currency" | "contextId" | "version" | "coupons" | "companyId" | "organizerId" | "meta"> {
|
|
1155
|
+
orderId?: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* Authenticated user ID, if available.
|
|
1158
|
+
* @example "uid_123abc"
|
|
1159
|
+
*/
|
|
1160
|
+
uid: string | null;
|
|
1161
|
+
/**
|
|
1162
|
+
* Optional snapshot of customer info entered during cart fill.
|
|
1163
|
+
* Not required and not final.
|
|
1164
|
+
*
|
|
1165
|
+
* @schema lazy(() => customerSchema).optional()
|
|
1166
|
+
*/
|
|
1167
|
+
customer?: Partial<Customer>;
|
|
1168
|
+
/**
|
|
1169
|
+
* @schema lazy(() => orderContextSchema).optional()
|
|
1170
|
+
*/
|
|
1171
|
+
context: Partial<OrderContext$1>;
|
|
1172
|
+
/**
|
|
1173
|
+
* Items the user has added to their cart.
|
|
1174
|
+
*/
|
|
1175
|
+
items: Partial<OrderItem>[];
|
|
1176
|
+
/**
|
|
1177
|
+
* Estimated totals based on current cart state.
|
|
1178
|
+
* These values are subject to recalculation before checkout.
|
|
1179
|
+
*/
|
|
1180
|
+
costs?: {
|
|
1181
|
+
subtotal: CurrencyAmount;
|
|
1182
|
+
discount: CurrencyAmount;
|
|
1183
|
+
tax: CurrencyAmount;
|
|
1184
|
+
fee: CurrencyAmount;
|
|
1185
|
+
delivery: CurrencyAmount;
|
|
1186
|
+
total: CurrencyAmount;
|
|
1187
|
+
};
|
|
1188
|
+
paymentStatus: "pending" | "confirmed" | "failed" | "refunded";
|
|
1189
|
+
/**
|
|
1190
|
+
* Stripe PaymentIntent ID linked to this cart, if created.
|
|
1191
|
+
* Used for confirming payment on the backend.
|
|
1192
|
+
* @example "pi_1ABCXYZ..."
|
|
1193
|
+
*/
|
|
1194
|
+
paymentIntentId?: string;
|
|
1195
|
+
/**
|
|
1196
|
+
* Stripe PaymentIntent client secret, used by frontend (e.g. Stripe.js).
|
|
1197
|
+
* Required for completing the payment flow.
|
|
1198
|
+
* @example "pi_1ABCXYZ..._secret_456"
|
|
1199
|
+
*/
|
|
1200
|
+
paymentIntentClientSecret?: string;
|
|
1201
|
+
/**
|
|
1202
|
+
* Partner-forwarded data (e.g. utm, session metadata).
|
|
1203
|
+
*/
|
|
1204
|
+
forwarded?: any;
|
|
1205
|
+
status: "started" | "completed" | "abandoned" | "cancelled";
|
|
1176
1206
|
}
|
|
1177
1207
|
type UpdatableCartSession = Pick<CartSession, "customer" | "items">;
|
|
1178
1208
|
|
|
1209
|
+
/**
|
|
1210
|
+
* Pagination parameters for a paginated API request.
|
|
1211
|
+
*/
|
|
1212
|
+
interface Pagination {
|
|
1213
|
+
/** Number of results per page. */
|
|
1214
|
+
size: number;
|
|
1215
|
+
/** Page number (starting from 1). */
|
|
1216
|
+
page: number;
|
|
1217
|
+
/** Continuation */
|
|
1218
|
+
continuation?: string;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* Supported HTTP methods.
|
|
1223
|
+
*/
|
|
1224
|
+
type RequestMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
1225
|
+
type RequestOptions = {
|
|
1226
|
+
method?: RequestMethod;
|
|
1227
|
+
data?: any;
|
|
1228
|
+
query?: Record<string, string | number | boolean | undefined>;
|
|
1229
|
+
headers?: Record<string, string>;
|
|
1230
|
+
pagination?: Pagination;
|
|
1231
|
+
};
|
|
1232
|
+
/**
|
|
1233
|
+
* A function that performs a request to the Cohost API.
|
|
1234
|
+
* The generic <T> allows you to specify the expected response type.
|
|
1235
|
+
*/
|
|
1236
|
+
type RequestFn = <T = any>(path: string, options?: RequestOptions) => Promise<T>;
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* Optional settings for customizing the behavior of the CohostClient.
|
|
1240
|
+
*/
|
|
1241
|
+
interface CohostClientSettings {
|
|
1242
|
+
/** Enable verbose debug output for all API requests. */
|
|
1243
|
+
debug?: boolean;
|
|
1244
|
+
/** Override the default API base URL (defaults to apiBaseUrl). */
|
|
1245
|
+
apiUrl?: string;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* Base class for all API endpoint groups within the Cohost SDK.
|
|
1250
|
+
* Provides shared access to the configured request function and settings.
|
|
1251
|
+
*/
|
|
1252
|
+
declare class CohostEndpoint {
|
|
1253
|
+
/** Shared request function injected from the client */
|
|
1254
|
+
protected request: RequestFn;
|
|
1255
|
+
/** Client settings passed during instantiation */
|
|
1256
|
+
protected settings: CohostClientSettings;
|
|
1257
|
+
/**
|
|
1258
|
+
* Constructs a new endpoint group.
|
|
1259
|
+
*
|
|
1260
|
+
* @param request - The shared request function for performing API calls
|
|
1261
|
+
* @param settings - The client-wide settings passed from the parent client
|
|
1262
|
+
*/
|
|
1263
|
+
constructor(request: RequestFn, settings: CohostClientSettings);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1179
1266
|
/**
|
|
1180
1267
|
* Provides methods to interact with the Cohost Events API.
|
|
1181
1268
|
*
|
|
@@ -1213,6 +1300,15 @@ declare class EventsAPI extends CohostEndpoint {
|
|
|
1213
1300
|
* @throws Will throw an error if the request fails or the event does not exist
|
|
1214
1301
|
*/
|
|
1215
1302
|
tickets(id: string): Promise<Ticket[]>;
|
|
1303
|
+
/**
|
|
1304
|
+
* List attendees in the event.
|
|
1305
|
+
*
|
|
1306
|
+
* Requires: valid authentication token. This endpoint is not public.
|
|
1307
|
+
*
|
|
1308
|
+
* @param id - The ID of the event.
|
|
1309
|
+
* @returns List of tickets (attendees) for the event.
|
|
1310
|
+
*/
|
|
1311
|
+
attendees(id: string, filters?: PaginatedRequest<any>): Promise<PaginatedResponse<Attendee3>>;
|
|
1216
1312
|
}
|
|
1217
1313
|
|
|
1218
1314
|
/**
|
|
@@ -1280,7 +1376,7 @@ declare class SessionsAPI extends CohostEndpoint {
|
|
|
1280
1376
|
*
|
|
1281
1377
|
* @throws Will throw an error if the update fails
|
|
1282
1378
|
*/
|
|
1283
|
-
update(id: string, input: UpdatableCartSession): Promise<CartSession>;
|
|
1379
|
+
update(id: string, input: Partial<UpdatableCartSession>): Promise<CartSession>;
|
|
1284
1380
|
/**
|
|
1285
1381
|
* Cancel (soft delete) a cart session.
|
|
1286
1382
|
*
|
|
@@ -1302,6 +1398,21 @@ declare class SessionsAPI extends CohostEndpoint {
|
|
|
1302
1398
|
offeringId: string;
|
|
1303
1399
|
quantity: number;
|
|
1304
1400
|
}): Promise<CartSession>;
|
|
1401
|
+
/**
|
|
1402
|
+
* Pre-validate and prepare the cart session for checkout.
|
|
1403
|
+
* @param sessionId
|
|
1404
|
+
*/
|
|
1405
|
+
preValidate(sessionId: string, data: any): Promise<CartSession>;
|
|
1406
|
+
/**
|
|
1407
|
+
* Close the cart session, and place the order.
|
|
1408
|
+
*
|
|
1409
|
+
* @param sessionId - The ID of the session
|
|
1410
|
+
* @param data - Data to place the order
|
|
1411
|
+
* @returns {CartSession} The latest cart session
|
|
1412
|
+
*
|
|
1413
|
+
* @throws Will throw an error if the order placement fails
|
|
1414
|
+
*/
|
|
1415
|
+
placeOrder(sessionId: string, data: any): Promise<CartSession>;
|
|
1305
1416
|
/**
|
|
1306
1417
|
* Remove an item from the cart session.
|
|
1307
1418
|
* The same as setting the quantity to 0.
|