@cimplify/sdk 0.6.0 → 0.6.2

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/README.md CHANGED
@@ -29,6 +29,11 @@ await cimplify.cart.addItem({ item_id: "product-id", quantity: 1 });
29
29
  const cart = await cimplify.cart.get();
30
30
  ```
31
31
 
32
+ ## Pricing Guide
33
+
34
+ - See `./sdk-pricing-flow.md` for the quote-first pricing flow and end-to-end examples.
35
+ - Runtime backend contract: `../../src/salesman/pricing-contract.md` (quote/recompute behavior and channel mapping).
36
+
32
37
  ## Services
33
38
 
34
39
  ### Catalogue
@@ -628,221 +628,6 @@ interface ProductTimeProfile {
628
628
  metadata?: Record<string, unknown>;
629
629
  }
630
630
 
631
- /**
632
- * A Result type that makes errors explicit in the type system.
633
- * Inspired by Rust's Result and fp-ts Either.
634
- *
635
- * @example
636
- * ```typescript
637
- * const result = await client.cart.addItemSafe({ item_id: "prod_123" });
638
- *
639
- * if (result.ok) {
640
- * console.log(result.value); // Cart
641
- * } else {
642
- * console.log(result.error); // CimplifyError
643
- * }
644
- * ```
645
- */
646
- type Result<T, E = Error> = Ok<T> | Err<E>;
647
- interface Ok<T> {
648
- readonly ok: true;
649
- readonly value: T;
650
- }
651
- interface Err<E> {
652
- readonly ok: false;
653
- readonly error: E;
654
- }
655
- /** Create a successful Result */
656
- declare function ok<T>(value: T): Ok<T>;
657
- /** Create a failed Result */
658
- declare function err<E>(error: E): Err<E>;
659
- /** Check if Result is Ok */
660
- declare function isOk<T, E>(result: Result<T, E>): result is Ok<T>;
661
- /** Check if Result is Err */
662
- declare function isErr<T, E>(result: Result<T, E>): result is Err<E>;
663
- /**
664
- * Transform the success value of a Result.
665
- *
666
- * @example
667
- * ```typescript
668
- * const result = ok(5);
669
- * const doubled = mapResult(result, (n) => n * 2);
670
- * // doubled = { ok: true, value: 10 }
671
- * ```
672
- */
673
- declare function mapResult<T, U, E>(result: Result<T, E>, fn: (value: T) => U): Result<U, E>;
674
- /**
675
- * Transform the error value of a Result.
676
- *
677
- * @example
678
- * ```typescript
679
- * const result = err(new Error("oops"));
680
- * const mapped = mapError(result, (e) => new CustomError(e.message));
681
- * ```
682
- */
683
- declare function mapError<T, E, F>(result: Result<T, E>, fn: (error: E) => F): Result<T, F>;
684
- /**
685
- * Chain Results together. If the first Result is Ok, apply the function.
686
- * If it's Err, propagate the error.
687
- *
688
- * @example
689
- * ```typescript
690
- * const getUser = (id: string): Result<User, Error> => { ... }
691
- * const getOrders = (user: User): Result<Order[], Error> => { ... }
692
- *
693
- * const result = flatMap(getUser("123"), (user) => getOrders(user));
694
- * ```
695
- */
696
- declare function flatMap<T, U, E>(result: Result<T, E>, fn: (value: T) => Result<U, E>): Result<U, E>;
697
- /**
698
- * Get the value or a default if the Result is Err.
699
- *
700
- * @example
701
- * ```typescript
702
- * const result = err(new Error("failed"));
703
- * const value = getOrElse(result, () => defaultCart);
704
- * ```
705
- */
706
- declare function getOrElse<T, E>(result: Result<T, E>, defaultFn: () => T): T;
707
- /**
708
- * Get the value or throw the error.
709
- * Use sparingly - defeats the purpose of Result!
710
- *
711
- * @example
712
- * ```typescript
713
- * const cart = unwrap(result); // throws if Err
714
- * ```
715
- */
716
- declare function unwrap<T, E>(result: Result<T, E>): T;
717
- /**
718
- * Get the value or undefined if Err.
719
- *
720
- * @example
721
- * ```typescript
722
- * const cart = toNullable(result); // Cart | undefined
723
- * ```
724
- */
725
- declare function toNullable<T, E>(result: Result<T, E>): T | undefined;
726
- /**
727
- * Convert a Promise that might throw into a Result.
728
- *
729
- * @example
730
- * ```typescript
731
- * const result = await fromPromise(
732
- * fetch("/api/data"),
733
- * (error) => new NetworkError(error.message)
734
- * );
735
- * ```
736
- */
737
- declare function fromPromise<T, E>(promise: Promise<T>, mapError: (error: unknown) => E): Promise<Result<T, E>>;
738
- /**
739
- * Convert a function that might throw into one that returns Result.
740
- *
741
- * @example
742
- * ```typescript
743
- * const safeParse = tryCatch(
744
- * () => JSON.parse(input),
745
- * (e) => new ParseError(e.message)
746
- * );
747
- * ```
748
- */
749
- declare function tryCatch<T, E>(fn: () => T, mapError: (error: unknown) => E): Result<T, E>;
750
- /**
751
- * Combine multiple Results. Returns Ok with array of values if all succeed,
752
- * or the first Err encountered.
753
- *
754
- * @example
755
- * ```typescript
756
- * const results = await Promise.all([
757
- * client.cart.getSafe(),
758
- * client.business.getSafe(),
759
- * ]);
760
- * const combined = combine(results);
761
- * // Result<[Cart, Business], CimplifyError>
762
- * ```
763
- */
764
- declare function combine<T, E>(results: Result<T, E>[]): Result<T[], E>;
765
- /**
766
- * Like combine, but for an object of Results.
767
- *
768
- * @example
769
- * ```typescript
770
- * const data = combineObject({
771
- * cart: await client.cart.getSafe(),
772
- * business: await client.business.getSafe(),
773
- * });
774
- * // Result<{ cart: Cart, business: Business }, CimplifyError>
775
- * ```
776
- */
777
- declare function combineObject<T extends Record<string, Result<unknown, unknown>>>(results: T): Result<{
778
- [K in keyof T]: T[K] extends Result<infer V, unknown> ? V : never;
779
- }, T[keyof T] extends Result<unknown, infer E> ? E : never>;
780
-
781
- interface GetProductsOptions {
782
- category?: string;
783
- collection?: string;
784
- search?: string;
785
- limit?: number;
786
- offset?: number;
787
- tags?: string[];
788
- featured?: boolean;
789
- in_stock?: boolean;
790
- min_price?: number;
791
- max_price?: number;
792
- sort_by?: "name" | "price" | "created_at";
793
- sort_order?: "asc" | "desc";
794
- }
795
- interface SearchOptions {
796
- limit?: number;
797
- category?: string;
798
- }
799
- declare class CatalogueQueries {
800
- private client;
801
- constructor(client: CimplifyClient);
802
- getProducts(options?: GetProductsOptions): Promise<Result<Product[], CimplifyError>>;
803
- getProduct(id: string): Promise<Result<ProductWithDetails, CimplifyError>>;
804
- getProductBySlug(slug: string): Promise<Result<ProductWithDetails, CimplifyError>>;
805
- getVariants(productId: string): Promise<Result<ProductVariant[], CimplifyError>>;
806
- getVariantAxes(productId: string): Promise<Result<VariantAxis[], CimplifyError>>;
807
- /**
808
- * Find a variant by axis selections (e.g., { "Size": "Large", "Color": "Red" })
809
- * Returns the matching variant or null if no match found.
810
- */
811
- getVariantByAxisSelections(productId: string, selections: VariantAxisSelection): Promise<Result<ProductVariant | null, CimplifyError>>;
812
- /**
813
- * Get a specific variant by its ID
814
- */
815
- getVariantById(productId: string, variantId: string): Promise<Result<ProductVariant, CimplifyError>>;
816
- getAddOns(productId: string): Promise<Result<AddOn[], CimplifyError>>;
817
- getCategories(): Promise<Result<Category[], CimplifyError>>;
818
- getCategory(id: string): Promise<Result<Category, CimplifyError>>;
819
- getCategoryBySlug(slug: string): Promise<Result<Category, CimplifyError>>;
820
- getCategoryProducts(categoryId: string): Promise<Result<Product[], CimplifyError>>;
821
- getCollections(): Promise<Result<Collection[], CimplifyError>>;
822
- getCollection(id: string): Promise<Result<Collection, CimplifyError>>;
823
- getCollectionBySlug(slug: string): Promise<Result<Collection, CimplifyError>>;
824
- getCollectionProducts(collectionId: string): Promise<Result<Product[], CimplifyError>>;
825
- searchCollections(query: string, limit?: number): Promise<Result<Collection[], CimplifyError>>;
826
- getBundles(): Promise<Result<Bundle[], CimplifyError>>;
827
- getBundle(id: string): Promise<Result<BundleWithDetails, CimplifyError>>;
828
- getBundleBySlug(slug: string): Promise<Result<BundleWithDetails, CimplifyError>>;
829
- searchBundles(query: string, limit?: number): Promise<Result<Bundle[], CimplifyError>>;
830
- getComposites(options?: {
831
- limit?: number;
832
- }): Promise<Result<Composite[], CimplifyError>>;
833
- getComposite(id: string): Promise<Result<CompositeWithDetails, CimplifyError>>;
834
- getCompositeByProductId(productId: string): Promise<Result<CompositeWithDetails, CimplifyError>>;
835
- calculateCompositePrice(compositeId: string, selections: ComponentSelectionInput[], locationId?: string): Promise<Result<CompositePriceResult, CimplifyError>>;
836
- search(query: string, options?: SearchOptions): Promise<Result<Product[], CimplifyError>>;
837
- searchProducts(query: string, options?: SearchOptions): Promise<Result<Product[], CimplifyError>>;
838
- getMenu(options?: {
839
- category?: string;
840
- limit?: number;
841
- }): Promise<Result<Product[], CimplifyError>>;
842
- getMenuCategory(categoryId: string): Promise<Result<Product[], CimplifyError>>;
843
- getMenuItem(itemId: string): Promise<Result<ProductWithDetails, CimplifyError>>;
844
- }
845
-
846
631
  type CartStatus = "active" | "converting" | "converted" | "expired" | "abandoned";
847
632
  type CartChannel = "qr" | "taker" | "staff" | "web" | "dashboard";
848
633
  type PriceSource = {
@@ -1284,10 +1069,17 @@ interface UICart {
1284
1069
  pricing: UICartPricing;
1285
1070
  metadata?: Record<string, unknown>;
1286
1071
  }
1072
+ /** Envelope returned by cart#enriched query */
1073
+ interface UICartResponse {
1074
+ cart: UICart;
1075
+ cart_count: number;
1076
+ message?: string | null;
1077
+ }
1287
1078
  interface AddToCartInput {
1288
1079
  item_id: string;
1289
1080
  quantity?: number;
1290
1081
  variant_id?: string;
1082
+ quote_id?: string;
1291
1083
  add_on_options?: string[];
1292
1084
  special_instructions?: string;
1293
1085
  bundle_selections?: BundleSelectionInput[];
@@ -1317,6 +1109,295 @@ interface CartSummary {
1317
1109
  currency: string;
1318
1110
  }
1319
1111
 
1112
+ /**
1113
+ * A Result type that makes errors explicit in the type system.
1114
+ * Inspired by Rust's Result and fp-ts Either.
1115
+ *
1116
+ * @example
1117
+ * ```typescript
1118
+ * const result = await client.cart.addItemSafe({ item_id: "prod_123" });
1119
+ *
1120
+ * if (result.ok) {
1121
+ * console.log(result.value); // Cart
1122
+ * } else {
1123
+ * console.log(result.error); // CimplifyError
1124
+ * }
1125
+ * ```
1126
+ */
1127
+ type Result<T, E = Error> = Ok<T> | Err<E>;
1128
+ interface Ok<T> {
1129
+ readonly ok: true;
1130
+ readonly value: T;
1131
+ }
1132
+ interface Err<E> {
1133
+ readonly ok: false;
1134
+ readonly error: E;
1135
+ }
1136
+ /** Create a successful Result */
1137
+ declare function ok<T>(value: T): Ok<T>;
1138
+ /** Create a failed Result */
1139
+ declare function err<E>(error: E): Err<E>;
1140
+ /** Check if Result is Ok */
1141
+ declare function isOk<T, E>(result: Result<T, E>): result is Ok<T>;
1142
+ /** Check if Result is Err */
1143
+ declare function isErr<T, E>(result: Result<T, E>): result is Err<E>;
1144
+ /**
1145
+ * Transform the success value of a Result.
1146
+ *
1147
+ * @example
1148
+ * ```typescript
1149
+ * const result = ok(5);
1150
+ * const doubled = mapResult(result, (n) => n * 2);
1151
+ * // doubled = { ok: true, value: 10 }
1152
+ * ```
1153
+ */
1154
+ declare function mapResult<T, U, E>(result: Result<T, E>, fn: (value: T) => U): Result<U, E>;
1155
+ /**
1156
+ * Transform the error value of a Result.
1157
+ *
1158
+ * @example
1159
+ * ```typescript
1160
+ * const result = err(new Error("oops"));
1161
+ * const mapped = mapError(result, (e) => new CustomError(e.message));
1162
+ * ```
1163
+ */
1164
+ declare function mapError<T, E, F>(result: Result<T, E>, fn: (error: E) => F): Result<T, F>;
1165
+ /**
1166
+ * Chain Results together. If the first Result is Ok, apply the function.
1167
+ * If it's Err, propagate the error.
1168
+ *
1169
+ * @example
1170
+ * ```typescript
1171
+ * const getUser = (id: string): Result<User, Error> => { ... }
1172
+ * const getOrders = (user: User): Result<Order[], Error> => { ... }
1173
+ *
1174
+ * const result = flatMap(getUser("123"), (user) => getOrders(user));
1175
+ * ```
1176
+ */
1177
+ declare function flatMap<T, U, E>(result: Result<T, E>, fn: (value: T) => Result<U, E>): Result<U, E>;
1178
+ /**
1179
+ * Get the value or a default if the Result is Err.
1180
+ *
1181
+ * @example
1182
+ * ```typescript
1183
+ * const result = err(new Error("failed"));
1184
+ * const value = getOrElse(result, () => defaultCart);
1185
+ * ```
1186
+ */
1187
+ declare function getOrElse<T, E>(result: Result<T, E>, defaultFn: () => T): T;
1188
+ /**
1189
+ * Get the value or throw the error.
1190
+ * Use sparingly - defeats the purpose of Result!
1191
+ *
1192
+ * @example
1193
+ * ```typescript
1194
+ * const cart = unwrap(result); // throws if Err
1195
+ * ```
1196
+ */
1197
+ declare function unwrap<T, E>(result: Result<T, E>): T;
1198
+ /**
1199
+ * Get the value or undefined if Err.
1200
+ *
1201
+ * @example
1202
+ * ```typescript
1203
+ * const cart = toNullable(result); // Cart | undefined
1204
+ * ```
1205
+ */
1206
+ declare function toNullable<T, E>(result: Result<T, E>): T | undefined;
1207
+ /**
1208
+ * Convert a Promise that might throw into a Result.
1209
+ *
1210
+ * @example
1211
+ * ```typescript
1212
+ * const result = await fromPromise(
1213
+ * fetch("/api/data"),
1214
+ * (error) => new NetworkError(error.message)
1215
+ * );
1216
+ * ```
1217
+ */
1218
+ declare function fromPromise<T, E>(promise: Promise<T>, mapError: (error: unknown) => E): Promise<Result<T, E>>;
1219
+ /**
1220
+ * Convert a function that might throw into one that returns Result.
1221
+ *
1222
+ * @example
1223
+ * ```typescript
1224
+ * const safeParse = tryCatch(
1225
+ * () => JSON.parse(input),
1226
+ * (e) => new ParseError(e.message)
1227
+ * );
1228
+ * ```
1229
+ */
1230
+ declare function tryCatch<T, E>(fn: () => T, mapError: (error: unknown) => E): Result<T, E>;
1231
+ /**
1232
+ * Combine multiple Results. Returns Ok with array of values if all succeed,
1233
+ * or the first Err encountered.
1234
+ *
1235
+ * @example
1236
+ * ```typescript
1237
+ * const results = await Promise.all([
1238
+ * client.cart.getSafe(),
1239
+ * client.business.getSafe(),
1240
+ * ]);
1241
+ * const combined = combine(results);
1242
+ * // Result<[Cart, Business], CimplifyError>
1243
+ * ```
1244
+ */
1245
+ declare function combine<T, E>(results: Result<T, E>[]): Result<T[], E>;
1246
+ /**
1247
+ * Like combine, but for an object of Results.
1248
+ *
1249
+ * @example
1250
+ * ```typescript
1251
+ * const data = combineObject({
1252
+ * cart: await client.cart.getSafe(),
1253
+ * business: await client.business.getSafe(),
1254
+ * });
1255
+ * // Result<{ cart: Cart, business: Business }, CimplifyError>
1256
+ * ```
1257
+ */
1258
+ declare function combineObject<T extends Record<string, Result<unknown, unknown>>>(results: T): Result<{
1259
+ [K in keyof T]: T[K] extends Result<infer V, unknown> ? V : never;
1260
+ }, T[keyof T] extends Result<unknown, infer E> ? E : never>;
1261
+
1262
+ interface GetProductsOptions {
1263
+ category?: string;
1264
+ collection?: string;
1265
+ search?: string;
1266
+ limit?: number;
1267
+ offset?: number;
1268
+ tags?: string[];
1269
+ featured?: boolean;
1270
+ in_stock?: boolean;
1271
+ min_price?: number;
1272
+ max_price?: number;
1273
+ sort_by?: "name" | "price" | "created_at";
1274
+ sort_order?: "asc" | "desc";
1275
+ }
1276
+ interface SearchOptions {
1277
+ limit?: number;
1278
+ category?: string;
1279
+ }
1280
+ interface QuoteCompositeSelectionInput {
1281
+ component_id: string;
1282
+ quantity: number;
1283
+ variant_id?: string;
1284
+ add_on_option_id?: string;
1285
+ }
1286
+ interface QuoteBundleSelectionInput {
1287
+ component_id: string;
1288
+ quantity: number;
1289
+ variant_id?: string;
1290
+ }
1291
+ interface FetchQuoteInput {
1292
+ product_id: string;
1293
+ variant_id?: string;
1294
+ location_id?: string;
1295
+ quantity?: number;
1296
+ add_on_option_ids?: string[];
1297
+ bundle_selections?: QuoteBundleSelectionInput[];
1298
+ composite_selections?: QuoteCompositeSelectionInput[];
1299
+ }
1300
+ interface RefreshQuoteInput {
1301
+ quote_id: string;
1302
+ product_id?: string;
1303
+ variant_id?: string;
1304
+ location_id?: string;
1305
+ quantity?: number;
1306
+ add_on_option_ids?: string[];
1307
+ bundle_selections?: QuoteBundleSelectionInput[];
1308
+ composite_selections?: QuoteCompositeSelectionInput[];
1309
+ }
1310
+ type QuoteStatus = "pending" | "used" | "expired";
1311
+ interface QuoteDynamicBuckets {
1312
+ intent: string;
1313
+ demand: string;
1314
+ inventory: string;
1315
+ competition?: string;
1316
+ }
1317
+ interface QuoteUiMessage {
1318
+ code: string;
1319
+ level: "info" | "warn" | "error" | string;
1320
+ text: string;
1321
+ countdown_seconds?: number;
1322
+ }
1323
+ interface PriceQuote {
1324
+ quote_id: string;
1325
+ business_id: string;
1326
+ product_id: string;
1327
+ variant_id?: string;
1328
+ location_id?: string;
1329
+ source: string;
1330
+ quantity: number;
1331
+ currency?: string;
1332
+ item_price_info: ChosenPrice;
1333
+ variant_price_info?: ChosenPrice;
1334
+ final_price_info: ChosenPrice;
1335
+ add_on_option_ids: string[];
1336
+ bundle_selections?: QuoteBundleSelectionInput[];
1337
+ add_ons_price_info?: ChosenPrice;
1338
+ quoted_total_price_info?: ChosenPrice;
1339
+ composite_selections?: QuoteCompositeSelectionInput[];
1340
+ dynamic_buckets: QuoteDynamicBuckets;
1341
+ ui_messages: QuoteUiMessage[];
1342
+ created_at: string;
1343
+ expires_at: string;
1344
+ next_change_at?: string;
1345
+ status: QuoteStatus;
1346
+ }
1347
+ interface RefreshQuoteResult {
1348
+ previous_quote_id: string;
1349
+ quote: PriceQuote;
1350
+ }
1351
+ declare class CatalogueQueries {
1352
+ private client;
1353
+ constructor(client: CimplifyClient);
1354
+ getProducts(options?: GetProductsOptions): Promise<Result<Product[], CimplifyError>>;
1355
+ getProduct(id: string): Promise<Result<ProductWithDetails, CimplifyError>>;
1356
+ getProductBySlug(slug: string): Promise<Result<ProductWithDetails, CimplifyError>>;
1357
+ getVariants(productId: string): Promise<Result<ProductVariant[], CimplifyError>>;
1358
+ getVariantAxes(productId: string): Promise<Result<VariantAxis[], CimplifyError>>;
1359
+ /**
1360
+ * Find a variant by axis selections (e.g., { "Size": "Large", "Color": "Red" })
1361
+ * Returns the matching variant or null if no match found.
1362
+ */
1363
+ getVariantByAxisSelections(productId: string, selections: VariantAxisSelection): Promise<Result<ProductVariant | null, CimplifyError>>;
1364
+ /**
1365
+ * Get a specific variant by its ID
1366
+ */
1367
+ getVariantById(productId: string, variantId: string): Promise<Result<ProductVariant, CimplifyError>>;
1368
+ getAddOns(productId: string): Promise<Result<AddOn[], CimplifyError>>;
1369
+ getCategories(): Promise<Result<Category[], CimplifyError>>;
1370
+ getCategory(id: string): Promise<Result<Category, CimplifyError>>;
1371
+ getCategoryBySlug(slug: string): Promise<Result<Category, CimplifyError>>;
1372
+ getCategoryProducts(categoryId: string): Promise<Result<Product[], CimplifyError>>;
1373
+ getCollections(): Promise<Result<Collection[], CimplifyError>>;
1374
+ getCollection(id: string): Promise<Result<Collection, CimplifyError>>;
1375
+ getCollectionBySlug(slug: string): Promise<Result<Collection, CimplifyError>>;
1376
+ getCollectionProducts(collectionId: string): Promise<Result<Product[], CimplifyError>>;
1377
+ searchCollections(query: string, limit?: number): Promise<Result<Collection[], CimplifyError>>;
1378
+ getBundles(): Promise<Result<Bundle[], CimplifyError>>;
1379
+ getBundle(id: string): Promise<Result<BundleWithDetails, CimplifyError>>;
1380
+ getBundleBySlug(slug: string): Promise<Result<BundleWithDetails, CimplifyError>>;
1381
+ searchBundles(query: string, limit?: number): Promise<Result<Bundle[], CimplifyError>>;
1382
+ getComposites(options?: {
1383
+ limit?: number;
1384
+ }): Promise<Result<Composite[], CimplifyError>>;
1385
+ getComposite(id: string): Promise<Result<CompositeWithDetails, CimplifyError>>;
1386
+ getCompositeByProductId(productId: string): Promise<Result<CompositeWithDetails, CimplifyError>>;
1387
+ calculateCompositePrice(compositeId: string, selections: ComponentSelectionInput[], locationId?: string): Promise<Result<CompositePriceResult, CimplifyError>>;
1388
+ fetchQuote(input: FetchQuoteInput): Promise<Result<PriceQuote, CimplifyError>>;
1389
+ getQuote(quoteId: string): Promise<Result<PriceQuote, CimplifyError>>;
1390
+ refreshQuote(input: RefreshQuoteInput): Promise<Result<RefreshQuoteResult, CimplifyError>>;
1391
+ search(query: string, options?: SearchOptions): Promise<Result<Product[], CimplifyError>>;
1392
+ searchProducts(query: string, options?: SearchOptions): Promise<Result<Product[], CimplifyError>>;
1393
+ getMenu(options?: {
1394
+ category?: string;
1395
+ limit?: number;
1396
+ }): Promise<Result<Product[], CimplifyError>>;
1397
+ getMenuCategory(categoryId: string): Promise<Result<Product[], CimplifyError>>;
1398
+ getMenuItem(itemId: string): Promise<Result<ProductWithDetails, CimplifyError>>;
1399
+ }
1400
+
1320
1401
  declare class CartOperations {
1321
1402
  private client;
1322
1403
  constructor(client: CimplifyClient);
@@ -1694,7 +1775,7 @@ interface LocationAppointment {
1694
1775
  service_status: ServiceStatus;
1695
1776
  }
1696
1777
 
1697
- type PaymentStatus = "pending" | "processing" | "success" | "failed" | "refunded" | "captured" | "cancelled";
1778
+ type PaymentStatus = "pending" | "processing" | "created" | "pending_confirmation" | "success" | "succeeded" | "failed" | "declined" | "authorized" | "refunded" | "partially_refunded" | "partially_paid" | "paid" | "unpaid" | "requires_action" | "requires_payment_method" | "requires_capture" | "captured" | "cancelled" | "completed" | "voided" | "error" | "unknown";
1698
1779
  type PaymentProvider = "stripe" | "paystack" | "mtn" | "vodafone" | "airtel" | "cellulant" | "offline" | "cash" | "manual";
1699
1780
  type PaymentMethodType = "card" | "mobile_money" | "bank_transfer" | "cash" | "custom";
1700
1781
  /** Authorization types for payment verification (OTP, PIN, etc.) */
@@ -1751,7 +1832,7 @@ interface PaymentResponse {
1751
1832
  }
1752
1833
  /** Payment status polling response */
1753
1834
  interface PaymentStatusResponse {
1754
- status: "pending" | "processing" | "success" | "failed";
1835
+ status: PaymentStatus;
1755
1836
  paid: boolean;
1756
1837
  amount?: Money;
1757
1838
  currency?: string;
@@ -3241,4 +3322,4 @@ interface AdContextValue {
3241
3322
  isLoading: boolean;
3242
3323
  }
3243
3324
 
3244
- export { PAYMENT_STATE as $, type ApiError as A, BusinessService as B, CimplifyClient as C, type CheckoutOrderType as D, EVENT_TYPES as E, FxService as F, type GetProductsOptions as G, type CheckoutPaymentMethod as H, InventoryService as I, type CheckoutStep as J, type KitchenOrderItem as K, LinkService as L, MESSAGE_TYPES as M, type CheckoutFormData as N, OrderQueries as O, type PaymentErrorDetails as P, type CheckoutResult as Q, type MobileMoneyProvider as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type DeviceType as V, type ContactType as W, CHECKOUT_MODE as X, ORDER_TYPE as Y, PAYMENT_METHOD as Z, CHECKOUT_STEP as _, type PaymentResponse as a, type CollectionSummary as a$, PICKUP_TIME_TYPE as a0, MOBILE_MONEY_PROVIDER as a1, AUTHORIZATION_TYPE as a2, DEVICE_TYPE as a3, CONTACT_TYPE as a4, LINK_QUERY as a5, LINK_MUTATION as a6, AUTH_MUTATION as a7, CHECKOUT_MUTATION as a8, PAYMENT_MUTATION as a9, tryCatch as aA, combine as aB, combineObject as aC, type ProductType as aD, type InventoryType as aE, type VariantStrategy as aF, type DigitalProductType as aG, type DepositType as aH, type SalesChannel as aI, type Product as aJ, type ProductWithDetails as aK, type ProductVariant as aL, type VariantDisplayAttribute as aM, type VariantAxis as aN, type VariantAxisWithValues as aO, type VariantAxisValue as aP, type ProductVariantValue as aQ, type VariantLocationAvailability as aR, type VariantAxisSelection as aS, type AddOn as aT, type AddOnWithOptions as aU, type AddOnOption as aV, type AddOnOptionPrice as aW, type ProductAddOn as aX, type Category as aY, type CategorySummary as aZ, type Collection as a_, ORDER_MUTATION as aa, DEFAULT_CURRENCY as ab, DEFAULT_COUNTRY as ac, type Money as ad, type Currency as ae, type PaginationParams as af, type Pagination as ag, ErrorCode as ah, type ErrorCodeType as ai, CimplifyError as aj, isCimplifyError as ak, isRetryableError as al, type Result as am, type Ok as an, type Err as ao, ok as ap, err as aq, isOk as ar, isErr as as, mapResult as at, mapError as au, flatMap as av, getOrElse as aw, unwrap as ax, toNullable as ay, fromPromise as az, type PaymentStatusResponse as b, type UICart as b$, type CollectionProduct as b0, type BundlePriceType as b1, type Bundle as b2, type BundleSummary as b3, type BundleProduct as b4, type BundleWithDetails as b5, type BundleComponentData as b6, type BundleComponentInfo as b7, type CompositePricingMode as b8, type GroupPricingBehavior as b9, type DiscountDetails as bA, type SelectedAddOnOption as bB, type AddOnDetails as bC, type CartAddOn as bD, type VariantDetails as bE, type BundleSelectionInput as bF, type BundleStoredSelection as bG, type BundleSelectionData as bH, type CompositeStoredSelection as bI, type CompositePriceBreakdown as bJ, type CompositeSelectionData as bK, type LineConfiguration as bL, type Cart as bM, type CartItem as bN, type CartTotals as bO, type DisplayCart as bP, type DisplayCartItem as bQ, type DisplayAddOn as bR, type DisplayAddOnOption as bS, type UICartBusiness as bT, type UICartLocation as bU, type UICartCustomer as bV, type UICartPricing as bW, type AddOnOptionDetails as bX, type AddOnGroupDetails as bY, type VariantDetailsDTO as bZ, type CartItemDetails as b_, type ComponentSourceType as ba, type Composite as bb, type CompositeWithDetails as bc, type ComponentGroup as bd, type ComponentGroupWithComponents as be, type CompositeComponent as bf, type ComponentSelectionInput as bg, type CompositePriceResult as bh, type ComponentPriceBreakdown as bi, type PriceEntryType as bj, type Price as bk, type LocationProductPrice as bl, type ProductAvailability as bm, type ProductTimeProfile as bn, type CartStatus as bo, type CartChannel as bp, type PriceSource as bq, type AdjustmentType as br, type PriceAdjustment as bs, type TaxPathComponent as bt, type PricePathTaxInfo as bu, type PriceDecisionPath as bv, type ChosenPrice as bw, type BenefitType as bx, type AppliedDiscount as by, type DiscountBreakdown as bz, createCimplifyClient as c, type TimeRanges as c$, type AddToCartInput as c0, type UpdateCartItemInput as c1, type CartSummary as c2, type OrderStatus as c3, type PaymentState as c4, type OrderChannel as c5, type LineType as c6, type OrderLineState as c7, type OrderLineStatus as c8, type FulfillmentType as c9, type CancellationPolicy as cA, type ServiceNotes as cB, type PricingOverrides as cC, type SchedulingMetadata as cD, type StaffAssignment as cE, type ResourceAssignment as cF, type SchedulingResult as cG, type DepositResult as cH, type ServiceScheduleRequest as cI, type StaffScheduleItem as cJ, type LocationAppointment as cK, type PaymentStatus as cL, type PaymentProvider as cM, type PaymentMethodType as cN, type AuthorizationType as cO, type PaymentProcessingState as cP, type PaymentMethod as cQ, type Payment as cR, type InitializePaymentResult as cS, type SubmitAuthorizationInput as cT, type BusinessType as cU, type BusinessPreferences as cV, type Business as cW, type LocationTaxBehavior as cX, type LocationTaxOverrides as cY, type Location as cZ, type TimeRange as c_, type FulfillmentStatus as ca, type FulfillmentLink as cb, type OrderFulfillmentSummary as cc, type FeeBearerType as cd, type AmountToPay as ce, type LineItem as cf, type Order as cg, type OrderHistory as ch, type OrderGroupPaymentState as ci, type OrderGroup as cj, type OrderGroupPayment as ck, type OrderSplitDetail as cl, type OrderGroupPaymentSummary as cm, type OrderGroupDetails as cn, type OrderPaymentEvent as co, type OrderFilter as cp, type CheckoutInput as cq, type UpdateOrderStatusInput as cr, type CancelOrderInput as cs, type RefundOrderInput as ct, type ServiceStatus as cu, type StaffRole as cv, type ReminderMethod as cw, type CustomerServicePreferences as cx, type BufferTimes as cy, type ReminderSettings as cz, type CimplifyConfig as d, type RevokeAllSessionsResult as d$, type LocationTimeProfile as d0, type Table as d1, type Room as d2, type ServiceCharge as d3, type StorefrontBootstrap as d4, type BusinessWithLocations as d5, type LocationWithDetails as d6, type BusinessSettings as d7, type BusinessHours as d8, type CategoryInfo as d9, type StockOwnershipType as dA, type StockStatus as dB, type Stock as dC, type StockLevel as dD, type ProductStock as dE, type VariantStock as dF, type LocationStock as dG, type AvailabilityCheck as dH, type AvailabilityResult as dI, type InventorySummary as dJ, type Customer as dK, type CustomerAddress as dL, type CustomerMobileMoney as dM, type CustomerLinkPreferences as dN, type LinkData as dO, type CreateAddressInput as dP, type UpdateAddressInput as dQ, type CreateMobileMoneyInput as dR, type EnrollmentData as dS, type AddressData as dT, type MobileMoneyData as dU, type EnrollAndLinkOrderInput as dV, type LinkStatusResult as dW, type LinkEnrollResult as dX, type EnrollAndLinkOrderResult as dY, type LinkSession as dZ, type RevokeSessionResult as d_, type ServiceAvailabilityRule as da, type ServiceAvailabilityException as db, type StaffAvailabilityRule as dc, type StaffAvailabilityException as dd, type ResourceAvailabilityRule as de, type ResourceAvailabilityException as df, type StaffBookingProfile as dg, type ServiceStaffRequirement as dh, type BookingRequirementOverride as di, type ResourceType as dj, type Service as dk, type ServiceWithStaff as dl, type Staff as dm, type TimeSlot as dn, type AvailableSlot as dp, type DayAvailability as dq, type BookingStatus as dr, type Booking as ds, type BookingWithDetails as dt, type GetAvailableSlotsInput as du, type CheckSlotAvailabilityInput as dv, type RescheduleBookingInput as dw, type CancelBookingInput as dx, type ServiceAvailabilityParams as dy, type ServiceAvailabilityResult as dz, CatalogueQueries as e, type RequestOtpInput as e0, type VerifyOtpInput as e1, type AuthResponse as e2, type PickupTimeType as e3, type PickupTime as e4, type CheckoutAddressInfo as e5, type MobileMoneyDetails as e6, type CheckoutCustomerInfo as e7, type FxQuoteRequest as e8, type FxQuote as e9, type FxRateResponse as ea, type RequestContext as eb, type RequestStartEvent as ec, type RequestSuccessEvent as ed, type RequestErrorEvent as ee, type RetryEvent as ef, type SessionChangeEvent as eg, type ObservabilityHooks as eh, type ElementAppearance as ei, type AddressInfo as ej, type PaymentMethodInfo as ek, type AuthenticatedData as el, type ElementsCheckoutData as em, type ElementsCheckoutResult as en, type ParentToIframeMessage as eo, type IframeToParentMessage as ep, type ElementEventHandler as eq, type AdSlot as er, type AdPosition as es, type AdTheme as et, type AdConfig as eu, type AdCreative as ev, type AdContextValue as ew, CartOperations as f, CheckoutService as g, generateIdempotencyKey as h, type GetOrdersOptions as i, AuthService as j, type AuthStatus as k, type OtpResult as l, type ChangePasswordInput as m, SchedulingService as n, LiteService as o, type LiteBootstrap as p, type KitchenOrderResult as q, CimplifyElements as r, CimplifyElement as s, createElements as t, ELEMENT_TYPES as u, type ElementsOptions as v, type ElementOptions as w, type ElementType as x, type ElementEventType as y, type CheckoutMode as z };
3325
+ export { type CheckoutFormData as $, type ApiError as A, BusinessService as B, CimplifyClient as C, createElements as D, EVENT_TYPES as E, type FetchQuoteInput as F, type GetProductsOptions as G, ELEMENT_TYPES as H, InventoryService as I, type ElementsOptions as J, type KitchenOrderItem as K, LinkService as L, MESSAGE_TYPES as M, type ElementOptions as N, OrderQueries as O, type PaymentErrorDetails as P, type QuoteCompositeSelectionInput as Q, type RefreshQuoteInput as R, type SearchOptions as S, type TableInfo as T, type UpdateProfileInput as U, type ElementType as V, type ElementEventType as W, type CheckoutMode as X, type CheckoutOrderType as Y, type CheckoutPaymentMethod as Z, type CheckoutStep as _, type PaymentResponse as a, type VariantAxisSelection as a$, type CheckoutResult as a0, type MobileMoneyProvider as a1, type DeviceType as a2, type ContactType as a3, CHECKOUT_MODE as a4, ORDER_TYPE as a5, PAYMENT_METHOD as a6, CHECKOUT_STEP as a7, PAYMENT_STATE as a8, PICKUP_TIME_TYPE as a9, isOk as aA, isErr as aB, mapResult as aC, mapError as aD, flatMap as aE, getOrElse as aF, unwrap as aG, toNullable as aH, fromPromise as aI, tryCatch as aJ, combine as aK, combineObject as aL, type ProductType as aM, type InventoryType as aN, type VariantStrategy as aO, type DigitalProductType as aP, type DepositType as aQ, type SalesChannel as aR, type Product as aS, type ProductWithDetails as aT, type ProductVariant as aU, type VariantDisplayAttribute as aV, type VariantAxis as aW, type VariantAxisWithValues as aX, type VariantAxisValue as aY, type ProductVariantValue as aZ, type VariantLocationAvailability as a_, MOBILE_MONEY_PROVIDER as aa, AUTHORIZATION_TYPE as ab, DEVICE_TYPE as ac, CONTACT_TYPE as ad, LINK_QUERY as ae, LINK_MUTATION as af, AUTH_MUTATION as ag, CHECKOUT_MUTATION as ah, PAYMENT_MUTATION as ai, ORDER_MUTATION as aj, DEFAULT_CURRENCY as ak, DEFAULT_COUNTRY as al, type Money as am, type Currency as an, type PaginationParams as ao, type Pagination as ap, ErrorCode as aq, type ErrorCodeType as ar, CimplifyError as as, isCimplifyError as at, isRetryableError as au, type Result as av, type Ok as aw, type Err as ax, ok as ay, err as az, type PaymentStatusResponse as b, type DisplayAddOnOption as b$, type AddOn as b0, type AddOnWithOptions as b1, type AddOnOption as b2, type AddOnOptionPrice as b3, type ProductAddOn as b4, type Category as b5, type CategorySummary as b6, type Collection as b7, type CollectionSummary as b8, type CollectionProduct as b9, type AdjustmentType as bA, type PriceAdjustment as bB, type TaxPathComponent as bC, type PricePathTaxInfo as bD, type PriceDecisionPath as bE, type ChosenPrice as bF, type BenefitType as bG, type AppliedDiscount as bH, type DiscountBreakdown as bI, type DiscountDetails as bJ, type SelectedAddOnOption as bK, type AddOnDetails as bL, type CartAddOn as bM, type VariantDetails as bN, type BundleSelectionInput as bO, type BundleStoredSelection as bP, type BundleSelectionData as bQ, type CompositeStoredSelection as bR, type CompositePriceBreakdown as bS, type CompositeSelectionData as bT, type LineConfiguration as bU, type Cart as bV, type CartItem as bW, type CartTotals as bX, type DisplayCart as bY, type DisplayCartItem as bZ, type DisplayAddOn as b_, type BundlePriceType as ba, type Bundle as bb, type BundleSummary as bc, type BundleProduct as bd, type BundleWithDetails as be, type BundleComponentData as bf, type BundleComponentInfo as bg, type CompositePricingMode as bh, type GroupPricingBehavior as bi, type ComponentSourceType as bj, type Composite as bk, type CompositeWithDetails as bl, type ComponentGroup as bm, type ComponentGroupWithComponents as bn, type CompositeComponent as bo, type ComponentSelectionInput as bp, type CompositePriceResult as bq, type ComponentPriceBreakdown as br, type PriceEntryType as bs, type Price as bt, type LocationProductPrice as bu, type ProductAvailability as bv, type ProductTimeProfile as bw, type CartStatus as bx, type CartChannel as by, type PriceSource as bz, createCimplifyClient as c, type Payment as c$, type UICartBusiness as c0, type UICartLocation as c1, type UICartCustomer as c2, type UICartPricing as c3, type AddOnOptionDetails as c4, type AddOnGroupDetails as c5, type VariantDetailsDTO as c6, type CartItemDetails as c7, type UICart as c8, type UICartResponse as c9, type CheckoutInput as cA, type UpdateOrderStatusInput as cB, type CancelOrderInput as cC, type RefundOrderInput as cD, type ServiceStatus as cE, type StaffRole as cF, type ReminderMethod as cG, type CustomerServicePreferences as cH, type BufferTimes as cI, type ReminderSettings as cJ, type CancellationPolicy as cK, type ServiceNotes as cL, type PricingOverrides as cM, type SchedulingMetadata as cN, type StaffAssignment as cO, type ResourceAssignment as cP, type SchedulingResult as cQ, type DepositResult as cR, type ServiceScheduleRequest as cS, type StaffScheduleItem as cT, type LocationAppointment as cU, type PaymentStatus as cV, type PaymentProvider as cW, type PaymentMethodType as cX, type AuthorizationType as cY, type PaymentProcessingState as cZ, type PaymentMethod as c_, type AddToCartInput as ca, type UpdateCartItemInput as cb, type CartSummary as cc, type OrderStatus as cd, type PaymentState as ce, type OrderChannel as cf, type LineType as cg, type OrderLineState as ch, type OrderLineStatus as ci, type FulfillmentType as cj, type FulfillmentStatus as ck, type FulfillmentLink as cl, type OrderFulfillmentSummary as cm, type FeeBearerType as cn, type AmountToPay as co, type LineItem as cp, type Order as cq, type OrderHistory as cr, type OrderGroupPaymentState as cs, type OrderGroup as ct, type OrderGroupPayment as cu, type OrderSplitDetail as cv, type OrderGroupPaymentSummary as cw, type OrderGroupDetails as cx, type OrderPaymentEvent as cy, type OrderFilter as cz, type CimplifyConfig as d, type CreateMobileMoneyInput as d$, type InitializePaymentResult as d0, type SubmitAuthorizationInput as d1, type BusinessType as d2, type BusinessPreferences as d3, type Business as d4, type LocationTaxBehavior as d5, type LocationTaxOverrides as d6, type Location as d7, type TimeRange as d8, type TimeRanges as d9, type DayAvailability as dA, type BookingStatus as dB, type Booking as dC, type BookingWithDetails as dD, type GetAvailableSlotsInput as dE, type CheckSlotAvailabilityInput as dF, type RescheduleBookingInput as dG, type CancelBookingInput as dH, type ServiceAvailabilityParams as dI, type ServiceAvailabilityResult as dJ, type StockOwnershipType as dK, type StockStatus as dL, type Stock as dM, type StockLevel as dN, type ProductStock as dO, type VariantStock as dP, type LocationStock as dQ, type AvailabilityCheck as dR, type AvailabilityResult as dS, type InventorySummary as dT, type Customer as dU, type CustomerAddress as dV, type CustomerMobileMoney as dW, type CustomerLinkPreferences as dX, type LinkData as dY, type CreateAddressInput as dZ, type UpdateAddressInput as d_, type LocationTimeProfile as da, type Table as db, type Room as dc, type ServiceCharge as dd, type StorefrontBootstrap as de, type BusinessWithLocations as df, type LocationWithDetails as dg, type BusinessSettings as dh, type BusinessHours as di, type CategoryInfo as dj, type ServiceAvailabilityRule as dk, type ServiceAvailabilityException as dl, type StaffAvailabilityRule as dm, type StaffAvailabilityException as dn, type ResourceAvailabilityRule as dp, type ResourceAvailabilityException as dq, type StaffBookingProfile as dr, type ServiceStaffRequirement as ds, type BookingRequirementOverride as dt, type ResourceType as du, type Service as dv, type ServiceWithStaff as dw, type Staff as dx, type TimeSlot as dy, type AvailableSlot as dz, CatalogueQueries as e, type EnrollmentData as e0, type AddressData as e1, type MobileMoneyData as e2, type EnrollAndLinkOrderInput as e3, type LinkStatusResult as e4, type LinkEnrollResult as e5, type EnrollAndLinkOrderResult as e6, type LinkSession as e7, type RevokeSessionResult as e8, type RevokeAllSessionsResult as e9, type ElementEventHandler as eA, type AdSlot as eB, type AdPosition as eC, type AdTheme as eD, type AdConfig as eE, type AdCreative as eF, type AdContextValue as eG, type RequestOtpInput as ea, type VerifyOtpInput as eb, type AuthResponse as ec, type PickupTimeType as ed, type PickupTime as ee, type CheckoutAddressInfo as ef, type MobileMoneyDetails as eg, type CheckoutCustomerInfo as eh, type FxQuoteRequest as ei, type FxQuote as ej, type FxRateResponse as ek, type RequestContext as el, type RequestStartEvent as em, type RequestSuccessEvent as en, type RequestErrorEvent as eo, type RetryEvent as ep, type SessionChangeEvent as eq, type ObservabilityHooks as er, type ElementAppearance as es, type AddressInfo as et, type PaymentMethodInfo as eu, type AuthenticatedData as ev, type ElementsCheckoutData as ew, type ElementsCheckoutResult as ex, type ParentToIframeMessage as ey, type IframeToParentMessage as ez, type QuoteBundleSelectionInput as f, type QuoteStatus as g, type QuoteDynamicBuckets as h, type QuoteUiMessage as i, type PriceQuote as j, type RefreshQuoteResult as k, CartOperations as l, CheckoutService as m, generateIdempotencyKey as n, type GetOrdersOptions as o, AuthService as p, type AuthStatus as q, type OtpResult as r, type ChangePasswordInput as s, SchedulingService as t, LiteService as u, FxService as v, type LiteBootstrap as w, type KitchenOrderResult as x, CimplifyElements as y, CimplifyElement as z };