@cohostvip/cohost-node 0.0.8 → 0.0.9

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