@cimplify/sdk 0.1.0

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.
@@ -0,0 +1,2620 @@
1
+ /** Decimal value represented as string for precision */
2
+ type Money = string;
3
+ /** Supported currencies */
4
+ type Currency = "GHS" | "USD" | "NGN" | "KES" | "ZAR" | string;
5
+ /** Pagination parameters */
6
+ interface PaginationParams {
7
+ page?: number;
8
+ limit?: number;
9
+ offset?: number;
10
+ }
11
+ /** Pagination metadata in response */
12
+ interface Pagination {
13
+ total_count: number;
14
+ current_page: number;
15
+ page_size: number;
16
+ total_pages: number;
17
+ }
18
+ /** API error structure */
19
+ interface ApiError {
20
+ code: string;
21
+ message: string;
22
+ retryable: boolean;
23
+ }
24
+ /** Custom error class for SDK errors */
25
+ declare class CimplifyError extends Error {
26
+ code: string;
27
+ retryable: boolean;
28
+ constructor(code: string, message: string, retryable?: boolean);
29
+ }
30
+
31
+ type ProductType = "product" | "service" | "digital" | "bundle" | "composite";
32
+ type InventoryType = "one_to_one" | "composition" | "none";
33
+ type VariantStrategy = "fetch_all" | "use_axes";
34
+ type DigitalProductType = "download" | "license_key" | "ticket" | "access_grant" | "redemption_code";
35
+ type DepositType = "none" | "fixed" | "percentage";
36
+ type SalesChannel = "pos" | "online" | "marketplace" | "partners";
37
+ interface Product {
38
+ id: string;
39
+ business_id: string;
40
+ category_id?: string;
41
+ name: string;
42
+ slug: string;
43
+ description?: string;
44
+ image_url?: string;
45
+ default_price: Money;
46
+ product_type: ProductType;
47
+ inventory_type: InventoryType;
48
+ variant_strategy: VariantStrategy;
49
+ is_active: boolean;
50
+ created_at: string;
51
+ updated_at: string;
52
+ metadata?: Record<string, unknown>;
53
+ tags?: string[];
54
+ images?: string[];
55
+ calories?: number;
56
+ allergies?: string[];
57
+ recipe?: Record<string, unknown>;
58
+ sku?: string;
59
+ barcode?: string;
60
+ ean?: string;
61
+ upc?: string;
62
+ is_trackable?: boolean;
63
+ is_tracked?: boolean;
64
+ is_tracked_in_store?: boolean;
65
+ is_tracked_in_warehouse?: boolean;
66
+ inventory_threshold?: number;
67
+ external_id?: string;
68
+ external_source?: string;
69
+ download_url?: string;
70
+ digital_type?: DigitalProductType;
71
+ max_downloads?: number;
72
+ license_key_required?: boolean;
73
+ file_size_mb?: number;
74
+ file_hash?: string;
75
+ file_type?: string;
76
+ version?: string;
77
+ download_expires_days?: number;
78
+ license_key_format?: string;
79
+ max_activations?: number;
80
+ validity_days?: number;
81
+ event_id?: string;
82
+ event_date?: string;
83
+ venue?: string;
84
+ ticket_type?: string;
85
+ seat_info?: Record<string, unknown>;
86
+ access_type?: string;
87
+ access_level?: string;
88
+ access_duration_days?: number;
89
+ code_type?: string;
90
+ code_value?: Money;
91
+ code_currency?: string;
92
+ duration_minutes?: number;
93
+ preparation_time_minutes?: number;
94
+ staff_required_count?: number;
95
+ buffer_before_minutes?: number;
96
+ buffer_after_minutes?: number;
97
+ general_service_capacity?: number;
98
+ deposit_type?: DepositType;
99
+ deposit_amount?: Money;
100
+ cancellation_window_minutes?: number;
101
+ no_show_fee?: Money;
102
+ requires_specific_staff?: boolean;
103
+ requires_specific_resource?: boolean;
104
+ hs_code?: string;
105
+ mid_code?: string;
106
+ material?: string;
107
+ allow_backorder?: boolean;
108
+ item_condition?: string;
109
+ vendor?: string;
110
+ length_mm?: number;
111
+ width_mm?: number;
112
+ height_mm?: number;
113
+ channels?: SalesChannel[];
114
+ meta_title?: string;
115
+ meta_description?: string;
116
+ is_discountable?: boolean;
117
+ taxonomy_id?: string;
118
+ }
119
+ interface ProductWithDetails extends Product {
120
+ category?: Category;
121
+ variants?: ProductVariant[];
122
+ add_ons?: AddOnWithOptions[];
123
+ variant_axes?: VariantAxisWithValues[];
124
+ location_prices?: LocationProductPrice[];
125
+ location_availability?: ProductAvailability[];
126
+ time_profiles?: ProductTimeProfile[];
127
+ }
128
+ interface ProductVariant {
129
+ id: string;
130
+ name: string;
131
+ business_id: string;
132
+ product_id: string;
133
+ component_multiplier: Money;
134
+ price_adjustment: Money;
135
+ is_default: boolean;
136
+ created_at: string;
137
+ updated_at: string;
138
+ is_active?: boolean;
139
+ is_archived?: boolean;
140
+ is_deleted?: boolean;
141
+ inventory_threshold?: number;
142
+ images?: string[];
143
+ external_id?: string;
144
+ external_source?: string;
145
+ ean?: string;
146
+ upc?: string;
147
+ is_trackable?: boolean;
148
+ is_tracked?: boolean;
149
+ is_tracked_in_store?: boolean;
150
+ is_tracked_in_warehouse?: boolean;
151
+ sku?: string;
152
+ barcode?: string;
153
+ download_url?: string;
154
+ metadata?: Record<string, unknown>;
155
+ duration_minutes?: number;
156
+ max_downloads?: number;
157
+ license_key?: string;
158
+ display_attributes?: VariantDisplayAttribute[];
159
+ }
160
+ interface VariantDisplayAttribute {
161
+ axis_id: string;
162
+ axis_name: string;
163
+ value_id: string;
164
+ value_name: string;
165
+ }
166
+ interface VariantAxis {
167
+ id: string;
168
+ business_id: string;
169
+ product_id: string;
170
+ name: string;
171
+ display_order: number;
172
+ affects_recipe: boolean;
173
+ created_at: string;
174
+ updated_at: string;
175
+ metadata?: Record<string, unknown>;
176
+ }
177
+ interface VariantAxisWithValues extends VariantAxis {
178
+ values: VariantAxisValue[];
179
+ }
180
+ interface VariantAxisValue {
181
+ id: string;
182
+ business_id: string;
183
+ axis_id: string;
184
+ name: string;
185
+ display_order: number;
186
+ created_at: string;
187
+ updated_at: string;
188
+ metadata?: Record<string, unknown>;
189
+ }
190
+ interface ProductVariantValue {
191
+ variant_id: string;
192
+ axis_value_id: string;
193
+ business_id: string;
194
+ created_at: string;
195
+ updated_at: string;
196
+ metadata?: Record<string, unknown>;
197
+ }
198
+ interface VariantLocationAvailability {
199
+ id: string;
200
+ variant_id: string;
201
+ location_id: string;
202
+ business_id: string;
203
+ is_available: boolean;
204
+ is_in_stock: boolean;
205
+ created_at: string;
206
+ updated_at: string;
207
+ metadata?: Record<string, unknown>;
208
+ }
209
+ /** Input for selecting a variant by axis values */
210
+ interface VariantAxisSelection {
211
+ [axisName: string]: string;
212
+ }
213
+ interface AddOn {
214
+ id: string;
215
+ business_id: string;
216
+ name: string;
217
+ is_multiple_allowed: boolean;
218
+ is_required: boolean;
219
+ is_mutually_exclusive: boolean;
220
+ min_selections?: number;
221
+ max_selections?: number;
222
+ created_at: string;
223
+ updated_at: string;
224
+ metadata?: Record<string, unknown>;
225
+ }
226
+ interface AddOnWithOptions extends AddOn {
227
+ options: AddOnOption[];
228
+ }
229
+ interface AddOnOption {
230
+ id: string;
231
+ add_on_id: string;
232
+ business_id: string;
233
+ name: string;
234
+ option_sku?: string;
235
+ default_price?: Money;
236
+ description?: string;
237
+ is_required: boolean;
238
+ is_mutually_exclusive: boolean;
239
+ created_at: string;
240
+ updated_at: string;
241
+ metadata?: Record<string, unknown>;
242
+ }
243
+ interface AddOnOptionPrice {
244
+ id: string;
245
+ add_on_option_id: string;
246
+ location_id: string;
247
+ business_id: string;
248
+ price: Money;
249
+ created_at: string;
250
+ updated_at: string;
251
+ metadata?: Record<string, unknown>;
252
+ }
253
+ interface ProductAddOn {
254
+ id: string;
255
+ business_id: string;
256
+ product_id: string;
257
+ add_on_id: string;
258
+ created_at: string;
259
+ updated_at: string;
260
+ metadata?: Record<string, unknown>;
261
+ }
262
+ interface Category {
263
+ id: string;
264
+ business_id: string;
265
+ name: string;
266
+ slug: string;
267
+ description?: string;
268
+ created_at: string;
269
+ updated_at: string;
270
+ metadata?: Record<string, unknown>;
271
+ }
272
+ interface CategorySummary extends Category {
273
+ product_count: number;
274
+ }
275
+ interface Collection {
276
+ id: string;
277
+ business_id: string;
278
+ name: string;
279
+ slug: string;
280
+ description?: string;
281
+ tags?: string[];
282
+ image_url?: string;
283
+ channels?: SalesChannel[];
284
+ created_at: string;
285
+ updated_at: string;
286
+ metadata?: Record<string, unknown>;
287
+ }
288
+ interface CollectionSummary extends Collection {
289
+ product_count: number;
290
+ }
291
+ interface CollectionProduct {
292
+ id: string;
293
+ collection_id: string;
294
+ product_id: string;
295
+ display_order?: number;
296
+ created_at: string;
297
+ updated_at: string;
298
+ metadata?: Record<string, unknown>;
299
+ }
300
+ type BundlePriceType = "fixed" | "percentage_discount" | "fixed_discount";
301
+ interface Bundle {
302
+ id: string;
303
+ business_id: string;
304
+ product_id: string;
305
+ name: string;
306
+ slug: string;
307
+ description?: string;
308
+ image_url?: string;
309
+ pricing_type: BundlePriceType;
310
+ bundle_price?: Money;
311
+ discount_value?: Money;
312
+ created_at: string;
313
+ updated_at: string;
314
+ metadata?: Record<string, unknown>;
315
+ }
316
+ interface BundleSummary extends Bundle {
317
+ product_count: number;
318
+ }
319
+ interface BundleProduct {
320
+ id: string;
321
+ bundle_id: string;
322
+ product_id: string;
323
+ variant_id?: string;
324
+ allow_variant_choice: boolean;
325
+ quantity: number;
326
+ created_at: string;
327
+ updated_at: string;
328
+ metadata?: Record<string, unknown>;
329
+ }
330
+ interface BundleWithDetails extends Bundle {
331
+ product: Product;
332
+ components: BundleComponentData[];
333
+ schedules?: ProductTimeProfile[];
334
+ availability?: Record<string, ProductAvailability>;
335
+ }
336
+ interface BundleComponentData {
337
+ component: BundleProduct;
338
+ product: Product;
339
+ variants: ProductVariant[];
340
+ variant_axes: VariantAxis[];
341
+ variant_axis_values: VariantAxisValue[];
342
+ product_variant_values: ProductVariantValue[];
343
+ }
344
+ interface BundleComponentInfo {
345
+ id: string;
346
+ product_id: string;
347
+ variant_id?: string;
348
+ quantity: number;
349
+ }
350
+ type CompositePricingMode = "additive" | "highest_per_group" | "highest_overall" | "tiered";
351
+ type GroupPricingBehavior = "additive" | "first_n_free" | "flat_fee" | "highest_only";
352
+ type ComponentSourceType = "product" | "stock" | "add_on" | "standalone";
353
+ interface Composite {
354
+ id: string;
355
+ business_id: string;
356
+ product_id: string;
357
+ base_price: Money;
358
+ pricing_mode: CompositePricingMode;
359
+ min_order_quantity?: number;
360
+ max_order_quantity?: number;
361
+ created_at: string;
362
+ updated_at: string;
363
+ metadata?: Record<string, unknown>;
364
+ }
365
+ interface CompositeWithDetails extends Composite {
366
+ product: Product;
367
+ groups: ComponentGroupWithComponents[];
368
+ }
369
+ interface ComponentGroup {
370
+ id: string;
371
+ composite_id: string;
372
+ name: string;
373
+ description?: string;
374
+ display_order: number;
375
+ min_selections: number;
376
+ max_selections?: number;
377
+ allow_quantity: boolean;
378
+ max_quantity_per_component?: number;
379
+ pricing_behavior: GroupPricingBehavior;
380
+ pricing_behavior_config?: Record<string, unknown>;
381
+ icon?: string;
382
+ color?: string;
383
+ created_at: string;
384
+ updated_at: string;
385
+ }
386
+ interface ComponentGroupWithComponents extends ComponentGroup {
387
+ components: CompositeComponent[];
388
+ }
389
+ interface CompositeComponent {
390
+ id: string;
391
+ group_id: string;
392
+ product_id?: string;
393
+ variant_id?: string;
394
+ stock_id?: string;
395
+ add_on_id?: string;
396
+ add_on_option_id?: string;
397
+ display_name?: string;
398
+ display_description?: string;
399
+ display_image_url?: string;
400
+ price: Money;
401
+ price_per_additional?: Money;
402
+ quantity_per_selection?: Money;
403
+ waste_percentage?: Money;
404
+ calories?: number;
405
+ allergens?: string[];
406
+ display_order: number;
407
+ is_popular: boolean;
408
+ is_premium: boolean;
409
+ is_available: boolean;
410
+ is_archived: boolean;
411
+ created_at: string;
412
+ updated_at: string;
413
+ }
414
+ /** Input for calculating composite price or adding to cart */
415
+ interface ComponentSelectionInput {
416
+ component_id: string;
417
+ quantity: number;
418
+ variant_id?: string;
419
+ add_on_option_id?: string;
420
+ }
421
+ /** Result of composite price calculation */
422
+ interface CompositePriceResult {
423
+ base_price: Money;
424
+ components_total: Money;
425
+ tier_applied?: string;
426
+ final_price: Money;
427
+ breakdown: ComponentPriceBreakdown[];
428
+ }
429
+ interface ComponentPriceBreakdown {
430
+ component_id: string;
431
+ component_name: string;
432
+ quantity: number;
433
+ unit_price: Money;
434
+ total_price: Money;
435
+ group_id: string;
436
+ source_type: ComponentSourceType;
437
+ source_product_id?: string;
438
+ source_stock_id?: string;
439
+ }
440
+ type PriceEntryType = "base" | "location" | "time" | "channel";
441
+ interface Price {
442
+ id: string;
443
+ product_id: string;
444
+ location_id: string;
445
+ business_id: string;
446
+ price: Money;
447
+ entry_type: PriceEntryType;
448
+ created_at: string;
449
+ updated_at: string;
450
+ metadata?: Record<string, unknown>;
451
+ }
452
+ type LocationProductPrice = Price;
453
+ interface ProductAvailability {
454
+ id: string;
455
+ business_id: string;
456
+ location_id: string;
457
+ product_id: string;
458
+ is_available: boolean;
459
+ is_in_stock: boolean;
460
+ created_at: string;
461
+ updated_at: string;
462
+ metadata?: Record<string, unknown>;
463
+ }
464
+ interface ProductTimeProfile {
465
+ id: string;
466
+ business_id: string;
467
+ product_id: string;
468
+ day_of_week: number;
469
+ start_time: string;
470
+ end_time: string;
471
+ created_at: string;
472
+ updated_at: string;
473
+ metadata?: Record<string, unknown>;
474
+ }
475
+
476
+ interface GetProductsOptions {
477
+ category?: string;
478
+ collection?: string;
479
+ search?: string;
480
+ limit?: number;
481
+ offset?: number;
482
+ tags?: string[];
483
+ featured?: boolean;
484
+ in_stock?: boolean;
485
+ min_price?: number;
486
+ max_price?: number;
487
+ sort_by?: "name" | "price" | "created_at";
488
+ sort_order?: "asc" | "desc";
489
+ }
490
+ interface SearchOptions {
491
+ limit?: number;
492
+ category?: string;
493
+ }
494
+ declare class CatalogueQueries {
495
+ private client;
496
+ constructor(client: CimplifyClient);
497
+ getProducts(options?: GetProductsOptions): Promise<Product[]>;
498
+ getProduct(id: string): Promise<ProductWithDetails>;
499
+ getProductBySlug(slug: string): Promise<ProductWithDetails>;
500
+ getVariants(productId: string): Promise<ProductVariant[]>;
501
+ getVariantAxes(productId: string): Promise<VariantAxis[]>;
502
+ /**
503
+ * Find a variant by axis selections (e.g., { "Size": "Large", "Color": "Red" })
504
+ * Returns the matching variant or null if no match found.
505
+ */
506
+ getVariantByAxisSelections(productId: string, selections: VariantAxisSelection): Promise<ProductVariant | null>;
507
+ /**
508
+ * Get a specific variant by its ID
509
+ */
510
+ getVariantById(productId: string, variantId: string): Promise<ProductVariant>;
511
+ getAddOns(productId: string): Promise<AddOn[]>;
512
+ getCategories(): Promise<Category[]>;
513
+ getCategory(id: string): Promise<Category>;
514
+ getCategoryBySlug(slug: string): Promise<Category>;
515
+ getCategoryProducts(categoryId: string): Promise<Product[]>;
516
+ getCollections(): Promise<Collection[]>;
517
+ getCollection(id: string): Promise<Collection>;
518
+ getCollectionBySlug(slug: string): Promise<Collection>;
519
+ getCollectionProducts(collectionId: string): Promise<Product[]>;
520
+ searchCollections(query: string, limit?: number): Promise<Collection[]>;
521
+ getBundles(): Promise<Bundle[]>;
522
+ getBundle(id: string): Promise<BundleWithDetails>;
523
+ getBundleBySlug(slug: string): Promise<BundleWithDetails>;
524
+ searchBundles(query: string, limit?: number): Promise<Bundle[]>;
525
+ getComposites(options?: {
526
+ limit?: number;
527
+ }): Promise<Composite[]>;
528
+ getComposite(id: string): Promise<CompositeWithDetails>;
529
+ getCompositeByProductId(productId: string): Promise<CompositeWithDetails>;
530
+ calculateCompositePrice(compositeId: string, selections: ComponentSelectionInput[], locationId?: string): Promise<CompositePriceResult>;
531
+ search(query: string, options?: SearchOptions): Promise<Product[]>;
532
+ searchProducts(query: string, options?: SearchOptions): Promise<Product[]>;
533
+ getMenu(options?: {
534
+ category?: string;
535
+ limit?: number;
536
+ }): Promise<Product[]>;
537
+ getMenuCategory(categoryId: string): Promise<Product[]>;
538
+ getMenuItem(itemId: string): Promise<ProductWithDetails>;
539
+ }
540
+
541
+ type CartStatus = "active" | "converting" | "converted" | "expired" | "abandoned";
542
+ type CartChannel = "qr" | "taker" | "staff" | "web" | "dashboard";
543
+ type PriceSource = {
544
+ type: "default_item";
545
+ } | {
546
+ type: "location_specific";
547
+ location_id: string;
548
+ } | {
549
+ type: "variant";
550
+ variant_id: string;
551
+ } | {
552
+ type: "composite";
553
+ composite_id: string;
554
+ } | {
555
+ type: "custom";
556
+ };
557
+ type AdjustmentType = {
558
+ type: "location_based";
559
+ location_id: string;
560
+ } | {
561
+ type: "variant_based";
562
+ variant_id: string;
563
+ } | {
564
+ type: "time_based";
565
+ } | {
566
+ type: "customer_segment";
567
+ segment_id: string;
568
+ } | {
569
+ type: "customer_loyalty";
570
+ tier: string;
571
+ } | {
572
+ type: "channel_markup";
573
+ channel: string;
574
+ } | {
575
+ type: "discount";
576
+ discount_id: string;
577
+ } | {
578
+ type: "bundle";
579
+ bundle_id: string;
580
+ } | {
581
+ type: "manual";
582
+ reason: string;
583
+ } | {
584
+ type: "time_limited_promotion";
585
+ promotion_id: string;
586
+ valid_until: string;
587
+ };
588
+ interface PriceAdjustment {
589
+ adjustment_type: AdjustmentType;
590
+ amount: Money;
591
+ percentage?: Money;
592
+ reason: string;
593
+ applied_at: string;
594
+ }
595
+ interface TaxPathComponent {
596
+ name: string;
597
+ rate: Money;
598
+ }
599
+ interface PricePathTaxInfo {
600
+ tax_rate: Money;
601
+ tax_amount: Money;
602
+ is_inclusive: boolean;
603
+ components: TaxPathComponent[];
604
+ }
605
+ interface PriceDecisionPath {
606
+ base_price_source: PriceSource;
607
+ adjustments: PriceAdjustment[];
608
+ context?: Record<string, unknown>;
609
+ }
610
+ interface ChosenPrice {
611
+ base_price: Money;
612
+ final_price: Money;
613
+ markup_percentage: Money;
614
+ markup_amount: Money;
615
+ markup_discount_percentage: Money;
616
+ markup_discount_amount: Money;
617
+ currency?: string;
618
+ custom_fields?: Record<string, unknown>;
619
+ decision_path?: PriceDecisionPath;
620
+ tax_info?: PricePathTaxInfo;
621
+ }
622
+ type BenefitType = "percentage" | "fixed_amount" | "free_item" | "buy_x_get_y";
623
+ interface AppliedDiscount {
624
+ discount_id: string;
625
+ discount_code?: string;
626
+ discount_type: BenefitType;
627
+ discount_value: Money;
628
+ discount_amount: Money;
629
+ applied_at: string;
630
+ }
631
+ interface DiscountBreakdown {
632
+ item_discounts: Record<string, AppliedDiscount[]>;
633
+ order_discounts: AppliedDiscount[];
634
+ }
635
+ interface DiscountDetails {
636
+ discounts: AppliedDiscount[];
637
+ total_discount_amount: Money;
638
+ breakdown: DiscountBreakdown;
639
+ }
640
+ interface SelectedAddOnOption {
641
+ option_id: string;
642
+ add_on_id: string;
643
+ name: string;
644
+ price: Money;
645
+ quantity: number;
646
+ is_required: boolean;
647
+ selected_at: string;
648
+ price_info?: ChosenPrice;
649
+ }
650
+ interface AddOnDetails {
651
+ selected_options: SelectedAddOnOption[];
652
+ total_add_on_price: Money;
653
+ add_ons: CartAddOn[];
654
+ }
655
+ interface CartAddOn {
656
+ add_on_id: string;
657
+ name: string;
658
+ min_selections: number;
659
+ max_selections: number;
660
+ selected_options: string[];
661
+ is_required: boolean;
662
+ }
663
+ interface VariantDetails {
664
+ variant_id: string;
665
+ sku?: string;
666
+ properties: Record<string, string>;
667
+ }
668
+ interface BundleSelectionInput {
669
+ component_id: string;
670
+ variant_id?: string;
671
+ quantity: number;
672
+ }
673
+ interface BundleStoredSelection {
674
+ component_id: string;
675
+ product_id: string;
676
+ product_name: string;
677
+ variant_id?: string;
678
+ variant_name?: string;
679
+ quantity: number;
680
+ unit_price: Money;
681
+ }
682
+ interface BundleSelectionData {
683
+ bundle_id: string;
684
+ selections: BundleStoredSelection[];
685
+ }
686
+ interface CompositeStoredSelection {
687
+ component_id: string;
688
+ component_name: string;
689
+ quantity: number;
690
+ group_id: string;
691
+ source_type: "product" | "stock" | "add_on" | "standalone";
692
+ source_product_id?: string;
693
+ source_stock_id?: string;
694
+ unit_price: Money;
695
+ }
696
+ interface CompositePriceBreakdown {
697
+ base_price: Money;
698
+ components_total: Money;
699
+ tier_applied?: string;
700
+ final_price: Money;
701
+ }
702
+ interface CompositeSelectionData {
703
+ composite_id: string;
704
+ selections: CompositeStoredSelection[];
705
+ breakdown: CompositePriceBreakdown;
706
+ }
707
+
708
+ type LineConfiguration = {
709
+ type: "simple";
710
+ variant?: VariantDetails;
711
+ add_ons?: AddOnDetails;
712
+ } | {
713
+ type: "service";
714
+ variant?: VariantDetails;
715
+ add_ons?: AddOnDetails;
716
+ scheduled_start?: string;
717
+ scheduled_end?: string;
718
+ confirmation_code?: string;
719
+ service_status?: string;
720
+ primary_staff_id?: string;
721
+ scheduling_metadata?: Record<string, unknown>;
722
+ } | {
723
+ type: "bundle";
724
+ variant?: VariantDetails;
725
+ input: BundleSelectionInput[];
726
+ resolved?: BundleSelectionData;
727
+ add_ons?: AddOnDetails;
728
+ } | {
729
+ type: "composite";
730
+ variant?: VariantDetails;
731
+ input: ComponentSelectionInput[];
732
+ resolved?: CompositeSelectionData;
733
+ add_ons?: AddOnDetails;
734
+ } | {
735
+ type: "digital";
736
+ variant?: VariantDetails;
737
+ add_ons?: AddOnDetails;
738
+ digital_type?: string;
739
+ fulfillment_id?: string;
740
+ };
741
+ interface Cart {
742
+ id: string;
743
+ business_id: string;
744
+ customer_id?: string;
745
+ session_id?: string;
746
+ location_id?: string;
747
+ created_at: string;
748
+ updated_at: string;
749
+ expires_at: string;
750
+ subtotal: Money;
751
+ tax_amount: Money;
752
+ service_charge: Money;
753
+ total_discounts: Money;
754
+ total_price: Money;
755
+ total_items: number;
756
+ tax_rate?: Money;
757
+ service_charge_rate?: Money;
758
+ price_info: ChosenPrice;
759
+ applied_discount_ids: string[];
760
+ applied_discount_codes: string[];
761
+ discount_details?: DiscountDetails;
762
+ currency: string;
763
+ customer_name?: string;
764
+ customer_email?: string;
765
+ customer_phone?: string;
766
+ customer_address?: string;
767
+ source: string;
768
+ status: CartStatus;
769
+ channel: string;
770
+ order_id?: string;
771
+ metadata?: Record<string, unknown>;
772
+ items: CartItem[];
773
+ }
774
+ interface CartItem {
775
+ id: string;
776
+ cart_id: string;
777
+ item_id: string;
778
+ quantity: number;
779
+ line_key: string;
780
+ configuration: LineConfiguration;
781
+ price: Money;
782
+ add_ons_price: Money;
783
+ price_info: ChosenPrice;
784
+ applied_discount_ids: string[];
785
+ item_discount_amount: Money;
786
+ discount_details?: DiscountDetails;
787
+ created_at: string;
788
+ updated_at: string;
789
+ metadata?: Record<string, unknown>;
790
+ }
791
+ interface CartTotals {
792
+ subtotal: Money;
793
+ tax_amount: Money;
794
+ service_charge: Money;
795
+ total_discounts: Money;
796
+ total_price: Money;
797
+ tax_rate?: Money;
798
+ service_charge_rate?: Money;
799
+ applied_discount_ids: string[];
800
+ applied_discount_codes: string[];
801
+ discount_details?: DiscountDetails;
802
+ }
803
+ interface DisplayCart {
804
+ id: string;
805
+ business_id: string;
806
+ customer_id?: string;
807
+ session_id?: string;
808
+ location_id?: string;
809
+ subtotal: Money;
810
+ tax_amount: Money;
811
+ service_charge: Money;
812
+ total_discounts: Money;
813
+ total_price: Money;
814
+ total_items: number;
815
+ tax_rate?: Money;
816
+ service_charge_rate?: Money;
817
+ currency: string;
818
+ channel: string;
819
+ status: string;
820
+ business_name: string;
821
+ business_logo?: string;
822
+ location_name?: string;
823
+ customer_name?: string;
824
+ customer_email?: string;
825
+ customer_phone?: string;
826
+ customer_address?: string;
827
+ items: DisplayCartItem[];
828
+ applied_discount_codes: string[];
829
+ discount_details?: DiscountDetails;
830
+ }
831
+ interface DisplayCartItem {
832
+ id: string;
833
+ cart_id: string;
834
+ item_id: string;
835
+ quantity: number;
836
+ name: string;
837
+ description?: string;
838
+ image_url?: string;
839
+ category_name?: string;
840
+ is_available: boolean;
841
+ preparation_time?: number;
842
+ unit_price: Money;
843
+ total_price: Money;
844
+ add_ons_price: Money;
845
+ price_info: ChosenPrice;
846
+ item_discount_amount: Money;
847
+ discount_details?: DiscountDetails;
848
+ add_ons: DisplayAddOn[];
849
+ special_instructions?: string;
850
+ }
851
+ interface DisplayAddOn {
852
+ id: string;
853
+ name: string;
854
+ min_selections: number;
855
+ max_selections: number;
856
+ is_required: boolean;
857
+ selected_options: DisplayAddOnOption[];
858
+ }
859
+ interface DisplayAddOnOption {
860
+ id: string;
861
+ name: string;
862
+ price: Money;
863
+ quantity: number;
864
+ image_url?: string;
865
+ description?: string;
866
+ }
867
+ interface UICartBusiness {
868
+ name: string;
869
+ logo_url?: string;
870
+ contact_email?: string;
871
+ contact_phone?: string;
872
+ }
873
+ interface UICartLocation {
874
+ id?: string;
875
+ name?: string;
876
+ }
877
+ interface UICartCustomer {
878
+ id?: string;
879
+ name?: string;
880
+ email?: string;
881
+ phone?: string;
882
+ address?: string;
883
+ }
884
+ interface UICartPricing {
885
+ subtotal: Money;
886
+ tax_amount: Money;
887
+ service_charge: Money;
888
+ total_discounts: Money;
889
+ total_price: Money;
890
+ tax_rate?: Money;
891
+ service_charge_rate?: Money;
892
+ currency: string;
893
+ }
894
+ interface AddOnOptionDetails {
895
+ id: string;
896
+ name: string;
897
+ price?: Money;
898
+ is_required: boolean;
899
+ description?: string;
900
+ image_url?: string;
901
+ }
902
+ interface AddOnGroupDetails {
903
+ id: string;
904
+ name: string;
905
+ is_multiple_allowed: boolean;
906
+ min_selections: number;
907
+ max_selections: number;
908
+ required: boolean;
909
+ options: AddOnOptionDetails[];
910
+ }
911
+ interface VariantDetailsDTO {
912
+ id: string;
913
+ name: string;
914
+ price: Money;
915
+ price_adjustment: Money;
916
+ is_default: boolean;
917
+ }
918
+ interface CartItemDetails {
919
+ id: string;
920
+ cart_id: string;
921
+ item_id: string;
922
+ quantity: number;
923
+ line_key: string;
924
+ line_type: "simple" | "service" | "bundle" | "composite" | "digital";
925
+ name: string;
926
+ description?: string;
927
+ image_url?: string;
928
+ category_id?: string;
929
+ category_name?: string;
930
+ is_available: boolean;
931
+ variant_id?: string;
932
+ variant_details?: VariantDetails;
933
+ variant_name?: string;
934
+ variant_info?: VariantDetailsDTO;
935
+ base_price: Money;
936
+ add_ons_price: Money;
937
+ total_price: Money;
938
+ item_discount_amount: Money;
939
+ price_info: ChosenPrice;
940
+ add_on_option_ids: string[];
941
+ add_on_ids: string[];
942
+ add_on_details: AddOnDetails;
943
+ add_on_options: AddOnOptionDetails[];
944
+ add_ons: AddOnGroupDetails[];
945
+ special_instructions?: string;
946
+ scheduled_start?: string;
947
+ scheduled_end?: string;
948
+ confirmation_code?: string;
949
+ service_status?: string;
950
+ staff_id?: string;
951
+ scheduling_metadata?: Record<string, unknown>;
952
+ bundle_selections?: BundleSelectionInput[];
953
+ bundle_resolved?: BundleSelectionData;
954
+ composite_selections?: ComponentSelectionInput[];
955
+ composite_resolved?: CompositeSelectionData;
956
+ applied_discount_ids: string[];
957
+ discount_details?: DiscountDetails;
958
+ created_at: string;
959
+ updated_at: string;
960
+ metadata?: Record<string, unknown>;
961
+ }
962
+ /** Enriched cart returned by cart#enriched - matches cart_dto.rs UICart */
963
+ interface UICart {
964
+ id: string;
965
+ business_id: string;
966
+ session_id?: string;
967
+ customer_id?: string;
968
+ location_id?: string;
969
+ created_at: string;
970
+ updated_at: string;
971
+ expires_at: string;
972
+ status: string;
973
+ source: string;
974
+ channel: string;
975
+ business_details?: UICartBusiness;
976
+ location_details?: UICartLocation;
977
+ customer_info: UICartCustomer;
978
+ items: CartItemDetails[];
979
+ pricing: UICartPricing;
980
+ metadata?: Record<string, unknown>;
981
+ }
982
+ interface AddToCartInput {
983
+ item_id: string;
984
+ quantity?: number;
985
+ variant_id?: string;
986
+ add_on_options?: string[];
987
+ special_instructions?: string;
988
+ bundle_selections?: BundleSelectionInput[];
989
+ composite_selections?: ComponentSelectionInput[];
990
+ scheduled_start?: string;
991
+ scheduled_end?: string;
992
+ staff_id?: string;
993
+ }
994
+ interface UpdateCartItemInput {
995
+ quantity?: number;
996
+ variant_id?: string;
997
+ add_on_options?: string[];
998
+ notes?: string;
999
+ bundle_selections?: BundleSelectionInput[];
1000
+ composite_selections?: ComponentSelectionInput[];
1001
+ scheduled_start?: string;
1002
+ scheduled_end?: string;
1003
+ staff_id?: string;
1004
+ }
1005
+ interface CartSummary {
1006
+ item_count: number;
1007
+ total_items: number;
1008
+ subtotal: Money;
1009
+ discount_amount: Money;
1010
+ tax_amount: Money;
1011
+ total: Money;
1012
+ currency: string;
1013
+ }
1014
+
1015
+ declare class CartOperations {
1016
+ private client;
1017
+ constructor(client: CimplifyClient);
1018
+ /**
1019
+ * Get the enriched cart with product names, images, and details.
1020
+ * This is the main method for storefront display.
1021
+ */
1022
+ get(): Promise<UICart>;
1023
+ getRaw(): Promise<Cart>;
1024
+ getItems(): Promise<CartItem[]>;
1025
+ getCount(): Promise<number>;
1026
+ getTotal(): Promise<string>;
1027
+ getSummary(): Promise<CartSummary>;
1028
+ addItem(input: AddToCartInput): Promise<Cart>;
1029
+ updateItem(cartItemId: string, updates: UpdateCartItemInput): Promise<Cart>;
1030
+ updateQuantity(cartItemId: string, quantity: number): Promise<Cart>;
1031
+ removeItem(cartItemId: string): Promise<Cart>;
1032
+ clear(): Promise<Cart>;
1033
+ applyCoupon(code: string): Promise<Cart>;
1034
+ removeCoupon(): Promise<Cart>;
1035
+ isEmpty(): Promise<boolean>;
1036
+ hasItem(productId: string, variantId?: string): Promise<boolean>;
1037
+ findItem(productId: string, variantId?: string): Promise<CartItem | undefined>;
1038
+ }
1039
+
1040
+ type OrderStatus = "pending" | "created" | "confirmed" | "in_preparation" | "ready_to_serve" | "partially_served" | "served" | "delivered" | "picked_up" | "completed" | "cancelled" | "refunded";
1041
+ type PaymentState = "not_paid" | "paid" | "partially_refunded" | "refunded";
1042
+ type OrderChannel = "qr" | "taker" | "staff" | "web" | "dashboard";
1043
+ type LineType = "product" | "service" | "bundle" | "composite" | "digital";
1044
+ type OrderLineState = {
1045
+ state: "pending";
1046
+ } | {
1047
+ state: "in_preparation";
1048
+ } | {
1049
+ state: "ready";
1050
+ } | {
1051
+ state: "partially_served";
1052
+ served_quantity: number;
1053
+ } | {
1054
+ state: "served";
1055
+ } | {
1056
+ state: "completed";
1057
+ } | {
1058
+ state: "cancelled";
1059
+ reason?: string;
1060
+ };
1061
+ interface OrderLineStatus {
1062
+ state: OrderLineState;
1063
+ quantity_ordered: number;
1064
+ quantity_prepared: number;
1065
+ quantity_served: number;
1066
+ last_modified: string;
1067
+ modified_by: string;
1068
+ }
1069
+ type FulfillmentType = "appointment" | "shipment" | "order" | "digital";
1070
+ type FulfillmentStatus = "pending" | "in_progress" | "completed" | "cancelled";
1071
+ interface FulfillmentLink {
1072
+ fulfillment_type: FulfillmentType;
1073
+ fulfillment_id: string;
1074
+ }
1075
+ interface OrderFulfillmentSummary {
1076
+ total_items: number;
1077
+ pending_items: number;
1078
+ in_progress_items: number;
1079
+ completed_items: number;
1080
+ cancelled_items: number;
1081
+ all_complete: boolean;
1082
+ any_in_progress: boolean;
1083
+ }
1084
+ type FeeBearerType = "customer" | "business" | "split";
1085
+ interface AmountToPay {
1086
+ customer_pays: Money;
1087
+ business_receives: Money;
1088
+ cimplify_receives: Money;
1089
+ provider_receives: Money;
1090
+ fee_bearer: FeeBearerType;
1091
+ }
1092
+ interface LineItem {
1093
+ id: string;
1094
+ order_id: string;
1095
+ product_id: string;
1096
+ line_key: string;
1097
+ quantity: number;
1098
+ configuration: LineConfiguration;
1099
+ price: Money;
1100
+ add_ons_price: Money;
1101
+ price_info: ChosenPrice;
1102
+ item_discount_amount: Money;
1103
+ discount_details?: DiscountDetails;
1104
+ created_at: string;
1105
+ updated_at: string;
1106
+ line_state: OrderLineStatus;
1107
+ metadata?: Record<string, unknown>;
1108
+ fulfillment_type?: FulfillmentType;
1109
+ fulfillment_id?: string;
1110
+ }
1111
+ interface Order {
1112
+ id: string;
1113
+ business_id: string;
1114
+ channel: OrderChannel;
1115
+ status: OrderStatus;
1116
+ payment_state: PaymentState;
1117
+ order_type: string;
1118
+ placed_by?: string;
1119
+ user_friendly_id: string;
1120
+ customer_id?: string;
1121
+ customer_name?: string;
1122
+ customer_email?: string;
1123
+ customer_phone?: string;
1124
+ customer_notes?: string[];
1125
+ discount_code?: string;
1126
+ applied_discount_ids: string[];
1127
+ applied_discount_codes: string[];
1128
+ discount_details?: DiscountDetails;
1129
+ delivery_address?: string;
1130
+ tracking_token?: string;
1131
+ tracking_link?: string;
1132
+ pickup_time?: string;
1133
+ created_at: string;
1134
+ updated_at: string;
1135
+ delivered_at?: string;
1136
+ fulfilled_at?: string;
1137
+ confirmed_at?: string;
1138
+ served_at?: string;
1139
+ completed_at?: string;
1140
+ cancelled_at?: string;
1141
+ table_number?: string;
1142
+ room_number?: string;
1143
+ location_id?: string;
1144
+ was_placed_by_staff: boolean;
1145
+ modified_by_staff: boolean;
1146
+ delivery_required: boolean;
1147
+ customer_will_pick_up: boolean;
1148
+ total_price: Money;
1149
+ total_excl_tax_discount_and_service_charge: Money;
1150
+ total_discount: Money;
1151
+ service_charge?: Money;
1152
+ tax?: Money;
1153
+ price_info: ChosenPrice;
1154
+ currency: string;
1155
+ bill_token?: string;
1156
+ order_group_id?: string;
1157
+ paid_via_group: boolean;
1158
+ amount_to_pay: AmountToPay;
1159
+ served_by?: string;
1160
+ metadata?: Record<string, unknown>;
1161
+ requires_scheduling: boolean;
1162
+ all_items_scheduled: boolean;
1163
+ earliest_service_time?: string;
1164
+ latest_service_time?: string;
1165
+ deposit_required: boolean;
1166
+ deposit_amount: Money;
1167
+ deposit_paid_amount: Money;
1168
+ balance_due: Money;
1169
+ deposit_due_date?: string;
1170
+ final_payment_due_date?: string;
1171
+ version: number;
1172
+ total_quantity: number;
1173
+ items: LineItem[];
1174
+ computed_payment_status?: string;
1175
+ is_service_only?: boolean;
1176
+ }
1177
+ interface OrderHistory {
1178
+ id: string;
1179
+ order_id: string;
1180
+ modified_by: string;
1181
+ modification_type: string;
1182
+ modification_details: string;
1183
+ modified_at: string;
1184
+ metadata?: Record<string, unknown>;
1185
+ }
1186
+ type OrderGroupPaymentState = "not_paid" | "partially_paid" | "fully_paid" | "refunded";
1187
+ interface OrderGroup {
1188
+ id: string;
1189
+ business_id: string;
1190
+ location_id: string;
1191
+ table_number: string;
1192
+ created_at: string;
1193
+ updated_at: string;
1194
+ status: string;
1195
+ is_split: boolean;
1196
+ is_closed: boolean;
1197
+ total_amount?: Money;
1198
+ paid_amount?: Money;
1199
+ payment_status: OrderGroupPaymentState;
1200
+ split_method?: string;
1201
+ max_orders?: number;
1202
+ currency?: string;
1203
+ amount_to_pay: AmountToPay;
1204
+ metadata?: Record<string, unknown>;
1205
+ }
1206
+ interface OrderGroupPayment {
1207
+ id: string;
1208
+ order_group_id: string;
1209
+ order_id?: string;
1210
+ amount: Money;
1211
+ payment_method: string;
1212
+ status: string;
1213
+ created_at: string;
1214
+ updated_at: string;
1215
+ metadata?: Record<string, unknown>;
1216
+ }
1217
+ interface OrderSplitDetail {
1218
+ order_id: string;
1219
+ amount: Money;
1220
+ paid_amount?: Money;
1221
+ remaining_amount?: Money;
1222
+ }
1223
+ interface OrderGroupPaymentSummary {
1224
+ total_amount: Money;
1225
+ paid_amount: Money;
1226
+ remaining_amount: Money;
1227
+ split_details?: OrderSplitDetail[];
1228
+ }
1229
+ interface OrderGroupDetails {
1230
+ order_group: OrderGroup;
1231
+ orders: Order[];
1232
+ total: Money;
1233
+ payments: OrderGroupPayment[];
1234
+ payment_summary: OrderGroupPaymentSummary;
1235
+ }
1236
+ interface OrderPaymentEvent {
1237
+ id: string;
1238
+ order_id: string;
1239
+ amount: Money;
1240
+ reference: string;
1241
+ created_at: string;
1242
+ event_type: string;
1243
+ provider?: string;
1244
+ metadata?: Record<string, unknown>;
1245
+ }
1246
+ interface OrderFilter {
1247
+ location_id?: string;
1248
+ table_number?: string;
1249
+ order_type?: string;
1250
+ status?: string;
1251
+ from?: string;
1252
+ to?: string;
1253
+ search?: string;
1254
+ limit?: number;
1255
+ offset?: number;
1256
+ }
1257
+ interface CheckoutInput {
1258
+ customer_name?: string;
1259
+ customer_email?: string;
1260
+ customer_phone?: string;
1261
+ delivery_address?: string;
1262
+ order_type?: string;
1263
+ notes?: string;
1264
+ table_number?: string;
1265
+ room_number?: string;
1266
+ }
1267
+ interface UpdateOrderStatusInput {
1268
+ status: OrderStatus;
1269
+ notes?: string;
1270
+ }
1271
+ interface CancelOrderInput {
1272
+ reason?: string;
1273
+ }
1274
+ interface RefundOrderInput {
1275
+ amount?: Money;
1276
+ reason?: string;
1277
+ }
1278
+ type ServiceStatus = "awaiting_scheduling" | "scheduled" | "deposit_paid" | "confirmed" | "in_progress" | "completed" | "rescheduled" | "no_show" | "cancelled";
1279
+ type StaffRole = "primary" | "assistant" | "specialist" | "supervisor";
1280
+ type ReminderMethod = "sms" | "email" | "push" | "call" | "whatsapp";
1281
+ interface CustomerServicePreferences {
1282
+ preferred_staff_ids: string[];
1283
+ avoid_staff_ids: string[];
1284
+ room_type?: string;
1285
+ accessibility_needs: string[];
1286
+ temperature_preference?: string;
1287
+ music_preference?: string;
1288
+ special_requests?: string;
1289
+ previous_service_history: string[];
1290
+ }
1291
+ interface BufferTimes {
1292
+ before_minutes: number;
1293
+ after_minutes: number;
1294
+ travel_time_minutes?: number;
1295
+ setup_time_minutes?: number;
1296
+ cleanup_time_minutes?: number;
1297
+ }
1298
+ interface ReminderSettings {
1299
+ send_24h_reminder: boolean;
1300
+ send_2h_reminder: boolean;
1301
+ send_30min_reminder: boolean;
1302
+ reminder_phone?: string;
1303
+ reminder_email?: string;
1304
+ reminder_method: ReminderMethod;
1305
+ custom_reminder_message?: string;
1306
+ }
1307
+ interface CancellationPolicy {
1308
+ free_cancellation_hours: number;
1309
+ partial_refund_hours: number;
1310
+ no_refund_hours: number;
1311
+ cancellation_fee?: Money;
1312
+ reschedule_allowed: boolean;
1313
+ reschedule_fee?: Money;
1314
+ max_reschedules?: number;
1315
+ }
1316
+ interface ServiceNotes {
1317
+ preparation_notes?: string;
1318
+ staff_notes?: string;
1319
+ internal_notes?: string;
1320
+ customer_history: string[];
1321
+ allergies_warnings: string[];
1322
+ }
1323
+ interface PricingOverrides {
1324
+ custom_duration_minutes?: number;
1325
+ price_adjustment?: Money;
1326
+ discount_reason?: string;
1327
+ surge_pricing_multiplier?: Money;
1328
+ loyalty_discount?: Money;
1329
+ package_deal_reference?: string;
1330
+ }
1331
+ interface SchedulingMetadata {
1332
+ customer_preferences?: CustomerServicePreferences;
1333
+ buffer_times?: BufferTimes;
1334
+ reminder_settings?: ReminderSettings;
1335
+ cancellation_policy?: CancellationPolicy;
1336
+ service_notes?: ServiceNotes;
1337
+ pricing_overrides?: PricingOverrides;
1338
+ }
1339
+ interface StaffAssignment {
1340
+ staff_id: string;
1341
+ role: StaffRole;
1342
+ assigned_at: string;
1343
+ notes?: string;
1344
+ }
1345
+ interface ResourceAssignment {
1346
+ resource_id: string;
1347
+ quantity: number;
1348
+ assigned_at: string;
1349
+ notes?: string;
1350
+ }
1351
+ interface SchedulingResult {
1352
+ confirmation_code: string;
1353
+ assigned_staff: StaffAssignment[];
1354
+ assigned_resources: ResourceAssignment[];
1355
+ deposit_required: boolean;
1356
+ deposit_amount?: Money;
1357
+ total_duration_minutes: number;
1358
+ }
1359
+ interface DepositResult {
1360
+ order_confirmed: boolean;
1361
+ balance_due: Money;
1362
+ final_payment_due?: string;
1363
+ confirmation_sent: boolean;
1364
+ }
1365
+ interface ServiceScheduleRequest {
1366
+ line_item_id: string;
1367
+ start_time: string;
1368
+ end_time: string;
1369
+ preferred_staff_ids?: string[];
1370
+ resource_requirements?: string[];
1371
+ customer_notes?: string;
1372
+ }
1373
+ interface StaffScheduleItem {
1374
+ line_item_id: string;
1375
+ order_id: string;
1376
+ customer_name: string;
1377
+ service_name: string;
1378
+ start_time: string;
1379
+ end_time: string;
1380
+ confirmation_code: string;
1381
+ service_status: ServiceStatus;
1382
+ notes?: string;
1383
+ }
1384
+ interface LocationAppointment {
1385
+ line_item_id: string;
1386
+ order_id: string;
1387
+ customer_name: string;
1388
+ service_name: string;
1389
+ start_time: string;
1390
+ end_time: string;
1391
+ assigned_staff: string[];
1392
+ assigned_resources: string[];
1393
+ service_status: ServiceStatus;
1394
+ }
1395
+
1396
+ type PaymentStatus = "pending" | "processing" | "success" | "failed" | "refunded" | "captured" | "cancelled";
1397
+ type PaymentProvider = "stripe" | "paystack" | "mtn" | "vodafone" | "airtel" | "cellulant" | "offline" | "cash" | "manual";
1398
+ type PaymentMethodType = "card" | "mobile_money" | "bank_transfer" | "cash" | "custom";
1399
+ /** Authorization types for payment verification (OTP, PIN, etc.) */
1400
+ type AuthorizationType = "otp" | "pin" | "phone" | "birthday" | "address";
1401
+ /** Payment processing state machine states (for UI) */
1402
+ type PaymentProcessingState = "initial" | "preparing" | "processing" | "verifying" | "awaiting_authorization" | "success" | "error" | "timeout";
1403
+ interface PaymentMethod {
1404
+ type: PaymentMethodType;
1405
+ provider?: string;
1406
+ phone_number?: string;
1407
+ card_last_four?: string;
1408
+ custom_value?: string;
1409
+ }
1410
+ interface Payment {
1411
+ id: string;
1412
+ order_id: string;
1413
+ business_id: string;
1414
+ amount: Money;
1415
+ currency: Currency;
1416
+ payment_method: PaymentMethod;
1417
+ status: PaymentStatus;
1418
+ provider: PaymentProvider;
1419
+ provider_reference?: string;
1420
+ failure_reason?: string;
1421
+ created_at: string;
1422
+ updated_at: string;
1423
+ }
1424
+ interface InitializePaymentResult {
1425
+ payment_id: string;
1426
+ status: PaymentStatus;
1427
+ redirect_url?: string;
1428
+ authorization_url?: string;
1429
+ reference: string;
1430
+ provider: PaymentProvider;
1431
+ }
1432
+ /** Normalized payment response from checkout or payment initialization */
1433
+ interface PaymentResponse {
1434
+ method: string;
1435
+ provider: string;
1436
+ requires_action: boolean;
1437
+ public_key?: string;
1438
+ client_secret?: string;
1439
+ access_code?: string;
1440
+ redirect_url?: string;
1441
+ transaction_id?: string;
1442
+ order_id?: string;
1443
+ reference?: string;
1444
+ metadata?: Record<string, unknown>;
1445
+ instructions?: string;
1446
+ display_text?: string;
1447
+ requires_authorization?: boolean;
1448
+ authorization_type?: AuthorizationType;
1449
+ provider_payment_id?: string;
1450
+ }
1451
+ /** Payment status polling response */
1452
+ interface PaymentStatusResponse {
1453
+ status: "pending" | "processing" | "success" | "failed";
1454
+ paid: boolean;
1455
+ amount?: Money;
1456
+ currency?: string;
1457
+ reference?: string;
1458
+ message?: string;
1459
+ }
1460
+ interface PaymentErrorDetails {
1461
+ code: string;
1462
+ message: string;
1463
+ recoverable: boolean;
1464
+ technical?: string;
1465
+ }
1466
+ interface SubmitAuthorizationInput {
1467
+ reference: string;
1468
+ auth_type: AuthorizationType;
1469
+ value: string;
1470
+ }
1471
+
1472
+ type MobileMoneyProvider = "mtn" | "vodafone" | "airtel";
1473
+ interface Customer {
1474
+ id: string;
1475
+ email: string | null;
1476
+ phone: string | null;
1477
+ name: string;
1478
+ delivery_address: string | null;
1479
+ created_at: string;
1480
+ updated_at: string;
1481
+ metadata?: Record<string, unknown>;
1482
+ }
1483
+ interface CustomerAddress {
1484
+ id: string;
1485
+ customer_id: string;
1486
+ label: string;
1487
+ street_address: string;
1488
+ apartment: string | null;
1489
+ city: string;
1490
+ region: string;
1491
+ postal_code: string | null;
1492
+ country: string | null;
1493
+ delivery_instructions: string | null;
1494
+ phone_for_delivery: string | null;
1495
+ latitude: number | null;
1496
+ longitude: number | null;
1497
+ is_default: boolean | null;
1498
+ usage_count: number | null;
1499
+ last_used_at: string | null;
1500
+ created_at: string;
1501
+ updated_at: string;
1502
+ }
1503
+ interface CustomerMobileMoney {
1504
+ id: string;
1505
+ customer_id: string;
1506
+ phone_number: string;
1507
+ provider: MobileMoneyProvider;
1508
+ label: string;
1509
+ is_verified: boolean | null;
1510
+ verification_date: string | null;
1511
+ is_default: boolean | null;
1512
+ usage_count: number | null;
1513
+ last_used_at: string | null;
1514
+ success_rate: number | null;
1515
+ created_at: string;
1516
+ updated_at: string;
1517
+ }
1518
+ interface CustomerLinkPreferences {
1519
+ customer_id: string;
1520
+ is_link_enabled: boolean | null;
1521
+ enrolled_at: string | null;
1522
+ enrollment_business_id: string | null;
1523
+ preferred_order_type: string | null;
1524
+ default_address_id: string | null;
1525
+ default_mobile_money_id: string | null;
1526
+ remember_me: boolean | null;
1527
+ session_duration_days: number | null;
1528
+ two_factor_enabled: boolean | null;
1529
+ notify_on_order: boolean | null;
1530
+ notify_on_payment: boolean | null;
1531
+ created_at: string;
1532
+ updated_at: string;
1533
+ }
1534
+ interface LinkData {
1535
+ customer: Customer;
1536
+ addresses: CustomerAddress[];
1537
+ mobile_money: CustomerMobileMoney[];
1538
+ preferences: CustomerLinkPreferences;
1539
+ default_address: CustomerAddress | null;
1540
+ default_mobile_money: CustomerMobileMoney | null;
1541
+ }
1542
+ interface CreateAddressInput {
1543
+ address_line1: string;
1544
+ address_line2?: string;
1545
+ city: string;
1546
+ state?: string;
1547
+ postal_code?: string;
1548
+ country: string;
1549
+ label?: string;
1550
+ }
1551
+ interface UpdateAddressInput {
1552
+ address_id: string;
1553
+ address_line1?: string;
1554
+ address_line2?: string;
1555
+ city?: string;
1556
+ state?: string;
1557
+ postal_code?: string;
1558
+ country?: string;
1559
+ label?: string;
1560
+ }
1561
+ interface CreateMobileMoneyInput {
1562
+ phone_number: string;
1563
+ provider: string;
1564
+ account_name?: string;
1565
+ }
1566
+ interface EnrollmentData {
1567
+ contact: string;
1568
+ name?: string;
1569
+ }
1570
+ interface AddressData {
1571
+ label: string;
1572
+ street_address: string;
1573
+ apartment?: string;
1574
+ city: string;
1575
+ region: string;
1576
+ delivery_instructions?: string;
1577
+ phone_for_delivery?: string;
1578
+ }
1579
+ interface MobileMoneyData {
1580
+ phone_number: string;
1581
+ provider: string;
1582
+ label: string;
1583
+ }
1584
+ interface EnrollAndLinkOrderInput {
1585
+ order_id: string;
1586
+ business_id: string;
1587
+ address?: AddressData;
1588
+ mobile_money?: MobileMoneyData;
1589
+ order_type?: string;
1590
+ }
1591
+ interface LinkStatusResult {
1592
+ is_link_customer: boolean;
1593
+ }
1594
+ interface LinkEnrollResult {
1595
+ success: boolean;
1596
+ customer_id: string;
1597
+ contact?: string;
1598
+ enrolled_at?: string;
1599
+ preferences?: CustomerLinkPreferences;
1600
+ }
1601
+ interface EnrollAndLinkOrderResult {
1602
+ success: boolean;
1603
+ customer_id: string;
1604
+ order_id: string;
1605
+ enrollment_result: unknown;
1606
+ linked_at: string;
1607
+ }
1608
+ type DeviceType = "mobile" | "desktop" | "tablet";
1609
+ interface LinkSession {
1610
+ id: string;
1611
+ device_name: string | null;
1612
+ device_type: DeviceType | null;
1613
+ ip_address: string | null;
1614
+ last_used_at: string | null;
1615
+ created_at: string;
1616
+ is_current: boolean;
1617
+ }
1618
+ interface RevokeSessionResult {
1619
+ success: boolean;
1620
+ session_id: string;
1621
+ message: string;
1622
+ }
1623
+ interface RevokeAllSessionsResult {
1624
+ success: boolean;
1625
+ revoked_count: number;
1626
+ message: string;
1627
+ }
1628
+ type ContactType = "phone" | "email";
1629
+ interface RequestOtpInput {
1630
+ contact: string;
1631
+ contact_type: ContactType;
1632
+ }
1633
+ interface VerifyOtpInput {
1634
+ contact: string;
1635
+ contact_type: ContactType;
1636
+ otp_code: string;
1637
+ }
1638
+ interface AuthResponse {
1639
+ success: boolean;
1640
+ session_token: string | null;
1641
+ customer_id: string | null;
1642
+ message: string;
1643
+ }
1644
+
1645
+ type CheckoutMode = "link" | "guest";
1646
+ type CheckoutOrderType = "delivery" | "pickup" | "dine-in" | "walk-in";
1647
+ type CheckoutPaymentMethod = "mobile_money" | "card";
1648
+ type CheckoutStep = "authentication" | "order_details" | "payment_method" | "payment" | "confirmation";
1649
+ type PickupTimeType = "asap" | "scheduled";
1650
+ interface PickupTime {
1651
+ type: PickupTimeType;
1652
+ scheduled_time?: string;
1653
+ }
1654
+ interface CheckoutAddressInfo {
1655
+ street_address?: string;
1656
+ apartment?: string;
1657
+ city?: string;
1658
+ region?: string;
1659
+ postal_code?: string;
1660
+ country?: string;
1661
+ delivery_instructions?: string;
1662
+ phone_for_delivery?: string;
1663
+ pickup_time?: string;
1664
+ guest_count?: number;
1665
+ seating_time?: string;
1666
+ seating_requests?: string;
1667
+ }
1668
+ interface MobileMoneyDetails {
1669
+ phone_number: string;
1670
+ provider: MobileMoneyProvider;
1671
+ provider_other?: string;
1672
+ }
1673
+ interface CheckoutCustomerInfo {
1674
+ name: string;
1675
+ email: string;
1676
+ phone: string;
1677
+ notes?: string;
1678
+ save_details: boolean;
1679
+ }
1680
+ interface CheckoutFormData {
1681
+ cart_id: string;
1682
+ customer: CheckoutCustomerInfo;
1683
+ order_type: CheckoutOrderType;
1684
+ address_info: CheckoutAddressInfo;
1685
+ payment_method: string;
1686
+ mobile_money_details?: MobileMoneyDetails;
1687
+ special_instructions?: string;
1688
+ link_address_id?: string;
1689
+ link_payment_method_id?: string;
1690
+ idempotency_key?: string;
1691
+ }
1692
+ interface CheckoutResult {
1693
+ order_id: string;
1694
+ order_number: string;
1695
+ payment_reference?: string;
1696
+ payment_status: string;
1697
+ requires_authorization: boolean;
1698
+ authorization_type?: AuthorizationType;
1699
+ authorization_url?: string;
1700
+ display_text?: string;
1701
+ provider?: string;
1702
+ }
1703
+
1704
+ declare class CheckoutService {
1705
+ private client;
1706
+ constructor(client: CimplifyClient);
1707
+ process(data: CheckoutFormData): Promise<CheckoutResult>;
1708
+ initializePayment(orderId: string, method: PaymentMethod): Promise<InitializePaymentResult>;
1709
+ submitAuthorization(input: SubmitAuthorizationInput): Promise<CheckoutResult>;
1710
+ pollPaymentStatus(orderId: string): Promise<PaymentStatusResponse>;
1711
+ updateOrderCustomer(orderId: string, customer: CheckoutCustomerInfo): Promise<Order>;
1712
+ verifyPayment(orderId: string): Promise<Order>;
1713
+ }
1714
+
1715
+ interface GetOrdersOptions {
1716
+ status?: OrderStatus;
1717
+ limit?: number;
1718
+ offset?: number;
1719
+ }
1720
+ declare class OrderQueries {
1721
+ private client;
1722
+ constructor(client: CimplifyClient);
1723
+ list(options?: GetOrdersOptions): Promise<Order[]>;
1724
+ get(orderId: string): Promise<Order>;
1725
+ getRecent(limit?: number): Promise<Order[]>;
1726
+ getByStatus(status: OrderStatus): Promise<Order[]>;
1727
+ cancel(orderId: string, reason?: string): Promise<Order>;
1728
+ }
1729
+
1730
+ interface SuccessResult {
1731
+ success: boolean;
1732
+ message?: string;
1733
+ }
1734
+ declare class LinkService {
1735
+ private client;
1736
+ constructor(client: CimplifyClient);
1737
+ requestOtp(input: RequestOtpInput): Promise<SuccessResult>;
1738
+ verifyOtp(input: VerifyOtpInput): Promise<AuthResponse>;
1739
+ logout(): Promise<SuccessResult>;
1740
+ checkStatus(contact: string): Promise<LinkStatusResult>;
1741
+ getLinkData(): Promise<LinkData>;
1742
+ getAddresses(): Promise<CustomerAddress[]>;
1743
+ getMobileMoney(): Promise<CustomerMobileMoney[]>;
1744
+ getPreferences(): Promise<CustomerLinkPreferences>;
1745
+ enroll(data: EnrollmentData): Promise<LinkEnrollResult>;
1746
+ enrollAndLinkOrder(data: EnrollAndLinkOrderInput): Promise<EnrollAndLinkOrderResult>;
1747
+ updatePreferences(preferences: Partial<CustomerLinkPreferences>): Promise<SuccessResult>;
1748
+ createAddress(input: CreateAddressInput): Promise<CustomerAddress>;
1749
+ updateAddress(input: UpdateAddressInput): Promise<SuccessResult>;
1750
+ deleteAddress(addressId: string): Promise<SuccessResult>;
1751
+ setDefaultAddress(addressId: string): Promise<SuccessResult>;
1752
+ trackAddressUsage(addressId: string): Promise<SuccessResult>;
1753
+ createMobileMoney(input: CreateMobileMoneyInput): Promise<CustomerMobileMoney>;
1754
+ deleteMobileMoney(mobileMoneyId: string): Promise<SuccessResult>;
1755
+ setDefaultMobileMoney(mobileMoneyId: string): Promise<SuccessResult>;
1756
+ trackMobileMoneyUsage(mobileMoneyId: string): Promise<SuccessResult>;
1757
+ verifyMobileMoney(mobileMoneyId: string): Promise<SuccessResult>;
1758
+ getSessions(): Promise<LinkSession[]>;
1759
+ revokeSession(sessionId: string): Promise<RevokeSessionResult>;
1760
+ revokeAllSessions(): Promise<RevokeAllSessionsResult>;
1761
+ getAddressesRest(): Promise<CustomerAddress[]>;
1762
+ createAddressRest(input: CreateAddressInput): Promise<CustomerAddress>;
1763
+ deleteAddressRest(addressId: string): Promise<SuccessResult>;
1764
+ setDefaultAddressRest(addressId: string): Promise<SuccessResult>;
1765
+ getMobileMoneyRest(): Promise<CustomerMobileMoney[]>;
1766
+ createMobileMoneyRest(input: CreateMobileMoneyInput): Promise<CustomerMobileMoney>;
1767
+ deleteMobileMoneyRest(mobileMoneyId: string): Promise<SuccessResult>;
1768
+ setDefaultMobileMoneyRest(mobileMoneyId: string): Promise<SuccessResult>;
1769
+ }
1770
+
1771
+ interface AuthStatus {
1772
+ is_authenticated: boolean;
1773
+ customer?: Customer;
1774
+ session_expires_at?: string;
1775
+ }
1776
+ interface OtpResult {
1777
+ customer: Customer;
1778
+ session_token?: string;
1779
+ }
1780
+ interface UpdateProfileInput {
1781
+ name?: string;
1782
+ email?: string;
1783
+ phone?: string;
1784
+ }
1785
+ interface ChangePasswordInput {
1786
+ current_password: string;
1787
+ new_password: string;
1788
+ }
1789
+ declare class AuthService {
1790
+ private client;
1791
+ constructor(client: CimplifyClient);
1792
+ getStatus(): Promise<AuthStatus>;
1793
+ getCurrentUser(): Promise<Customer | null>;
1794
+ isAuthenticated(): Promise<boolean>;
1795
+ requestOtp(contact: string, contactType?: "phone" | "email"): Promise<void>;
1796
+ verifyOtp(code: string, contact?: string): Promise<OtpResult>;
1797
+ logout(): Promise<{
1798
+ success: boolean;
1799
+ }>;
1800
+ updateProfile(input: UpdateProfileInput): Promise<Customer>;
1801
+ changePassword(input: ChangePasswordInput): Promise<{
1802
+ success: boolean;
1803
+ }>;
1804
+ resetPassword(email: string): Promise<{
1805
+ success: boolean;
1806
+ }>;
1807
+ }
1808
+
1809
+ type BusinessType = "eatery" | "retail" | "service" | "other" | "system" | "unset";
1810
+ interface BusinessPreferences {
1811
+ [key: string]: unknown;
1812
+ }
1813
+ interface Business {
1814
+ id: string;
1815
+ name: string;
1816
+ handle: string;
1817
+ business_type: BusinessType;
1818
+ email: string;
1819
+ default_currency: string;
1820
+ default_phone?: string;
1821
+ default_address?: string;
1822
+ default_offers_table_service: boolean;
1823
+ default_accepts_online_orders: boolean;
1824
+ image?: string;
1825
+ status: string;
1826
+ created_at: string;
1827
+ updated_at: string;
1828
+ subscription_id?: string;
1829
+ owner_id?: string;
1830
+ created_by: string;
1831
+ preferences: BusinessPreferences;
1832
+ is_online_only: boolean;
1833
+ enabled_payment_types: string[];
1834
+ default_location_settings: Record<string, unknown>;
1835
+ metadata?: Record<string, unknown>;
1836
+ }
1837
+ interface LocationTaxBehavior {
1838
+ is_tax_inclusive: boolean;
1839
+ tax_rate: Money;
1840
+ }
1841
+ interface LocationTaxOverrides {
1842
+ [productId: string]: {
1843
+ tax_rate: Money;
1844
+ is_exempt: boolean;
1845
+ };
1846
+ }
1847
+ interface Location {
1848
+ id: string;
1849
+ business_id: string;
1850
+ name: string;
1851
+ location?: string;
1852
+ phone?: string;
1853
+ address?: string;
1854
+ service_charge_rate?: number;
1855
+ currency: string;
1856
+ capacity: number;
1857
+ status: string;
1858
+ enabled_payment_types?: string[];
1859
+ offers_table_service: boolean;
1860
+ accepts_online_orders: boolean;
1861
+ created_at: string;
1862
+ updated_at: string;
1863
+ preferences?: Record<string, unknown>;
1864
+ metadata?: Record<string, unknown>;
1865
+ country_code: string;
1866
+ timezone: string;
1867
+ tax_behavior?: LocationTaxBehavior;
1868
+ tax_overrides?: LocationTaxOverrides;
1869
+ }
1870
+ interface TimeRange {
1871
+ start: string;
1872
+ end: string;
1873
+ }
1874
+ type TimeRanges = TimeRange[];
1875
+ interface LocationTimeProfile {
1876
+ id: string;
1877
+ business_id: string;
1878
+ location_id: string;
1879
+ day: string;
1880
+ is_open: boolean;
1881
+ hours: TimeRanges;
1882
+ created_at: string;
1883
+ updated_at: string;
1884
+ metadata?: Record<string, unknown>;
1885
+ }
1886
+ interface Table {
1887
+ id: string;
1888
+ business_id: string;
1889
+ location_id: string;
1890
+ table_number: string;
1891
+ capacity: number;
1892
+ occupied: boolean;
1893
+ created_at: string;
1894
+ updated_at: string;
1895
+ metadata?: Record<string, unknown>;
1896
+ }
1897
+ interface Room {
1898
+ id: string;
1899
+ business_id: string;
1900
+ location_id: string;
1901
+ name: string;
1902
+ capacity: number;
1903
+ status: string;
1904
+ floor?: string;
1905
+ created_at: string;
1906
+ updated_at: string;
1907
+ metadata?: Record<string, unknown>;
1908
+ }
1909
+ interface ServiceCharge {
1910
+ percentage?: Money;
1911
+ is_mandatory?: boolean;
1912
+ description?: string;
1913
+ applies_to_parties_of?: number;
1914
+ minimum_amount?: Money;
1915
+ maximum_amount?: Money;
1916
+ }
1917
+ interface StorefrontBootstrap {
1918
+ business: Business;
1919
+ location?: Location;
1920
+ locations: Location[];
1921
+ categories: CategoryInfo[];
1922
+ currency: string;
1923
+ is_open: boolean;
1924
+ accepts_orders: boolean;
1925
+ time_profiles?: LocationTimeProfile[];
1926
+ }
1927
+ interface BusinessWithLocations extends Business {
1928
+ locations: Location[];
1929
+ default_location?: Location;
1930
+ }
1931
+ interface LocationWithDetails extends Location {
1932
+ time_profiles: LocationTimeProfile[];
1933
+ tables: Table[];
1934
+ rooms: Room[];
1935
+ is_open_now: boolean;
1936
+ next_open_time?: string;
1937
+ }
1938
+ /** Settings for frontend display (derived from Business/Location) */
1939
+ interface BusinessSettings {
1940
+ accept_online_orders: boolean;
1941
+ accept_reservations: boolean;
1942
+ require_customer_account: boolean;
1943
+ enable_tips: boolean;
1944
+ enable_loyalty: boolean;
1945
+ minimum_order_amount?: string;
1946
+ delivery_fee?: string;
1947
+ free_delivery_threshold?: string;
1948
+ tax_rate?: number;
1949
+ tax_inclusive: boolean;
1950
+ }
1951
+ /** Business hours (simplified for frontend) */
1952
+ interface BusinessHours {
1953
+ business_id: string;
1954
+ location_id?: string;
1955
+ day_of_week: number;
1956
+ open_time: string;
1957
+ close_time: string;
1958
+ is_closed: boolean;
1959
+ }
1960
+ /** Category summary for bootstrap (minimal fields) */
1961
+ interface CategoryInfo {
1962
+ id: string;
1963
+ name: string;
1964
+ slug: string;
1965
+ }
1966
+
1967
+ declare class BusinessService {
1968
+ private client;
1969
+ constructor(client: CimplifyClient);
1970
+ getInfo(): Promise<Business>;
1971
+ getByHandle(handle: string): Promise<Business>;
1972
+ getByDomain(domain: string): Promise<Business>;
1973
+ getSettings(): Promise<BusinessSettings>;
1974
+ getTheme(): Promise<Record<string, unknown>>;
1975
+ getLocations(): Promise<Location[]>;
1976
+ getLocation(locationId: string): Promise<Location>;
1977
+ getHours(): Promise<BusinessHours[]>;
1978
+ getLocationHours(locationId: string): Promise<BusinessHours[]>;
1979
+ getBootstrap(): Promise<StorefrontBootstrap>;
1980
+ }
1981
+
1982
+ type StockOwnershipType = "owned" | "consignment" | "dropship";
1983
+ type StockStatus = "in_stock" | "low_stock" | "out_of_stock";
1984
+ interface Stock {
1985
+ id: string;
1986
+ business_id: string;
1987
+ name: string;
1988
+ sku?: string;
1989
+ barcode?: string;
1990
+ unit_type: string;
1991
+ unit_cost?: Money;
1992
+ description?: string;
1993
+ image_url?: string;
1994
+ tags?: string[];
1995
+ categories?: string[];
1996
+ is_taxable: boolean;
1997
+ tax_rate?: Money;
1998
+ is_expirable: boolean;
1999
+ ownership_type: StockOwnershipType;
2000
+ quantity_on_hand: Money;
2001
+ quantity_allocated: Money;
2002
+ quantity_reserved: Money;
2003
+ min_order_quantity: Money;
2004
+ reorder_point?: Money;
2005
+ reorder_quantity?: Money;
2006
+ last_counted_at?: string;
2007
+ status: string;
2008
+ created_at: string;
2009
+ updated_at: string;
2010
+ metadata?: Record<string, unknown>;
2011
+ }
2012
+ interface StockLevel {
2013
+ product_id: string;
2014
+ variant_id?: string;
2015
+ location_id?: string;
2016
+ quantity: number;
2017
+ reserved_quantity: number;
2018
+ available_quantity: number;
2019
+ low_stock_threshold?: number;
2020
+ status: StockStatus;
2021
+ last_updated: string;
2022
+ }
2023
+ interface ProductStock {
2024
+ product_id: string;
2025
+ product_name: string;
2026
+ total_quantity: number;
2027
+ available_quantity: number;
2028
+ reserved_quantity: number;
2029
+ status: StockStatus;
2030
+ variants?: VariantStock[];
2031
+ locations?: LocationStock[];
2032
+ }
2033
+ interface VariantStock {
2034
+ variant_id: string;
2035
+ variant_name: string;
2036
+ sku?: string;
2037
+ quantity: number;
2038
+ available_quantity: number;
2039
+ status: StockStatus;
2040
+ }
2041
+ interface LocationStock {
2042
+ location_id: string;
2043
+ location_name: string;
2044
+ quantity: number;
2045
+ available_quantity: number;
2046
+ status: StockStatus;
2047
+ }
2048
+ interface AvailabilityCheck {
2049
+ product_id: string;
2050
+ variant_id?: string;
2051
+ location_id?: string;
2052
+ requested_quantity: number;
2053
+ }
2054
+ interface AvailabilityResult {
2055
+ product_id: string;
2056
+ variant_id?: string;
2057
+ is_available: boolean;
2058
+ available_quantity: number;
2059
+ requested_quantity: number;
2060
+ shortfall?: number;
2061
+ }
2062
+ interface InventorySummary {
2063
+ total_products: number;
2064
+ in_stock_count: number;
2065
+ low_stock_count: number;
2066
+ out_of_stock_count: number;
2067
+ total_value?: Money;
2068
+ }
2069
+
2070
+ declare class InventoryService {
2071
+ private client;
2072
+ constructor(client: CimplifyClient);
2073
+ getStockLevels(): Promise<StockLevel[]>;
2074
+ getProductStock(productId: string, locationId?: string): Promise<ProductStock>;
2075
+ getVariantStock(variantId: string, locationId?: string): Promise<StockLevel>;
2076
+ checkProductAvailability(productId: string, quantity: number, locationId?: string): Promise<AvailabilityResult>;
2077
+ checkVariantAvailability(variantId: string, quantity: number, locationId?: string): Promise<AvailabilityResult>;
2078
+ checkMultipleAvailability(items: {
2079
+ product_id: string;
2080
+ variant_id?: string;
2081
+ quantity: number;
2082
+ }[], locationId?: string): Promise<AvailabilityResult[]>;
2083
+ getSummary(): Promise<InventorySummary>;
2084
+ isInStock(productId: string, locationId?: string): Promise<boolean>;
2085
+ getAvailableQuantity(productId: string, locationId?: string): Promise<number>;
2086
+ }
2087
+
2088
+ interface ServiceAvailabilityRule {
2089
+ id: string;
2090
+ business_id: string;
2091
+ location_id: string;
2092
+ item_id: string;
2093
+ day_of_week: number;
2094
+ start_time: string;
2095
+ end_time: string;
2096
+ capacity?: number;
2097
+ created_at: string;
2098
+ updated_at: string;
2099
+ metadata?: Record<string, unknown>;
2100
+ }
2101
+ interface ServiceAvailabilityException {
2102
+ id: string;
2103
+ business_id: string;
2104
+ location_id: string;
2105
+ item_id: string;
2106
+ exception_date: string;
2107
+ is_closed: boolean;
2108
+ start_time?: string;
2109
+ end_time?: string;
2110
+ capacity?: number;
2111
+ reason?: string;
2112
+ created_at: string;
2113
+ updated_at: string;
2114
+ metadata?: Record<string, unknown>;
2115
+ }
2116
+ interface StaffAvailabilityRule {
2117
+ id: string;
2118
+ staff_id: string;
2119
+ location_id?: string;
2120
+ day_of_week: number;
2121
+ start_time: string;
2122
+ end_time: string;
2123
+ is_available: boolean;
2124
+ created_at: string;
2125
+ updated_at: string;
2126
+ metadata?: Record<string, unknown>;
2127
+ }
2128
+ interface StaffAvailabilityException {
2129
+ id: string;
2130
+ staff_id: string;
2131
+ location_id?: string;
2132
+ exception_date: string;
2133
+ is_unavailable_all_day: boolean;
2134
+ start_time?: string;
2135
+ end_time?: string;
2136
+ reason?: string;
2137
+ created_at: string;
2138
+ updated_at: string;
2139
+ metadata?: Record<string, unknown>;
2140
+ }
2141
+ interface ResourceAvailabilityRule {
2142
+ id: string;
2143
+ business_id: string;
2144
+ location_id: string;
2145
+ resource_id: string;
2146
+ day_of_week: number;
2147
+ start_time: string;
2148
+ end_time: string;
2149
+ is_available: boolean;
2150
+ created_at: string;
2151
+ updated_at: string;
2152
+ metadata?: Record<string, unknown>;
2153
+ }
2154
+ interface ResourceAvailabilityException {
2155
+ id: string;
2156
+ business_id: string;
2157
+ location_id: string;
2158
+ resource_id: string;
2159
+ exception_date: string;
2160
+ is_unavailable_all_day: boolean;
2161
+ start_time?: string;
2162
+ end_time?: string;
2163
+ reason?: string;
2164
+ created_at: string;
2165
+ updated_at: string;
2166
+ metadata?: Record<string, unknown>;
2167
+ }
2168
+ interface StaffBookingProfile {
2169
+ id: string;
2170
+ staff_id: string;
2171
+ skills?: string[];
2172
+ can_be_booked: boolean;
2173
+ default_service_duration_override?: number;
2174
+ booking_buffer_minutes?: number;
2175
+ max_daily_bookings?: number;
2176
+ preferred_working_hours?: Record<string, unknown>;
2177
+ created_at: string;
2178
+ updated_at: string;
2179
+ metadata?: Record<string, unknown>;
2180
+ }
2181
+ interface ServiceStaffRequirement {
2182
+ id: string;
2183
+ service_item_id: string;
2184
+ role_id?: string;
2185
+ required_skill?: string;
2186
+ number_of_staff: number;
2187
+ specific_staff_assignment_required: boolean;
2188
+ created_at: string;
2189
+ updated_at: string;
2190
+ metadata?: Record<string, unknown>;
2191
+ }
2192
+ interface BookingRequirementOverride {
2193
+ id: string;
2194
+ appointment_id: string;
2195
+ overridden_by: string;
2196
+ reason: string;
2197
+ missing_staff_requirements?: Record<string, unknown>;
2198
+ missing_resource_requirements?: Record<string, unknown>;
2199
+ created_at: string;
2200
+ }
2201
+ interface ResourceType {
2202
+ id: string;
2203
+ business_id: string;
2204
+ name: string;
2205
+ description?: string;
2206
+ created_at: string;
2207
+ updated_at: string;
2208
+ }
2209
+ interface Service {
2210
+ id: string;
2211
+ business_id: string;
2212
+ product_id: string;
2213
+ name: string;
2214
+ description?: string;
2215
+ duration_minutes: number;
2216
+ buffer_before_minutes: number;
2217
+ buffer_after_minutes: number;
2218
+ max_participants: number;
2219
+ price: Money;
2220
+ currency: string;
2221
+ requires_staff: boolean;
2222
+ is_active: boolean;
2223
+ image_url?: string;
2224
+ category_id?: string;
2225
+ metadata?: Record<string, unknown>;
2226
+ }
2227
+ interface ServiceWithStaff extends Service {
2228
+ available_staff: Staff[];
2229
+ }
2230
+ interface Staff {
2231
+ id: string;
2232
+ business_id: string;
2233
+ name: string;
2234
+ email?: string;
2235
+ phone?: string;
2236
+ avatar_url?: string;
2237
+ bio?: string;
2238
+ is_active: boolean;
2239
+ services?: string[];
2240
+ }
2241
+ interface TimeSlot {
2242
+ start_time: string;
2243
+ end_time: string;
2244
+ is_available: boolean;
2245
+ staff_id?: string;
2246
+ staff_name?: string;
2247
+ remaining_capacity?: number;
2248
+ }
2249
+ interface AvailableSlot extends TimeSlot {
2250
+ price?: Money;
2251
+ duration_minutes: number;
2252
+ }
2253
+ interface DayAvailability {
2254
+ date: string;
2255
+ slots: TimeSlot[];
2256
+ is_fully_booked: boolean;
2257
+ }
2258
+ type BookingStatus = "pending" | "confirmed" | "in_progress" | "completed" | "cancelled" | "no_show";
2259
+ interface Booking {
2260
+ id: string;
2261
+ business_id: string;
2262
+ order_id: string;
2263
+ line_item_id: string;
2264
+ service_id: string;
2265
+ service_name: string;
2266
+ customer_id?: string;
2267
+ customer_name?: string;
2268
+ customer_phone?: string;
2269
+ staff_id?: string;
2270
+ staff_name?: string;
2271
+ location_id?: string;
2272
+ location_name?: string;
2273
+ start_time: string;
2274
+ end_time: string;
2275
+ duration_minutes: number;
2276
+ participant_count: number;
2277
+ status: BookingStatus;
2278
+ notes?: string;
2279
+ cancellation_reason?: string;
2280
+ cancelled_at?: string;
2281
+ created_at: string;
2282
+ updated_at: string;
2283
+ }
2284
+ interface BookingWithDetails extends Booking {
2285
+ service: Service;
2286
+ staff?: Staff;
2287
+ }
2288
+ interface GetAvailableSlotsInput {
2289
+ service_id: string;
2290
+ date: string;
2291
+ participant_count?: number;
2292
+ duration_minutes?: number;
2293
+ staff_id?: string;
2294
+ location_id?: string;
2295
+ }
2296
+ interface CheckSlotAvailabilityInput {
2297
+ service_id: string;
2298
+ slot_time: string;
2299
+ duration_minutes?: number;
2300
+ participant_count?: number;
2301
+ staff_id?: string;
2302
+ }
2303
+ interface RescheduleBookingInput {
2304
+ order_id: string;
2305
+ line_item_id: string;
2306
+ new_start_time: string;
2307
+ new_end_time: string;
2308
+ new_staff_id?: string;
2309
+ reason?: string;
2310
+ }
2311
+ interface CancelBookingInput {
2312
+ booking_id: string;
2313
+ reason?: string;
2314
+ }
2315
+ interface ServiceAvailabilityParams {
2316
+ service_id: string;
2317
+ start_date: string;
2318
+ end_date: string;
2319
+ location_id?: string;
2320
+ staff_id?: string;
2321
+ participant_count?: number;
2322
+ }
2323
+ interface ServiceAvailabilityResult {
2324
+ service_id: string;
2325
+ days: DayAvailability[];
2326
+ }
2327
+
2328
+ declare class SchedulingService {
2329
+ private client;
2330
+ constructor(client: CimplifyClient);
2331
+ getServices(): Promise<Service[]>;
2332
+ getService(serviceId: string): Promise<Service>;
2333
+ getAvailableSlots(input: GetAvailableSlotsInput): Promise<AvailableSlot[]>;
2334
+ checkSlotAvailability(input: CheckSlotAvailabilityInput): Promise<{
2335
+ available: boolean;
2336
+ reason?: string;
2337
+ }>;
2338
+ getServiceAvailability(params: ServiceAvailabilityParams): Promise<ServiceAvailabilityResult>;
2339
+ getBooking(bookingId: string): Promise<BookingWithDetails>;
2340
+ getCustomerBookings(): Promise<Booking[]>;
2341
+ getUpcomingBookings(): Promise<Booking[]>;
2342
+ getPastBookings(limit?: number): Promise<Booking[]>;
2343
+ cancelBooking(input: CancelBookingInput): Promise<Booking>;
2344
+ rescheduleBooking(input: RescheduleBookingInput): Promise<Booking>;
2345
+ getNextAvailableSlot(serviceId: string, fromDate?: string): Promise<AvailableSlot | null>;
2346
+ hasAvailabilityOn(serviceId: string, date: string): Promise<boolean>;
2347
+ }
2348
+
2349
+ interface LiteBootstrap {
2350
+ business: Business;
2351
+ location: Location;
2352
+ categories: Category[];
2353
+ table?: TableInfo;
2354
+ cart: Cart | null;
2355
+ currency: string;
2356
+ is_open: boolean;
2357
+ }
2358
+ interface TableInfo {
2359
+ id: string;
2360
+ number: string;
2361
+ location_id: string;
2362
+ capacity?: number;
2363
+ status: "available" | "occupied" | "reserved";
2364
+ current_order_id?: string;
2365
+ }
2366
+ interface KitchenOrderItem {
2367
+ product_id: string;
2368
+ quantity: number;
2369
+ variant_id?: string;
2370
+ modifiers?: string[];
2371
+ notes?: string;
2372
+ }
2373
+ interface KitchenOrderResult {
2374
+ success: boolean;
2375
+ order_id: string;
2376
+ order_number: string;
2377
+ estimated_time_minutes?: number;
2378
+ }
2379
+ declare class LiteService {
2380
+ private client;
2381
+ constructor(client: CimplifyClient);
2382
+ getBootstrap(): Promise<LiteBootstrap>;
2383
+ getTable(tableId: string): Promise<TableInfo>;
2384
+ getTableByNumber(tableNumber: string, locationId?: string): Promise<TableInfo>;
2385
+ sendToKitchen(tableId: string, items: KitchenOrderItem[]): Promise<KitchenOrderResult>;
2386
+ callWaiter(tableId: string, reason?: string): Promise<{
2387
+ success: boolean;
2388
+ }>;
2389
+ requestBill(tableId: string): Promise<{
2390
+ success: boolean;
2391
+ order_id: string;
2392
+ }>;
2393
+ getMenu(): Promise<Product[]>;
2394
+ getMenuByCategory(categoryId: string): Promise<Product[]>;
2395
+ }
2396
+
2397
+ interface CimplifyConfig {
2398
+ publicKey?: string;
2399
+ credentials?: RequestCredentials;
2400
+ }
2401
+ declare class CimplifyClient {
2402
+ private baseUrl;
2403
+ private linkApiUrl;
2404
+ private publicKey;
2405
+ private credentials;
2406
+ private sessionToken;
2407
+ private _catalogue?;
2408
+ private _cart?;
2409
+ private _checkout?;
2410
+ private _orders?;
2411
+ private _link?;
2412
+ private _auth?;
2413
+ private _business?;
2414
+ private _inventory?;
2415
+ private _scheduling?;
2416
+ private _lite?;
2417
+ constructor(config?: CimplifyConfig);
2418
+ getSessionToken(): string | null;
2419
+ setSessionToken(token: string | null): void;
2420
+ clearSession(): void;
2421
+ private loadSessionToken;
2422
+ private saveSessionToken;
2423
+ private getHeaders;
2424
+ private updateSessionFromResponse;
2425
+ query<T = unknown>(query: string, variables?: Record<string, unknown>): Promise<T>;
2426
+ call<T = unknown>(method: string, args?: unknown): Promise<T>;
2427
+ get<T = unknown>(path: string): Promise<T>;
2428
+ post<T = unknown>(path: string, body?: unknown): Promise<T>;
2429
+ delete<T = unknown>(path: string): Promise<T>;
2430
+ linkGet<T = unknown>(path: string): Promise<T>;
2431
+ linkPost<T = unknown>(path: string, body?: unknown): Promise<T>;
2432
+ linkDelete<T = unknown>(path: string): Promise<T>;
2433
+ private handleRestResponse;
2434
+ private handleResponse;
2435
+ get catalogue(): CatalogueQueries;
2436
+ get cart(): CartOperations;
2437
+ get checkout(): CheckoutService;
2438
+ get orders(): OrderQueries;
2439
+ get link(): LinkService;
2440
+ get auth(): AuthService;
2441
+ get business(): BusinessService;
2442
+ get inventory(): InventoryService;
2443
+ get scheduling(): SchedulingService;
2444
+ get lite(): LiteService;
2445
+ }
2446
+ declare function createCimplifyClient(config: CimplifyConfig): CimplifyClient;
2447
+
2448
+ type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
2449
+ type SortOrder = "asc" | "desc";
2450
+ declare class QueryBuilder {
2451
+ private entity;
2452
+ private filters;
2453
+ private modifiers;
2454
+ private pathSegments;
2455
+ constructor(entity: string);
2456
+ path(segment: string): this;
2457
+ where(field: string, op: Operator, value: unknown): this;
2458
+ and(field: string, op: Operator, value: unknown): this;
2459
+ sort(field: string, order?: SortOrder): this;
2460
+ limit(n: number): this;
2461
+ offset(n: number): this;
2462
+ count(): this;
2463
+ enriched(): this;
2464
+ build(): string;
2465
+ toString(): string;
2466
+ }
2467
+ declare function query(entity: string): QueryBuilder;
2468
+
2469
+ declare const CHECKOUT_MODE: {
2470
+ readonly LINK: "link";
2471
+ readonly GUEST: "guest";
2472
+ };
2473
+ declare const ORDER_TYPE: {
2474
+ readonly DELIVERY: "delivery";
2475
+ readonly PICKUP: "pickup";
2476
+ readonly DINE_IN: "dine-in";
2477
+ readonly WALK_IN: "walk-in";
2478
+ };
2479
+ declare const PAYMENT_METHOD: {
2480
+ readonly MOBILE_MONEY: "mobile_money";
2481
+ readonly CARD: "card";
2482
+ };
2483
+ declare const CHECKOUT_STEP: {
2484
+ readonly AUTHENTICATION: "authentication";
2485
+ readonly ORDER_DETAILS: "order_details";
2486
+ readonly PAYMENT_METHOD: "payment_method";
2487
+ readonly PAYMENT: "payment";
2488
+ readonly CONFIRMATION: "confirmation";
2489
+ };
2490
+ declare const PAYMENT_STATE: {
2491
+ readonly INITIAL: "initial";
2492
+ readonly PREPARING: "preparing";
2493
+ readonly PROCESSING: "processing";
2494
+ readonly VERIFYING: "verifying";
2495
+ readonly AWAITING_AUTHORIZATION: "awaiting_authorization";
2496
+ readonly SUCCESS: "success";
2497
+ readonly ERROR: "error";
2498
+ readonly TIMEOUT: "timeout";
2499
+ };
2500
+ declare const PICKUP_TIME_TYPE: {
2501
+ readonly ASAP: "asap";
2502
+ readonly SCHEDULED: "scheduled";
2503
+ };
2504
+ declare const MOBILE_MONEY_PROVIDER: {
2505
+ readonly MTN: "mtn";
2506
+ readonly VODAFONE: "vodafone";
2507
+ readonly AIRTEL: "airtel";
2508
+ };
2509
+ declare const AUTHORIZATION_TYPE: {
2510
+ readonly OTP: "otp";
2511
+ readonly PIN: "pin";
2512
+ readonly PHONE: "phone";
2513
+ readonly BIRTHDAY: "birthday";
2514
+ readonly ADDRESS: "address";
2515
+ };
2516
+ declare const LINK_QUERY: {
2517
+ readonly DATA: "link.data";
2518
+ readonly ADDRESSES: "link.addresses";
2519
+ readonly MOBILE_MONEY: "link.mobile_money";
2520
+ readonly PREFERENCES: "link.preferences";
2521
+ readonly SESSIONS: "link.sessions";
2522
+ };
2523
+ declare const LINK_MUTATION: {
2524
+ readonly CHECK_STATUS: "link.check_status";
2525
+ readonly ENROLL: "link.enroll";
2526
+ readonly ENROLL_AND_LINK_ORDER: "link.enroll_and_link_order";
2527
+ readonly UPDATE_PREFERENCES: "link.update_preferences";
2528
+ readonly CREATE_ADDRESS: "link.create_address";
2529
+ readonly UPDATE_ADDRESS: "link.update_address";
2530
+ readonly DELETE_ADDRESS: "link.delete_address";
2531
+ readonly SET_DEFAULT_ADDRESS: "link.set_default_address";
2532
+ readonly TRACK_ADDRESS_USAGE: "link.track_address_usage";
2533
+ readonly CREATE_MOBILE_MONEY: "link.create_mobile_money";
2534
+ readonly DELETE_MOBILE_MONEY: "link.delete_mobile_money";
2535
+ readonly SET_DEFAULT_MOBILE_MONEY: "link.set_default_mobile_money";
2536
+ readonly TRACK_MOBILE_MONEY_USAGE: "link.track_mobile_money_usage";
2537
+ readonly VERIFY_MOBILE_MONEY: "link.verify_mobile_money";
2538
+ readonly REVOKE_SESSION: "link.revoke_session";
2539
+ readonly REVOKE_ALL_SESSIONS: "link.revoke_all_sessions";
2540
+ };
2541
+ declare const AUTH_MUTATION: {
2542
+ readonly REQUEST_OTP: "auth.request_otp";
2543
+ readonly VERIFY_OTP: "auth.verify_otp";
2544
+ };
2545
+ declare const CHECKOUT_MUTATION: {
2546
+ readonly PROCESS: "checkout.process";
2547
+ };
2548
+ declare const PAYMENT_MUTATION: {
2549
+ readonly SUBMIT_AUTHORIZATION: "payment.submit_authorization";
2550
+ readonly CHECK_STATUS: "order.poll_payment_status";
2551
+ };
2552
+ declare const ORDER_MUTATION: {
2553
+ readonly UPDATE_CUSTOMER: "order.update_order_customer";
2554
+ };
2555
+ declare const DEFAULT_CURRENCY = "GHS";
2556
+ declare const DEFAULT_COUNTRY = "GHA";
2557
+
2558
+ /** Currency symbol mapping */
2559
+ declare const CURRENCY_SYMBOLS: Record<string, string>;
2560
+ /**
2561
+ * Format a money value with currency symbol
2562
+ */
2563
+ declare function formatMoney(amount: string | number, currency?: string): string;
2564
+ /**
2565
+ * Categorize payment errors into user-friendly messages
2566
+ */
2567
+ declare function categorizePaymentError(error: Error, errorCode?: string): PaymentErrorDetails;
2568
+ /**
2569
+ * Normalize payment response from different formats into a standard PaymentResponse
2570
+ */
2571
+ declare function normalizePaymentResponse(response: unknown): PaymentResponse;
2572
+ /**
2573
+ * Normalize payment status response into a standard format
2574
+ */
2575
+ declare function normalizeStatusResponse(response: unknown): PaymentStatusResponse;
2576
+ /** Mobile money provider display names */
2577
+ declare const MOBILE_MONEY_PROVIDERS: {
2578
+ readonly mtn: {
2579
+ readonly name: "MTN Mobile Money";
2580
+ readonly prefix: readonly ["024", "054", "055", "059"];
2581
+ };
2582
+ readonly vodafone: {
2583
+ readonly name: "Vodafone Cash";
2584
+ readonly prefix: readonly ["020", "050"];
2585
+ };
2586
+ readonly airtel: {
2587
+ readonly name: "AirtelTigo Money";
2588
+ readonly prefix: readonly ["027", "057", "026", "056"];
2589
+ };
2590
+ };
2591
+ /**
2592
+ * Detect mobile money provider from phone number
2593
+ */
2594
+ declare function detectMobileMoneyProvider(phoneNumber: string): "mtn" | "vodafone" | "airtel" | null;
2595
+
2596
+ /** Request body for POST /api/q */
2597
+ interface QueryRequest {
2598
+ query: string;
2599
+ variables?: Record<string, unknown>;
2600
+ cache_hint?: string;
2601
+ }
2602
+ /** Request body for POST /api/m */
2603
+ interface MutationRequest {
2604
+ method: string;
2605
+ args: unknown[];
2606
+ }
2607
+ /** Response metadata */
2608
+ interface ResponseMetadata {
2609
+ execution_time_ms: number;
2610
+ cache_hit: boolean;
2611
+ }
2612
+ /** Standard API response wrapper */
2613
+ interface ApiResponse<T> {
2614
+ success: boolean;
2615
+ data?: T;
2616
+ error?: ApiError;
2617
+ metadata?: ResponseMetadata;
2618
+ }
2619
+
2620
+ export { AUTHORIZATION_TYPE, AUTH_MUTATION, type AddOn, type AddOnDetails, type AddOnGroupDetails, type AddOnOption, type AddOnOptionDetails, type AddOnOptionPrice, type AddOnWithOptions, type AddToCartInput, type AddressData, type AdjustmentType, type AmountToPay, type ApiError, type ApiResponse, type AppliedDiscount, type AuthResponse, AuthService, type AuthStatus, type AuthorizationType, type AvailabilityCheck, type AvailabilityResult, type AvailableSlot, type BenefitType, type Booking, type BookingRequirementOverride, type BookingStatus, type BookingWithDetails, type BufferTimes, type Bundle, type BundleComponentData, type BundleComponentInfo, type BundlePriceType, type BundleProduct, type BundleSelectionData, type BundleSelectionInput, type BundleStoredSelection, type BundleSummary, type BundleWithDetails, type Business, type BusinessHours, type BusinessPreferences, BusinessService, type BusinessSettings, type BusinessType, type BusinessWithLocations, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_STEP, CURRENCY_SYMBOLS, type CancelBookingInput, type CancelOrderInput, type CancellationPolicy, type Cart, type CartAddOn, type CartChannel, type CartItem, type CartItemDetails, CartOperations, type CartStatus, type CartSummary, type CartTotals, CatalogueQueries, type Category, type CategoryInfo, type CategorySummary, type ChangePasswordInput, type CheckSlotAvailabilityInput, type CheckoutAddressInfo, type CheckoutCustomerInfo, type CheckoutFormData, type CheckoutInput, type CheckoutMode, CheckoutService as CheckoutOperations, type CheckoutOrderType, type CheckoutPaymentMethod, type CheckoutResult, CheckoutService, type CheckoutStep, type ChosenPrice, CimplifyClient, type CimplifyConfig, CimplifyError, type Collection, type CollectionProduct, type CollectionSummary, type ComponentGroup, type ComponentGroupWithComponents, type ComponentPriceBreakdown, type ComponentSelectionInput, type ComponentSourceType, type Composite, type CompositeComponent, type CompositePriceBreakdown, type CompositePriceResult, type CompositePricingMode, type CompositeSelectionData, type ComponentSelectionInput as CompositeSelectionInput, type CompositeStoredSelection, type CompositeWithDetails, type ContactType, type CreateAddressInput, type CreateMobileMoneyInput, type Currency, type Customer, type CustomerAddress, type CustomerLinkPreferences, type CustomerMobileMoney, type CustomerServicePreferences, DEFAULT_COUNTRY, DEFAULT_CURRENCY, type DayAvailability, type DepositResult, type DepositType, type DeviceType, type DigitalProductType, type DiscountBreakdown, type DiscountDetails, type DisplayAddOn, type DisplayAddOnOption, type DisplayCart, type DisplayCartItem, type EnrollAndLinkOrderInput, type EnrollAndLinkOrderResult, type EnrollmentData, type FeeBearerType, type FulfillmentLink, type FulfillmentStatus, type FulfillmentType, type GetAvailableSlotsInput, type GetOrdersOptions, type GetProductsOptions, type GroupPricingBehavior, type InitializePaymentResult, InventoryService, type InventorySummary, type InventoryType, type KitchenOrderItem, type KitchenOrderResult, LINK_MUTATION, LINK_QUERY, type LineConfiguration, type LineItem, type LineType, type LinkData, type LinkEnrollResult, LinkService, type LinkSession, type LinkStatusResult, type LiteBootstrap, LiteService, type Location, type LocationAppointment, type LocationProductPrice, type LocationStock, type LocationTaxBehavior, type LocationTaxOverrides, type LocationTimeProfile, type LocationWithDetails, MOBILE_MONEY_PROVIDER, MOBILE_MONEY_PROVIDERS, type MobileMoneyData, type MobileMoneyDetails, type MobileMoneyProvider, type Money, type MutationRequest, ORDER_MUTATION, ORDER_TYPE, type Order, type OrderChannel, type OrderFilter, type OrderFulfillmentSummary, type OrderGroup, type OrderGroupDetails, type OrderGroupPayment, type OrderGroupPaymentState, type OrderGroupPaymentSummary, type OrderHistory, type OrderLineState, type OrderLineStatus, type OrderPaymentEvent, OrderQueries, type OrderSplitDetail, type OrderStatus, type OtpResult, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, type Pagination, type PaginationParams, type Payment, type PaymentErrorDetails, type PaymentMethod, type PaymentMethodType, type PaymentProcessingState, type PaymentProvider, type PaymentResponse, type PaymentState, type PaymentStatus, type PaymentStatusResponse, type PickupTime, type PickupTimeType, type Price, type PriceAdjustment, type PriceDecisionPath, type PriceEntryType, type PricePathTaxInfo, type PriceSource, type PricingOverrides, type Product, type ProductAddOn, type ProductAvailability, type ProductStock, type ProductTimeProfile, type ProductType, type ProductVariant, type ProductVariantValue, type ProductWithDetails, QueryBuilder, type QueryRequest, type RefundOrderInput, type ReminderMethod, type ReminderSettings, type RequestOtpInput, type RescheduleBookingInput, type ResourceAssignment, type ResourceAvailabilityException, type ResourceAvailabilityRule, type ResourceType, type ResponseMetadata, type RevokeAllSessionsResult, type RevokeSessionResult, type Room, type SalesChannel, type SchedulingMetadata, type SchedulingResult, SchedulingService, type SearchOptions, type SelectedAddOnOption, type Service, type ServiceAvailabilityException, type ServiceAvailabilityParams, type ServiceAvailabilityResult, type ServiceAvailabilityRule, type ServiceCharge, type ServiceNotes, type ServiceScheduleRequest, type ServiceStaffRequirement, type ServiceStatus, type ServiceWithStaff, type Staff, type StaffAssignment, type StaffAvailabilityException, type StaffAvailabilityRule, type StaffBookingProfile, type StaffRole, type StaffScheduleItem, type Stock, type StockLevel, type StockOwnershipType, type StockStatus, type StorefrontBootstrap, type SubmitAuthorizationInput, type Table, type TableInfo, type TaxPathComponent, type TimeRange, type TimeRanges, type TimeSlot, type UICart, type UICartBusiness, type UICartCustomer, type UICartLocation, type UICartPricing, type UpdateAddressInput, type UpdateCartItemInput, type UpdateOrderStatusInput, type UpdateProfileInput, type VariantAxis, type VariantAxisSelection, type VariantAxisValue, type VariantAxisWithValues, type VariantDetails, type VariantDetailsDTO, type VariantDisplayAttribute, type VariantLocationAvailability, type VariantStock, type VariantStrategy, type VerifyOtpInput, categorizePaymentError, createCimplifyClient, detectMobileMoneyProvider, formatMoney, normalizePaymentResponse, normalizeStatusResponse, query };