@epilot/pricing-client 3.47.9-alpha.5 → 3.47.9-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/openapi.d.ts CHANGED
@@ -254,111 +254,36 @@ declare namespace Components {
254
254
  _meta?: /* Signature meta data payload */ SignatureMeta;
255
255
  }
256
256
  /**
257
- * The common properties for a composite price entity, without the price components
257
+ * The coupon configuration
258
258
  * example:
259
259
  * {
260
- * "$ref": "#/components/examples/composite-price"
260
+ * "_id": "123e4567-e89b-12d3-a456-426614174000",
261
+ * "_schema": "coupon",
262
+ * "_org": "org_12345",
263
+ * "_created_at": "2024-01-15T10:00:00.000Z",
264
+ * "_updated_at": "2024-01-20T12:00:00.000Z",
265
+ * "_title": "Sample Coupon",
266
+ * "name": "Sample Coupon",
267
+ * "type": "fixed",
268
+ * "fixed_value": 555,
269
+ * "fixed_value_currency": "USD",
270
+ * "fixed_value_decimal": "5.55",
271
+ * "active": true,
272
+ * "prices": {
273
+ * "$relation": [
274
+ * {
275
+ * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
276
+ * "_tags": [
277
+ * "discount",
278
+ * "special"
279
+ * ],
280
+ * "_schema": "price"
281
+ * }
282
+ * ]
283
+ * }
261
284
  * }
262
285
  */
263
- export interface BaseCompositePrice {
264
- [name: string]: any;
265
- /**
266
- * The billing period duration
267
- */
268
- billing_duration_amount?: number;
269
- /**
270
- * The billing period duration unit
271
- */
272
- billing_duration_unit?: "weeks" | "months" | "years";
273
- /**
274
- * The notice period duration
275
- */
276
- notice_time_amount?: number;
277
- /**
278
- * The notice period duration unit
279
- */
280
- notice_time_unit?: "weeks" | "months" | "years";
281
- /**
282
- * The termination period duration
283
- */
284
- termination_time_amount?: number;
285
- /**
286
- * The termination period duration unit
287
- */
288
- termination_time_unit?: "weeks" | "months" | "years";
289
- /**
290
- * The renewal period duration
291
- */
292
- renewal_duration_amount?: number;
293
- /**
294
- * The renewal period duration unit
295
- */
296
- renewal_duration_unit?: "weeks" | "months" | "years";
297
- /**
298
- * Whether the price can be used for new purchases.
299
- */
300
- active?: boolean;
301
- /**
302
- * A brief description of the price.
303
- */
304
- description?: string;
305
- /**
306
- * A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.
307
- */
308
- price_components?: /* A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price. */ /**
309
- * The price entity schema for simple pricing
310
- * example:
311
- * {
312
- * "$ref": "#/components/examples/price"
313
- * }
314
- */
315
- Price[] | {
316
- $relation?: PriceComponentRelation[];
317
- };
318
- /**
319
- * Three-letter ISO currency code, in lowercase.
320
- */
321
- unit_amount_currency?: /* Three-letter ISO currency code, in lowercase. */ /**
322
- * Three-letter ISO currency code, in lowercase. Must be a supported currency.
323
- * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
324
- *
325
- * example:
326
- * EUR
327
- */
328
- Currency;
329
- /**
330
- * The flag for prices that contain price components.
331
- */
332
- is_composite_price: true;
333
- /**
334
- * The price creation date
335
- */
336
- _created_at?: string;
337
- /**
338
- * The price id
339
- */
340
- _id?: string;
341
- /**
342
- * The price autogenerated title
343
- */
344
- _title?: string;
345
- /**
346
- * The price last update date
347
- */
348
- _updated_at?: string;
349
- /**
350
- * The organization id the price belongs to
351
- */
352
- _org_id?: string;
353
- /**
354
- * An arbitrary set of tags attached to the composite price
355
- */
356
- _tags?: string[];
357
- }
358
- /**
359
- * The shared properties for the coupon entity and coupon item entity
360
- */
361
- export interface BaseCouponCommon {
286
+ export interface BaseCoupon {
362
287
  [name: string]: any;
363
288
  _id: EntityId /* uuid */;
364
289
  /**
@@ -384,8 +309,8 @@ declare namespace Components {
384
309
  _updated_at: string; // date-time
385
310
  name: string | null;
386
311
  description?: string | null;
387
- type: "fixed" | "percentage";
388
- category: "discount" | "cashback";
312
+ type?: "fixed" | "percentage";
313
+ category?: "discount" | "cashback";
389
314
  /**
390
315
  * Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
391
316
  */
@@ -418,6 +343,19 @@ declare namespace Components {
418
343
  * Whether the coupon requires a promo code to be applied
419
344
  */
420
345
  requires_promo_code?: boolean;
346
+ /**
347
+ * The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.
348
+ */
349
+ prices?: /* The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise. */ {
350
+ $relation?: EntityRelation[];
351
+ } | /**
352
+ * The price entity schema for simple pricing
353
+ * example:
354
+ * {
355
+ * "$ref": "#/components/examples/price"
356
+ * }
357
+ */
358
+ Price[];
421
359
  }
422
360
  export interface BaseMarketPriceRecord {
423
361
  /**
@@ -764,7 +702,14 @@ declare namespace Components {
764
702
  * "$ref": "#/components/examples/price"
765
703
  * }
766
704
  */
767
- Price | /* The composite price entity */ CompositePrice;
705
+ Price | /**
706
+ * The price entity schema for dynamic pricing
707
+ * example:
708
+ * {
709
+ * "$ref": "#/components/examples/composite-price"
710
+ * }
711
+ */
712
+ CompositePrice;
768
713
  /**
769
714
  * The taxes applied to the price item.
770
715
  */
@@ -776,7 +721,7 @@ declare namespace Components {
776
721
  /**
777
722
  * The coupons applicable to the price item
778
723
  */
779
- _coupons?: (/* The shared properties for the coupon entity and coupon item entity */ CouponItem)[];
724
+ _coupons?: (CouponItem)[];
780
725
  /**
781
726
  * When set to true on a `_price` displayed as OnRequest (`show_as_on_request: 'on_request'`) this flag means the price has been approved and can now be displayed to the customer. This flag is only valid for prices shown as 'on_request'.
782
727
  */
@@ -1114,7 +1059,7 @@ declare namespace Components {
1114
1059
  /**
1115
1060
  * The coupons applicable to the price item
1116
1061
  */
1117
- _coupons?: (/* The shared properties for the coupon entity and coupon item entity */ CouponItem)[];
1062
+ _coupons?: (CouponItem)[];
1118
1063
  }
1119
1064
  export interface BasicAuthCredentials {
1120
1065
  /**
@@ -1372,7 +1317,7 @@ declare namespace Components {
1372
1317
  * }
1373
1318
  */
1374
1319
  Price | /**
1375
- * The coupon entity
1320
+ * The coupon configuration
1376
1321
  * example:
1377
1322
  * {
1378
1323
  * "_id": "123e4567-e89b-12d3-a456-426614174000",
@@ -1429,23 +1374,107 @@ declare namespace Components {
1429
1374
  */
1430
1375
  export type CheckoutMode = "create_order" | "create_invoice" | "create_quote";
1431
1376
  /**
1432
- * The composite price entity
1433
- */
1434
- export type CompositePrice = /* The composite price entity */ /**
1435
- * The composite price entity
1377
+ * The price entity schema for dynamic pricing
1436
1378
  * example:
1437
1379
  * {
1438
1380
  * "$ref": "#/components/examples/composite-price"
1439
1381
  * }
1440
1382
  */
1441
- NonHydratedCompositePrice | /**
1442
- * The composite price entity
1443
- * example:
1444
- * {
1445
- * "$ref": "#/components/examples/composite-price"
1446
- * }
1447
- */
1448
- HydratedCompositePrice;
1383
+ export interface CompositePrice {
1384
+ [name: string]: any;
1385
+ /**
1386
+ * The billing period duration
1387
+ */
1388
+ billing_duration_amount?: number;
1389
+ /**
1390
+ * The billing period duration unit
1391
+ */
1392
+ billing_duration_unit?: "weeks" | "months" | "years";
1393
+ /**
1394
+ * The notice period duration
1395
+ */
1396
+ notice_time_amount?: number;
1397
+ /**
1398
+ * The notice period duration unit
1399
+ */
1400
+ notice_time_unit?: "weeks" | "months" | "years";
1401
+ /**
1402
+ * The termination period duration
1403
+ */
1404
+ termination_time_amount?: number;
1405
+ /**
1406
+ * The termination period duration unit
1407
+ */
1408
+ termination_time_unit?: "weeks" | "months" | "years";
1409
+ /**
1410
+ * The renewal period duration
1411
+ */
1412
+ renewal_duration_amount?: number;
1413
+ /**
1414
+ * The renewal period duration unit
1415
+ */
1416
+ renewal_duration_unit?: "weeks" | "months" | "years";
1417
+ /**
1418
+ * Whether the price can be used for new purchases.
1419
+ */
1420
+ active?: boolean;
1421
+ /**
1422
+ * A brief description of the price.
1423
+ */
1424
+ description?: string;
1425
+ /**
1426
+ * A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.
1427
+ */
1428
+ price_components?: /* A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price. */ /**
1429
+ * The price entity schema for simple pricing
1430
+ * example:
1431
+ * {
1432
+ * "$ref": "#/components/examples/price"
1433
+ * }
1434
+ */
1435
+ Price[] | {
1436
+ $relation?: PriceComponentRelation[];
1437
+ };
1438
+ /**
1439
+ * Three-letter ISO currency code, in lowercase.
1440
+ */
1441
+ unit_amount_currency?: /* Three-letter ISO currency code, in lowercase. */ /**
1442
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
1443
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
1444
+ *
1445
+ * example:
1446
+ * EUR
1447
+ */
1448
+ Currency;
1449
+ /**
1450
+ * The flag for prices that contain price components.
1451
+ */
1452
+ is_composite_price?: boolean;
1453
+ /**
1454
+ * The price creation date
1455
+ */
1456
+ _created_at?: string;
1457
+ /**
1458
+ * The price id
1459
+ */
1460
+ _id?: string;
1461
+ /**
1462
+ * The price autogenerated title
1463
+ */
1464
+ _title?: string;
1465
+ /**
1466
+ * The price last update date
1467
+ */
1468
+ _updated_at?: string;
1469
+ /**
1470
+ * The organization id the price belongs to
1471
+ */
1472
+ _org_id?: string;
1473
+ /**
1474
+ * An arbitrary set of tags attached to the composite price
1475
+ */
1476
+ _tags?: string[];
1477
+ }
1449
1478
  /**
1450
1479
  * Represents a composite price input to the pricing library.
1451
1480
  * example:
@@ -1769,7 +1798,14 @@ declare namespace Components {
1769
1798
  * "$ref": "#/components/examples/price"
1770
1799
  * }
1771
1800
  */
1772
- Price | /* The composite price entity */ CompositePrice;
1801
+ Price | /**
1802
+ * The price entity schema for dynamic pricing
1803
+ * example:
1804
+ * {
1805
+ * "$ref": "#/components/examples/composite-price"
1806
+ * }
1807
+ */
1808
+ CompositePrice;
1773
1809
  /**
1774
1810
  * The taxes applied to the price item.
1775
1811
  */
@@ -1781,15 +1817,11 @@ declare namespace Components {
1781
1817
  /**
1782
1818
  * The coupons applicable to the price item
1783
1819
  */
1784
- _coupons?: (/* The shared properties for the coupon entity and coupon item entity */ CouponItem)[];
1820
+ _coupons?: (CouponItem)[];
1785
1821
  /**
1786
1822
  * When set to true on a `_price` displayed as OnRequest (`show_as_on_request: 'on_request'`) this flag means the price has been approved and can now be displayed to the customer. This flag is only valid for prices shown as 'on_request'.
1787
1823
  */
1788
1824
  on_request_approved?: boolean;
1789
- /**
1790
- * The flag for prices that contain price components.
1791
- */
1792
- is_composite_price: true;
1793
1825
  /**
1794
1826
  * Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).
1795
1827
  */
@@ -1982,11 +2014,11 @@ declare namespace Components {
1982
2014
  /**
1983
2015
  * The coupons applicable to the price item
1984
2016
  */
1985
- _coupons?: (/* The shared properties for the coupon entity and coupon item entity */ CouponItem)[];
2017
+ _coupons?: (CouponItem)[];
1986
2018
  /**
1987
2019
  * The flag for prices that contain price components.
1988
2020
  */
1989
- is_composite_price: true;
2021
+ is_composite_price?: true;
1990
2022
  /**
1991
2023
  * Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).
1992
2024
  */
@@ -2001,7 +2033,14 @@ declare namespace Components {
2001
2033
  price_component_coupon_ids?: {
2002
2034
  [name: string]: string[];
2003
2035
  };
2004
- _price?: /* The composite price entity */ CompositePrice;
2036
+ _price?: /**
2037
+ * The price entity schema for dynamic pricing
2038
+ * example:
2039
+ * {
2040
+ * "$ref": "#/components/examples/composite-price"
2041
+ * }
2042
+ */
2043
+ CompositePrice;
2005
2044
  }
2006
2045
  /**
2007
2046
  * The compute price payload
@@ -2230,7 +2269,7 @@ declare namespace Components {
2230
2269
  }
2231
2270
  export type ConsumptionTypeGetAg = "household" | "heating_pump" | "night_storage_heating" | "night_storage_heating_common_meter";
2232
2271
  /**
2233
- * The coupon entity
2272
+ * The coupon configuration
2234
2273
  * example:
2235
2274
  * {
2236
2275
  * "_id": "123e4567-e89b-12d3-a456-426614174000",
@@ -2285,8 +2324,8 @@ declare namespace Components {
2285
2324
  _updated_at: string; // date-time
2286
2325
  name: string | null;
2287
2326
  description?: string | null;
2288
- type: "fixed" | "percentage";
2289
- category: "discount" | "cashback";
2327
+ type?: "fixed" | "percentage";
2328
+ category?: "discount" | "cashback";
2290
2329
  /**
2291
2330
  * Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
2292
2331
  */
@@ -2349,20 +2388,16 @@ declare namespace Components {
2349
2388
  [name: string]: number;
2350
2389
  };
2351
2390
  }
2352
- /**
2353
- * The shared properties for the coupon entity and coupon item entity
2354
- */
2355
2391
  export interface CouponItem {
2356
- [name: string]: any;
2357
- _id: EntityId /* uuid */;
2392
+ _id?: EntityId /* uuid */;
2358
2393
  /**
2359
2394
  * The auto-generated title for the title
2360
2395
  */
2361
- _title: string;
2396
+ _title?: string;
2362
2397
  /**
2363
2398
  * Organization Id the entity belongs to
2364
2399
  */
2365
- _org: string;
2400
+ _org?: string;
2366
2401
  /**
2367
2402
  * The schema of the entity, for coupons it is always `coupon`
2368
2403
  */
@@ -2371,12 +2406,12 @@ declare namespace Components {
2371
2406
  /**
2372
2407
  * The creation date for the opportunity
2373
2408
  */
2374
- _created_at: string; // date-time
2409
+ _created_at?: string; // date-time
2375
2410
  /**
2376
2411
  * The date the coupon was last updated
2377
2412
  */
2378
- _updated_at: string; // date-time
2379
- name: string | null;
2413
+ _updated_at?: string; // date-time
2414
+ name?: string | null;
2380
2415
  description?: string | null;
2381
2416
  type: "fixed" | "percentage";
2382
2417
  category: "discount" | "cashback";
@@ -2414,7 +2449,7 @@ declare namespace Components {
2414
2449
  requires_promo_code?: boolean;
2415
2450
  }
2416
2451
  /**
2417
- * The base for the coupon entity without promo codes
2452
+ * The coupon configuration
2418
2453
  * example:
2419
2454
  * {
2420
2455
  * "_id": "123e4567-e89b-12d3-a456-426614174000",
@@ -2469,8 +2504,8 @@ declare namespace Components {
2469
2504
  _updated_at: string; // date-time
2470
2505
  name: string | null;
2471
2506
  description?: string | null;
2472
- type: "fixed" | "percentage";
2473
- category: "discount" | "cashback";
2507
+ type?: "fixed" | "percentage";
2508
+ category?: "discount" | "cashback";
2474
2509
  /**
2475
2510
  * Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
2476
2511
  */
@@ -2772,113 +2807,6 @@ declare namespace Components {
2772
2807
  bidding_zone: /* The bidding zone for a spot market price. */ SpotMarketBiddingZone;
2773
2808
  prices: /* A market price at a given point in time. */ HistoricMarketPriceRecord[];
2774
2809
  }
2775
- /**
2776
- * The composite price entity
2777
- * example:
2778
- * {
2779
- * "$ref": "#/components/examples/composite-price"
2780
- * }
2781
- */
2782
- export interface HydratedCompositePrice {
2783
- [name: string]: any;
2784
- /**
2785
- * The billing period duration
2786
- */
2787
- billing_duration_amount?: number;
2788
- /**
2789
- * The billing period duration unit
2790
- */
2791
- billing_duration_unit?: "weeks" | "months" | "years";
2792
- /**
2793
- * The notice period duration
2794
- */
2795
- notice_time_amount?: number;
2796
- /**
2797
- * The notice period duration unit
2798
- */
2799
- notice_time_unit?: "weeks" | "months" | "years";
2800
- /**
2801
- * The termination period duration
2802
- */
2803
- termination_time_amount?: number;
2804
- /**
2805
- * The termination period duration unit
2806
- */
2807
- termination_time_unit?: "weeks" | "months" | "years";
2808
- /**
2809
- * The renewal period duration
2810
- */
2811
- renewal_duration_amount?: number;
2812
- /**
2813
- * The renewal period duration unit
2814
- */
2815
- renewal_duration_unit?: "weeks" | "months" | "years";
2816
- /**
2817
- * Whether the price can be used for new purchases.
2818
- */
2819
- active?: boolean;
2820
- /**
2821
- * A brief description of the price.
2822
- */
2823
- description?: string;
2824
- /**
2825
- * A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.
2826
- */
2827
- price_components?: /* A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price. */ /**
2828
- * The price entity schema for simple pricing
2829
- * example:
2830
- * {
2831
- * "$ref": "#/components/examples/price"
2832
- * }
2833
- */
2834
- Price[] | /**
2835
- * The price entity schema for simple pricing
2836
- * example:
2837
- * {
2838
- * "$ref": "#/components/examples/price"
2839
- * }
2840
- */
2841
- Price[];
2842
- /**
2843
- * Three-letter ISO currency code, in lowercase.
2844
- */
2845
- unit_amount_currency?: /* Three-letter ISO currency code, in lowercase. */ /**
2846
- * Three-letter ISO currency code, in lowercase. Must be a supported currency.
2847
- * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
2848
- *
2849
- * example:
2850
- * EUR
2851
- */
2852
- Currency;
2853
- /**
2854
- * The flag for prices that contain price components.
2855
- */
2856
- is_composite_price: true;
2857
- /**
2858
- * The price creation date
2859
- */
2860
- _created_at?: string;
2861
- /**
2862
- * The price id
2863
- */
2864
- _id?: string;
2865
- /**
2866
- * The price autogenerated title
2867
- */
2868
- _title?: string;
2869
- /**
2870
- * The price last update date
2871
- */
2872
- _updated_at?: string;
2873
- /**
2874
- * The organization id the price belongs to
2875
- */
2876
- _org_id?: string;
2877
- /**
2878
- * An arbitrary set of tags attached to the composite price
2879
- */
2880
- _tags?: string[];
2881
- }
2882
2810
  /**
2883
2811
  * The auth credentials for external integrations
2884
2812
  */
@@ -2971,103 +2899,6 @@ declare namespace Components {
2971
2899
  */
2972
2900
  value?: string;
2973
2901
  })[];
2974
- /**
2975
- * The composite price entity
2976
- * example:
2977
- * {
2978
- * "$ref": "#/components/examples/composite-price"
2979
- * }
2980
- */
2981
- export interface NonHydratedCompositePrice {
2982
- [name: string]: any;
2983
- /**
2984
- * The billing period duration
2985
- */
2986
- billing_duration_amount?: number;
2987
- /**
2988
- * The billing period duration unit
2989
- */
2990
- billing_duration_unit?: "weeks" | "months" | "years";
2991
- /**
2992
- * The notice period duration
2993
- */
2994
- notice_time_amount?: number;
2995
- /**
2996
- * The notice period duration unit
2997
- */
2998
- notice_time_unit?: "weeks" | "months" | "years";
2999
- /**
3000
- * The termination period duration
3001
- */
3002
- termination_time_amount?: number;
3003
- /**
3004
- * The termination period duration unit
3005
- */
3006
- termination_time_unit?: "weeks" | "months" | "years";
3007
- /**
3008
- * The renewal period duration
3009
- */
3010
- renewal_duration_amount?: number;
3011
- /**
3012
- * The renewal period duration unit
3013
- */
3014
- renewal_duration_unit?: "weeks" | "months" | "years";
3015
- /**
3016
- * Whether the price can be used for new purchases.
3017
- */
3018
- active?: boolean;
3019
- /**
3020
- * A brief description of the price.
3021
- */
3022
- description?: string;
3023
- /**
3024
- * A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.
3025
- */
3026
- price_components?: /* A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price. */ {
3027
- $relation?: PriceComponentRelation[];
3028
- } | {
3029
- $relation?: PriceComponentRelation[];
3030
- };
3031
- /**
3032
- * Three-letter ISO currency code, in lowercase.
3033
- */
3034
- unit_amount_currency?: /* Three-letter ISO currency code, in lowercase. */ /**
3035
- * Three-letter ISO currency code, in lowercase. Must be a supported currency.
3036
- * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
3037
- *
3038
- * example:
3039
- * EUR
3040
- */
3041
- Currency;
3042
- /**
3043
- * The flag for prices that contain price components.
3044
- */
3045
- is_composite_price: true;
3046
- /**
3047
- * The price creation date
3048
- */
3049
- _created_at?: string;
3050
- /**
3051
- * The price id
3052
- */
3053
- _id?: string;
3054
- /**
3055
- * The price autogenerated title
3056
- */
3057
- _title?: string;
3058
- /**
3059
- * The price last update date
3060
- */
3061
- _updated_at?: string;
3062
- /**
3063
- * The organization id the price belongs to
3064
- */
3065
- _org_id?: string;
3066
- /**
3067
- * An arbitrary set of tags attached to the composite price
3068
- */
3069
- _tags?: string[];
3070
- }
3071
2902
  export interface OAuthCredentials {
3072
2903
  /**
3073
2904
  * The OAuth client ID
@@ -3607,7 +3438,7 @@ declare namespace Components {
3607
3438
  /**
3608
3439
  * The flag for prices that contain price components.
3609
3440
  */
3610
- is_composite_price?: false;
3441
+ is_composite_price?: boolean;
3611
3442
  /**
3612
3443
  * Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.
3613
3444
  * - `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity
@@ -4238,7 +4069,14 @@ declare namespace Components {
4238
4069
  * "$ref": "#/components/examples/price"
4239
4070
  * }
4240
4071
  */
4241
- Price | /* The composite price entity */ CompositePrice;
4072
+ Price | /**
4073
+ * The price entity schema for dynamic pricing
4074
+ * example:
4075
+ * {
4076
+ * "$ref": "#/components/examples/composite-price"
4077
+ * }
4078
+ */
4079
+ CompositePrice;
4242
4080
  /**
4243
4081
  * The taxes applied to the price item.
4244
4082
  */
@@ -4250,7 +4088,7 @@ declare namespace Components {
4250
4088
  /**
4251
4089
  * The coupons applicable to the price item
4252
4090
  */
4253
- _coupons?: (/* The shared properties for the coupon entity and coupon item entity */ CouponItem)[];
4091
+ _coupons?: (CouponItem)[];
4254
4092
  /**
4255
4093
  * When set to true on a `_price` displayed as OnRequest (`show_as_on_request: 'on_request'`) this flag means the price has been approved and can now be displayed to the customer. This flag is only valid for prices shown as 'on_request'.
4256
4094
  */
@@ -4259,10 +4097,6 @@ declare namespace Components {
4259
4097
  * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
4260
4098
  */
4261
4099
  type?: "one_time" | "recurring";
4262
- /**
4263
- * The flag for prices that contain price components.
4264
- */
4265
- is_composite_price?: false;
4266
4100
  /**
4267
4101
  * The price billing period.
4268
4102
  */
@@ -4461,7 +4295,7 @@ declare namespace Components {
4461
4295
  /**
4462
4296
  * The coupons applicable to the price item
4463
4297
  */
4464
- _coupons?: (/* The shared properties for the coupon entity and coupon item entity */ CouponItem)[];
4298
+ _coupons?: (CouponItem)[];
4465
4299
  /**
4466
4300
  * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
4467
4301
  */
@@ -4553,7 +4387,7 @@ declare namespace Components {
4553
4387
  /**
4554
4388
  * The flag for prices that contain price components.
4555
4389
  */
4556
- is_composite_price?: false;
4390
+ is_composite_price?: boolean;
4557
4391
  /**
4558
4392
  * Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.
4559
4393
  * - `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity
@@ -4686,7 +4520,7 @@ declare namespace Components {
4686
4520
  _tags?: string[];
4687
4521
  };
4688
4522
  }
4689
- export type PriceItemDtoUnion = /* Represents a price input to the pricing library. */ PriceItemDto | /* Represents a composite price input to the pricing library. */ CompositePriceItemDto;
4523
+ export type PriceItemUnion = /* Represents a price input to the pricing library. */ PriceItemDto | /* Represents a composite price input to the pricing library. */ CompositePriceItemDto;
4690
4524
  /**
4691
4525
  * Tracks a set of product prices, quantities, (discounts) and taxes.
4692
4526
  */
@@ -4708,7 +4542,7 @@ declare namespace Components {
4708
4542
  /**
4709
4543
  * A valid set of product prices, quantities, (discounts) and taxes from a client.
4710
4544
  */
4711
- export type PriceItemsDto = PriceItemDtoUnion[];
4545
+ export type PriceItemsDto = PriceItemUnion[];
4712
4546
  export interface PriceTier {
4713
4547
  up_to?: number | null;
4714
4548
  flat_fee_amount?: number;
@@ -4974,7 +4808,7 @@ declare namespace Components {
4974
4808
  */
4975
4809
  export interface PromoCodeValidationResponse {
4976
4810
  matched_coupons?: /**
4977
- * The base for the coupon entity without promo codes
4811
+ * The coupon configuration
4978
4812
  * example:
4979
4813
  * {
4980
4814
  * "_id": "123e4567-e89b-12d3-a456-426614174000",
@@ -5003,7 +4837,7 @@ declare namespace Components {
5003
4837
  * }
5004
4838
  * }
5005
4839
  */
5006
- CouponWithoutPromoCodes[];
4840
+ BaseCoupon[];
5007
4841
  }
5008
4842
  /**
5009
4843
  * The provider entity
@@ -5232,7 +5066,7 @@ declare namespace Components {
5232
5066
  * The coupons that got redeemed with received the code
5233
5067
  */
5234
5068
  coupons: /**
5235
- * The base for the coupon entity without promo codes
5069
+ * The coupon configuration
5236
5070
  * example:
5237
5071
  * {
5238
5072
  * "_id": "123e4567-e89b-12d3-a456-426614174000",
@@ -6385,8 +6219,7 @@ export type AvailabilityLocation = Components.Schemas.AvailabilityLocation;
6385
6219
  export type AvailabilityResult = Components.Schemas.AvailabilityResult;
6386
6220
  export type AverageMarketPriceRecord = Components.Schemas.AverageMarketPriceRecord;
6387
6221
  export type AverageMarketPriceResult = Components.Schemas.AverageMarketPriceResult;
6388
- export type BaseCompositePrice = Components.Schemas.BaseCompositePrice;
6389
- export type BaseCouponCommon = Components.Schemas.BaseCouponCommon;
6222
+ export type BaseCoupon = Components.Schemas.BaseCoupon;
6390
6223
  export type BaseMarketPriceRecord = Components.Schemas.BaseMarketPriceRecord;
6391
6224
  export type BasePriceItem = Components.Schemas.BasePriceItem;
6392
6225
  export type BasePriceItemCommon = Components.Schemas.BasePriceItemCommon;
@@ -6434,14 +6267,12 @@ export type File = Components.Schemas.File;
6434
6267
  export type GasConcessionType = Components.Schemas.GasConcessionType;
6435
6268
  export type HistoricMarketPriceRecord = Components.Schemas.HistoricMarketPriceRecord;
6436
6269
  export type HistoricMarketPricesResult = Components.Schemas.HistoricMarketPricesResult;
6437
- export type HydratedCompositePrice = Components.Schemas.HydratedCompositePrice;
6438
6270
  export type IntegrationAuthCredentials = Components.Schemas.IntegrationAuthCredentials;
6439
6271
  export type IntegrationCredentialsResult = Components.Schemas.IntegrationCredentialsResult;
6440
6272
  export type IntegrationId = Components.Schemas.IntegrationId;
6441
6273
  export type JourneyContext = Components.Schemas.JourneyContext;
6442
6274
  export type MarkupPricingModel = Components.Schemas.MarkupPricingModel;
6443
6275
  export type MetaData = Components.Schemas.MetaData;
6444
- export type NonHydratedCompositePrice = Components.Schemas.NonHydratedCompositePrice;
6445
6276
  export type OAuthCredentials = Components.Schemas.OAuthCredentials;
6446
6277
  export type OAuthIntegration = Components.Schemas.OAuthIntegration;
6447
6278
  export type Opportunity = Components.Schemas.Opportunity;
@@ -6462,7 +6293,7 @@ export type PriceInputMapping = Components.Schemas.PriceInputMapping;
6462
6293
  export type PriceInputMappings = Components.Schemas.PriceInputMappings;
6463
6294
  export type PriceItem = Components.Schemas.PriceItem;
6464
6295
  export type PriceItemDto = Components.Schemas.PriceItemDto;
6465
- export type PriceItemDtoUnion = Components.Schemas.PriceItemDtoUnion;
6296
+ export type PriceItemUnion = Components.Schemas.PriceItemUnion;
6466
6297
  export type PriceItems = Components.Schemas.PriceItems;
6467
6298
  export type PriceItemsDto = Components.Schemas.PriceItemsDto;
6468
6299
  export type PriceTier = Components.Schemas.PriceTier;
package/dist/openapi.json CHANGED
@@ -2841,10 +2841,7 @@
2841
2841
  },
2842
2842
  "is_composite_price": {
2843
2843
  "description": "The flag for prices that contain price components.",
2844
- "type": "boolean",
2845
- "enum": [
2846
- false
2847
- ]
2844
+ "type": "boolean"
2848
2845
  },
2849
2846
  "pricing_model": {
2850
2847
  "type": "string",
@@ -3020,22 +3017,19 @@
3020
3017
  "pricing_model"
3021
3018
  ]
3022
3019
  },
3023
- "BaseCompositePrice": {
3020
+ "CompositePrice": {
3024
3021
  "allOf": [
3025
3022
  {
3026
3023
  "$ref": "#/components/schemas/PriceConditions"
3027
3024
  }
3028
3025
  ],
3029
3026
  "type": "object",
3030
- "description": "The common properties for a composite price entity, without the price components",
3027
+ "description": "The price entity schema for dynamic pricing",
3031
3028
  "example": {
3032
3029
  "$ref": "#/components/examples/composite-price"
3033
3030
  },
3034
3031
  "additionalProperties": true,
3035
3032
  "readOnly": true,
3036
- "required": [
3037
- "is_composite_price"
3038
- ],
3039
3033
  "properties": {
3040
3034
  "active": {
3041
3035
  "type": "boolean",
@@ -3077,10 +3071,7 @@
3077
3071
  },
3078
3072
  "is_composite_price": {
3079
3073
  "description": "The flag for prices that contain price components.",
3080
- "type": "boolean",
3081
- "enum": [
3082
- true
3083
- ]
3074
+ "type": "boolean"
3084
3075
  },
3085
3076
  "_created_at": {
3086
3077
  "description": "The price creation date",
@@ -3111,58 +3102,6 @@
3111
3102
  }
3112
3103
  }
3113
3104
  },
3114
- "NonHydratedCompositePrice": {
3115
- "allOf": [
3116
- {
3117
- "$ref": "#/components/schemas/BaseCompositePrice"
3118
- }
3119
- ],
3120
- "type": "object",
3121
- "description": "The composite price entity",
3122
- "properties": {
3123
- "price_components": {
3124
- "description": "A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.",
3125
- "type": "object",
3126
- "properties": {
3127
- "$relation": {
3128
- "type": "array",
3129
- "items": {
3130
- "$ref": "#/components/schemas/PriceComponentRelation"
3131
- }
3132
- }
3133
- }
3134
- }
3135
- }
3136
- },
3137
- "HydratedCompositePrice": {
3138
- "allOf": [
3139
- {
3140
- "$ref": "#/components/schemas/BaseCompositePrice"
3141
- }
3142
- ],
3143
- "type": "object",
3144
- "description": "The composite price entity",
3145
- "properties": {
3146
- "price_components": {
3147
- "description": "A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.",
3148
- "type": "array",
3149
- "items": {
3150
- "$ref": "#/components/schemas/Price"
3151
- }
3152
- }
3153
- }
3154
- },
3155
- "CompositePrice": {
3156
- "oneOf": [
3157
- {
3158
- "$ref": "#/components/schemas/NonHydratedCompositePrice"
3159
- },
3160
- {
3161
- "$ref": "#/components/schemas/HydratedCompositePrice"
3162
- }
3163
- ],
3164
- "description": "The composite price entity"
3165
- },
3166
3105
  "PriceComponentRelation": {
3167
3106
  "type": "object",
3168
3107
  "properties": {
@@ -4448,7 +4387,7 @@
4448
4387
  }
4449
4388
  }
4450
4389
  },
4451
- "PriceItemDtoUnion": {
4390
+ "PriceItemUnion": {
4452
4391
  "anyOf": [
4453
4392
  {
4454
4393
  "$ref": "#/components/schemas/PriceItemDto"
@@ -4469,7 +4408,7 @@
4469
4408
  "description": "A valid set of product prices, quantities, (discounts) and taxes from a client.",
4470
4409
  "type": "array",
4471
4410
  "items": {
4472
- "$ref": "#/components/schemas/PriceItemDtoUnion"
4411
+ "$ref": "#/components/schemas/PriceItemUnion"
4473
4412
  }
4474
4413
  },
4475
4414
  "BasePriceItemDto": {
@@ -4626,9 +4565,6 @@
4626
4565
  },
4627
4566
  {
4628
4567
  "type": "object",
4629
- "required": [
4630
- "is_composite_price"
4631
- ],
4632
4568
  "properties": {
4633
4569
  "is_composite_price": {
4634
4570
  "description": "The flag for prices that contain price components.",
@@ -4936,17 +4872,7 @@
4936
4872
  ],
4937
4873
  "description": "Represents a composite price input to the pricing library.",
4938
4874
  "type": "object",
4939
- "required": [
4940
- "is_composite_price"
4941
- ],
4942
4875
  "properties": {
4943
- "is_composite_price": {
4944
- "description": "The flag for prices that contain price components.",
4945
- "type": "boolean",
4946
- "enum": [
4947
- true
4948
- ]
4949
- },
4950
4876
  "item_components": {
4951
4877
  "type": "array",
4952
4878
  "description": "Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).",
@@ -5244,13 +5170,6 @@
5244
5170
  "recurring"
5245
5171
  ]
5246
5172
  },
5247
- "is_composite_price": {
5248
- "description": "The flag for prices that contain price components.",
5249
- "type": "boolean",
5250
- "enum": [
5251
- false
5252
- ]
5253
- },
5254
5173
  "billing_period": {
5255
5174
  "type": "string",
5256
5175
  "description": "The price billing period.",
@@ -5583,7 +5502,7 @@
5583
5502
  "matched_coupons": {
5584
5503
  "type": "array",
5585
5504
  "items": {
5586
- "$ref": "#/components/schemas/CouponWithoutPromoCodes"
5505
+ "$ref": "#/components/schemas/BaseCoupon"
5587
5506
  }
5588
5507
  }
5589
5508
  }
@@ -6032,9 +5951,9 @@
6032
5951
  }
6033
5952
  }
6034
5953
  },
6035
- "BaseCouponCommon": {
5954
+ "BaseCoupon": {
6036
5955
  "type": "object",
6037
- "description": "The shared properties for the coupon entity and coupon item entity",
5956
+ "description": "The coupon configuration",
6038
5957
  "additionalProperties": true,
6039
5958
  "required": [
6040
5959
  "name",
@@ -6043,9 +5962,7 @@
6043
5962
  "_org",
6044
5963
  "_schema",
6045
5964
  "_created_at",
6046
- "_updated_at",
6047
- "type",
6048
- "category"
5965
+ "_updated_at"
6049
5966
  ],
6050
5967
  "properties": {
6051
5968
  "_id": {
@@ -6146,18 +6063,7 @@
6146
6063
  "requires_promo_code": {
6147
6064
  "type": "boolean",
6148
6065
  "description": "Whether the coupon requires a promo code to be applied"
6149
- }
6150
- }
6151
- },
6152
- "CouponWithoutPromoCodes": {
6153
- "type": "object",
6154
- "description": "The base for the coupon entity without promo codes",
6155
- "allOf": [
6156
- {
6157
- "$ref": "#/components/schemas/BaseCouponCommon"
6158
- }
6159
- ],
6160
- "properties": {
6066
+ },
6161
6067
  "prices": {
6162
6068
  "description": "The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.",
6163
6069
  "oneOf": [
@@ -6209,10 +6115,9 @@
6209
6115
  }
6210
6116
  },
6211
6117
  "Coupon": {
6212
- "description": "The coupon entity",
6213
6118
  "allOf": [
6214
6119
  {
6215
- "$ref": "#/components/schemas/CouponWithoutPromoCodes"
6120
+ "$ref": "#/components/schemas/BaseCoupon"
6216
6121
  }
6217
6122
  ],
6218
6123
  "type": "object",
@@ -6234,9 +6139,117 @@
6234
6139
  },
6235
6140
  "CouponItem": {
6236
6141
  "type": "object",
6142
+ "required": [
6143
+ "type",
6144
+ "category",
6145
+ "_schema"
6146
+ ],
6147
+ "properties": {
6148
+ "_id": {
6149
+ "$ref": "#/components/schemas/EntityId",
6150
+ "readOnly": true
6151
+ },
6152
+ "_title": {
6153
+ "type": "string",
6154
+ "description": "The auto-generated title for the title",
6155
+ "readOnly": true
6156
+ },
6157
+ "_org": {
6158
+ "type": "string",
6159
+ "description": "Organization Id the entity belongs to",
6160
+ "readOnly": true
6161
+ },
6162
+ "_schema": {
6163
+ "type": "string",
6164
+ "enum": [
6165
+ "coupon"
6166
+ ],
6167
+ "readOnly": true,
6168
+ "description": "The schema of the entity, for coupons it is always `coupon`"
6169
+ },
6170
+ "_tags": {
6171
+ "type": "array",
6172
+ "items": {
6173
+ "type": "string"
6174
+ }
6175
+ },
6176
+ "_created_at": {
6177
+ "type": "string",
6178
+ "format": "date-time",
6179
+ "readOnly": true,
6180
+ "description": "The creation date for the opportunity"
6181
+ },
6182
+ "_updated_at": {
6183
+ "type": "string",
6184
+ "format": "date-time",
6185
+ "readOnly": true,
6186
+ "description": "The date the coupon was last updated"
6187
+ },
6188
+ "name": {
6189
+ "type": "string",
6190
+ "nullable": true
6191
+ },
6192
+ "description": {
6193
+ "type": "string",
6194
+ "nullable": true
6195
+ },
6196
+ "type": {
6197
+ "type": "string",
6198
+ "enum": [
6199
+ "fixed",
6200
+ "percentage"
6201
+ ]
6202
+ },
6203
+ "category": {
6204
+ "type": "string",
6205
+ "enum": [
6206
+ "discount",
6207
+ "cashback"
6208
+ ]
6209
+ },
6210
+ "percentage_value": {
6211
+ "type": "string",
6212
+ "description": "Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.",
6213
+ "nullable": true
6214
+ },
6215
+ "fixed_value": {
6216
+ "description": "Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.",
6217
+ "type": "number"
6218
+ },
6219
+ "fixed_value_decimal": {
6220
+ "description": "Use if type is set to fixed. The unit amount in cents to be discounted, represented as a decimal string with at most 12 decimal places.",
6221
+ "type": "string"
6222
+ },
6223
+ "fixed_value_currency": {
6224
+ "description": "Use if type is set to fixed. Three-letter ISO currency code, in lowercase.",
6225
+ "oneOf": [
6226
+ {
6227
+ "$ref": "#/components/schemas/Currency"
6228
+ }
6229
+ ]
6230
+ },
6231
+ "cashback_period": {
6232
+ "type": "string",
6233
+ "description": "The cashback period, for now it's limited to either 0 months or 12 months",
6234
+ "enum": [
6235
+ "0",
6236
+ "12"
6237
+ ],
6238
+ "nullable": true
6239
+ },
6240
+ "active": {
6241
+ "type": "boolean"
6242
+ },
6243
+ "requires_promo_code": {
6244
+ "type": "boolean",
6245
+ "description": "Whether the coupon requires a promo code to be applied"
6246
+ }
6247
+ }
6248
+ },
6249
+ "CouponWithoutPromoCodes": {
6237
6250
  "allOf": [
6238
6251
  {
6239
- "$ref": "#/components/schemas/BaseCouponCommon"
6252
+ "$ref": "#/components/schemas/BaseCoupon"
6240
6253
  }
6241
6254
  ]
6242
6255
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/pricing-client",
3
- "version": "3.47.9-alpha.5",
3
+ "version": "3.47.9-alpha.7",
4
4
  "description": "Client for epilot Pricing APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",