@epilot/pricing-client 3.16.0 → 3.16.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/dist/openapi.d.ts CHANGED
@@ -63,6 +63,24 @@ declare namespace Components {
63
63
  */
64
64
  title?: string | null;
65
65
  }
66
+ export interface Amounts {
67
+ /**
68
+ * Total of all items before (discounts or) taxes are applied.
69
+ */
70
+ amount_subtotal?: number;
71
+ /**
72
+ * Total of all items before (discounts or) taxes are applied, as a string with all the decimal places.
73
+ */
74
+ amount_subtotal_decimal?: string;
75
+ /**
76
+ * Total of all items after (discounts and) taxes are applied.
77
+ */
78
+ amount_total?: number;
79
+ /**
80
+ * Total of all items after (discounts and) taxes are applied, as a string with all the decimal places.
81
+ */
82
+ amount_total_decimal?: string;
83
+ }
66
84
  /**
67
85
  * Availability check request payload
68
86
  */
@@ -165,19 +183,39 @@ declare namespace Components {
165
183
  * }
166
184
  */
167
185
  export interface BasePriceItem {
186
+ /**
187
+ * Total of all items before (discounts or) taxes are applied.
188
+ */
189
+ amount_subtotal?: number;
190
+ /**
191
+ * Total of all items before (discounts or) taxes are applied, as a string with all the decimal places.
192
+ */
193
+ amount_subtotal_decimal?: string;
194
+ /**
195
+ * Total of all items after (discounts and) taxes are applied.
196
+ */
197
+ amount_total?: number;
198
+ /**
199
+ * Total of all items after (discounts and) taxes are applied, as a string with all the decimal places.
200
+ */
201
+ amount_total_decimal?: string;
168
202
  /**
169
203
  * price item id
170
204
  */
171
- id?: string;
205
+ _id?: string;
172
206
  metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
173
207
  /**
174
208
  * The unit amount value
175
209
  */
176
210
  unit_amount?: number;
177
211
  /**
178
- * Total before any (discounts or) taxes are applied.
212
+ * The unit gross amount value.
179
213
  */
180
- amount_subtotal?: number;
214
+ unit_amount_gross?: number;
215
+ /**
216
+ * Total tax amount for this line item.
217
+ */
218
+ amount_tax?: number;
181
219
  /**
182
220
  * Net unit amount without taxes or discounts.
183
221
  */
@@ -186,10 +224,6 @@ declare namespace Components {
186
224
  * The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
187
225
  */
188
226
  unit_amount_decimal?: string;
189
- /**
190
- * Total after (discounts and) taxes.
191
- */
192
- amount_total?: number;
193
227
  currency?: /**
194
228
  * Three-letter ISO currency code, in lowercase. Must be a supported currency.
195
229
  * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
@@ -252,6 +286,26 @@ declare namespace Components {
252
286
  * The sum of amounts of the price items by recurrence.
253
287
  */
254
288
  recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmount)[];
289
+ price_mappings?: /**
290
+ * example:
291
+ * [
292
+ * {
293
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
294
+ * "frequency_unit": "weekly",
295
+ * "value": 1000.245,
296
+ * "name": "avg consumption",
297
+ * "metadata": {
298
+ * "journey_title": "energy journey",
299
+ * "step_name": "avg consumption picker"
300
+ * }
301
+ * }
302
+ * ]
303
+ */
304
+ PriceInputMappings;
305
+ /**
306
+ * 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'.
307
+ */
308
+ on_request_approved?: boolean;
255
309
  }
256
310
  /**
257
311
  * Represents a valid base price item from a client.
@@ -262,6 +316,25 @@ declare namespace Components {
262
316
  * The quantity of products being purchased.
263
317
  */
264
318
  quantity?: number;
319
+ /**
320
+ * Price mapping information required to compute totals
321
+ */
322
+ price_mappings?: /**
323
+ * example:
324
+ * [
325
+ * {
326
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
327
+ * "frequency_unit": "weekly",
328
+ * "value": 1000.245,
329
+ * "name": "avg consumption",
330
+ * "metadata": {
331
+ * "journey_title": "energy journey",
332
+ * "step_name": "avg consumption picker"
333
+ * }
334
+ * }
335
+ * ]
336
+ */
337
+ PriceInputMappings;
265
338
  /**
266
339
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
267
340
  */
@@ -295,6 +368,10 @@ declare namespace Components {
295
368
  */
296
369
  _product?: {
297
370
  [name: string]: any;
371
+ /**
372
+ * The description for the product
373
+ */
374
+ description?: string;
298
375
  /**
299
376
  * The product code
300
377
  */
@@ -374,11 +451,27 @@ declare namespace Components {
374
451
  _updated_at?: string;
375
452
  };
376
453
  }
377
- export type BillingPeriod = "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time";
454
+ export type BillingPeriod = "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly";
378
455
  /**
379
456
  * Supports shopping for products and services until ready for checkout.
380
457
  */
381
458
  export interface Cart {
459
+ /**
460
+ * Total of all items before (discounts or) taxes are applied.
461
+ */
462
+ amount_subtotal?: number;
463
+ /**
464
+ * Total of all items before (discounts or) taxes are applied, as a string with all the decimal places.
465
+ */
466
+ amount_subtotal_decimal?: string;
467
+ /**
468
+ * Total of all items after (discounts and) taxes are applied.
469
+ */
470
+ amount_total?: number;
471
+ /**
472
+ * Total of all items after (discounts and) taxes are applied, as a string with all the decimal places.
473
+ */
474
+ amount_total_decimal?: string;
382
475
  /**
383
476
  * The cart identifier
384
477
  */
@@ -400,14 +493,6 @@ declare namespace Components {
400
493
  delivery_address?: Address;
401
494
  metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
402
495
  line_items?: /* Tracks a set of product prices, quantities, (discounts) and taxes. */ PriceItems;
403
- /**
404
- * Total of all items before (discounts or) taxes are applied.
405
- */
406
- amount_subtotal?: number;
407
- /**
408
- * Total of all items after (discounts and) taxes are applied.
409
- */
410
- amount_total?: number;
411
496
  total_details?: /* The total details with tax (and discount) aggregated totals. */ TotalDetails;
412
497
  created_at?: string; // date-time
413
498
  updated_at?: string; // date-time
@@ -648,19 +733,39 @@ declare namespace Components {
648
733
  * }
649
734
  */
650
735
  export interface CompositePriceItem {
736
+ /**
737
+ * Total of all items before (discounts or) taxes are applied.
738
+ */
739
+ amount_subtotal?: number;
740
+ /**
741
+ * Total of all items before (discounts or) taxes are applied, as a string with all the decimal places.
742
+ */
743
+ amount_subtotal_decimal?: string;
744
+ /**
745
+ * Total of all items after (discounts and) taxes are applied.
746
+ */
747
+ amount_total?: number;
748
+ /**
749
+ * Total of all items after (discounts and) taxes are applied, as a string with all the decimal places.
750
+ */
751
+ amount_total_decimal?: string;
651
752
  /**
652
753
  * price item id
653
754
  */
654
- id?: string;
755
+ _id?: string;
655
756
  metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
656
757
  /**
657
758
  * The unit amount value
658
759
  */
659
760
  unit_amount?: number;
660
761
  /**
661
- * Total before any (discounts or) taxes are applied.
762
+ * The unit gross amount value.
662
763
  */
663
- amount_subtotal?: number;
764
+ unit_amount_gross?: number;
765
+ /**
766
+ * Total tax amount for this line item.
767
+ */
768
+ amount_tax?: number;
664
769
  /**
665
770
  * Net unit amount without taxes or discounts.
666
771
  */
@@ -669,10 +774,6 @@ declare namespace Components {
669
774
  * The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
670
775
  */
671
776
  unit_amount_decimal?: string;
672
- /**
673
- * Total after (discounts and) taxes.
674
- */
675
- amount_total?: number;
676
777
  currency?: /**
677
778
  * Three-letter ISO currency code, in lowercase. Must be a supported currency.
678
779
  * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
@@ -735,6 +836,26 @@ declare namespace Components {
735
836
  * The sum of amounts of the price items by recurrence.
736
837
  */
737
838
  recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmount)[];
839
+ price_mappings?: /**
840
+ * example:
841
+ * [
842
+ * {
843
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
844
+ * "frequency_unit": "weekly",
845
+ * "value": 1000.245,
846
+ * "name": "avg consumption",
847
+ * "metadata": {
848
+ * "journey_title": "energy journey",
849
+ * "step_name": "avg consumption picker"
850
+ * }
851
+ * }
852
+ * ]
853
+ */
854
+ PriceInputMappings;
855
+ /**
856
+ * 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'.
857
+ */
858
+ on_request_approved?: boolean;
738
859
  /**
739
860
  * Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).
740
861
  */
@@ -746,6 +867,7 @@ declare namespace Components {
746
867
  * }
747
868
  */
748
869
  PriceItem[];
870
+ total_details?: /* The total details with tax (and discount) aggregated totals. */ TotalDetails;
749
871
  }
750
872
  /**
751
873
  * Represents a composite price input to the pricing library.
@@ -756,6 +878,22 @@ declare namespace Components {
756
878
  * The quantity of products being purchased.
757
879
  */
758
880
  quantity?: number;
881
+ price_mappings?: /**
882
+ * example:
883
+ * [
884
+ * {
885
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
886
+ * "frequency_unit": "weekly",
887
+ * "value": 1000.245,
888
+ * "name": "avg consumption",
889
+ * "metadata": {
890
+ * "journey_title": "energy journey",
891
+ * "step_name": "avg consumption picker"
892
+ * }
893
+ * }
894
+ * ]
895
+ */
896
+ PriceInputMappings;
759
897
  /**
760
898
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
761
899
  */
@@ -789,6 +927,10 @@ declare namespace Components {
789
927
  */
790
928
  _product?: {
791
929
  [name: string]: any;
930
+ /**
931
+ * The description for the product
932
+ */
933
+ description?: string;
792
934
  /**
793
935
  * The product code
794
936
  */
@@ -1319,7 +1461,7 @@ declare namespace Components {
1319
1461
  *
1320
1462
  */
1321
1463
  OrderStatus;
1322
- line_items?: /* Tracks a set of product prices, quantities, (discounts) and taxes. */ PriceItems;
1464
+ line_items?: /* A valid set of product prices, quantities, (discounts) and taxes from a client. */ PriceItemsDto;
1323
1465
  /**
1324
1466
  * type of source, e.g. journey or manual
1325
1467
  * example:
@@ -1426,18 +1568,27 @@ declare namespace Components {
1426
1568
  */
1427
1569
  is_composite_price?: boolean;
1428
1570
  /**
1429
- * Describes how to compute the price per period. Either `per_unit` or `tiered`.
1571
+ * Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.
1430
1572
  * - `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity
1431
- * - `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes.
1573
+ * - `tiered_graduated` indicates that the unit pricing will be computed using tiers attribute. The customer pays the price per unit in every range their purchase rises through.
1574
+ * - `tiered_volume` indicates that the unit pricing will be computed using tiers attribute. The customer pays the same unit price for all purchased units.
1575
+ * - `tiered_flatfee` While similar to tiered_volume, tiered flat fee charges for the same price (flat) for the entire range instead using the unit price to multiply the quantity.
1432
1576
  *
1433
- * ⚠️ Tiered pricing is **not supported** yet.
1577
+ */
1578
+ pricing_model: "per_unit" | "tiered_graduated" | "tiered_volume" | "tiered_flatfee";
1579
+ /**
1580
+ * Defines an array of tiers. Each tier has an upper bound, an unit amount and a flat fee.
1434
1581
  *
1435
1582
  */
1436
- billing_scheme?: "per_unit";
1583
+ tiers?: PriceTier[];
1437
1584
  /**
1438
1585
  * A brief description of the price.
1439
1586
  */
1440
1587
  description?: string;
1588
+ /**
1589
+ * A detailed description of the price. This is shown on the order document and order table.
1590
+ */
1591
+ long_description?: string;
1441
1592
  /**
1442
1593
  * The default tax rate applicable to the product.
1443
1594
  * This field is deprecated, use the new `tax` attribute.
@@ -1461,7 +1612,6 @@ declare namespace Components {
1461
1612
  * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1462
1613
  * "type": "VAT",
1463
1614
  * "description": "Tax description",
1464
- * "behavior": "Exclusive",
1465
1615
  * "active": "true",
1466
1616
  * "region": "DE",
1467
1617
  * "region_label": "Germany",
@@ -1477,15 +1627,9 @@ declare namespace Components {
1477
1627
  */
1478
1628
  Tax[];
1479
1629
  /**
1480
- * Specifies whether the price is considered `inclusive` of taxes or `exclusive` of taxes.
1481
- * One of `inclusive`, `exclusive`, or `unspecified`.
1482
- *
1630
+ * Specifies whether the price is considered `inclusive` of taxes or not.
1483
1631
  */
1484
- tax_behavior?: "inclusive" | "exclusive";
1485
- /**
1486
- * Defines the tiered pricing type of the price.
1487
- */
1488
- tiers_mode?: "standard";
1632
+ is_tax_inclusive?: boolean;
1489
1633
  /**
1490
1634
  * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
1491
1635
  */
@@ -1556,7 +1700,7 @@ declare namespace Components {
1556
1700
  /**
1557
1701
  * The unit of measurement used for display purposes and possibly for calculations when the price is variable.
1558
1702
  */
1559
- unit?: /* The unit of measurement used for display purposes and possibly for calculations when the price is variable. */ ("kw" | "kwh" | "m" | "m2" | "l") | string;
1703
+ unit?: /* The unit of measurement used for display purposes and possibly for calculations when the price is variable. */ ("kw" | "kwh" | "m" | "m2" | "l" | "cubic-meter" | "cubic-meter-h" | "ls" | "a" | "kva" | "w" | "wp" | "kwp") | string;
1560
1704
  /**
1561
1705
  * The price creation date
1562
1706
  */
@@ -1598,6 +1742,57 @@ declare namespace Components {
1598
1742
  */
1599
1743
  _tags?: string[];
1600
1744
  }
1745
+ /**
1746
+ * example:
1747
+ * {
1748
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1749
+ * "frequency_unit": "weekly",
1750
+ * "value": 1000.245,
1751
+ * "name": "avg consumption",
1752
+ * "metadata": {
1753
+ * "journey_title": "energy journey",
1754
+ * "step_name": "avg consumption picker"
1755
+ * }
1756
+ * }
1757
+ */
1758
+ export interface PriceInputMapping {
1759
+ price_id?: string;
1760
+ frequency_unit?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time";
1761
+ name?: string;
1762
+ value?: number;
1763
+ metadata?: {
1764
+ [name: string]: string;
1765
+ };
1766
+ }
1767
+ /**
1768
+ * example:
1769
+ * [
1770
+ * {
1771
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1772
+ * "frequency_unit": "weekly",
1773
+ * "value": 1000.245,
1774
+ * "name": "avg consumption",
1775
+ * "metadata": {
1776
+ * "journey_title": "energy journey",
1777
+ * "step_name": "avg consumption picker"
1778
+ * }
1779
+ * }
1780
+ * ]
1781
+ */
1782
+ export type PriceInputMappings = /**
1783
+ * example:
1784
+ * {
1785
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1786
+ * "frequency_unit": "weekly",
1787
+ * "value": 1000.245,
1788
+ * "name": "avg consumption",
1789
+ * "metadata": {
1790
+ * "journey_title": "energy journey",
1791
+ * "step_name": "avg consumption picker"
1792
+ * }
1793
+ * }
1794
+ */
1795
+ PriceInputMapping[];
1601
1796
  /**
1602
1797
  * Represents a price item
1603
1798
  * example:
@@ -1606,19 +1801,39 @@ declare namespace Components {
1606
1801
  * }
1607
1802
  */
1608
1803
  export interface PriceItem {
1804
+ /**
1805
+ * Total of all items before (discounts or) taxes are applied.
1806
+ */
1807
+ amount_subtotal?: number;
1808
+ /**
1809
+ * Total of all items before (discounts or) taxes are applied, as a string with all the decimal places.
1810
+ */
1811
+ amount_subtotal_decimal?: string;
1812
+ /**
1813
+ * Total of all items after (discounts and) taxes are applied.
1814
+ */
1815
+ amount_total?: number;
1816
+ /**
1817
+ * Total of all items after (discounts and) taxes are applied, as a string with all the decimal places.
1818
+ */
1819
+ amount_total_decimal?: string;
1609
1820
  /**
1610
1821
  * price item id
1611
1822
  */
1612
- id?: string;
1823
+ _id?: string;
1613
1824
  metadata?: /* A set of key-value pairs used to store meta data information about an entity. */ MetaData;
1614
1825
  /**
1615
1826
  * The unit amount value
1616
1827
  */
1617
1828
  unit_amount?: number;
1618
1829
  /**
1619
- * Total before any (discounts or) taxes are applied.
1830
+ * The unit gross amount value.
1620
1831
  */
1621
- amount_subtotal?: number;
1832
+ unit_amount_gross?: number;
1833
+ /**
1834
+ * Total tax amount for this line item.
1835
+ */
1836
+ amount_tax?: number;
1622
1837
  /**
1623
1838
  * Net unit amount without taxes or discounts.
1624
1839
  */
@@ -1627,10 +1842,6 @@ declare namespace Components {
1627
1842
  * The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
1628
1843
  */
1629
1844
  unit_amount_decimal?: string;
1630
- /**
1631
- * Total after (discounts and) taxes.
1632
- */
1633
- amount_total?: number;
1634
1845
  currency?: /**
1635
1846
  * Three-letter ISO currency code, in lowercase. Must be a supported currency.
1636
1847
  * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
@@ -1693,14 +1904,39 @@ declare namespace Components {
1693
1904
  * The sum of amounts of the price items by recurrence.
1694
1905
  */
1695
1906
  recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmount)[];
1907
+ price_mappings?: /**
1908
+ * example:
1909
+ * [
1910
+ * {
1911
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1912
+ * "frequency_unit": "weekly",
1913
+ * "value": 1000.245,
1914
+ * "name": "avg consumption",
1915
+ * "metadata": {
1916
+ * "journey_title": "energy journey",
1917
+ * "step_name": "avg consumption picker"
1918
+ * }
1919
+ * }
1920
+ * ]
1921
+ */
1922
+ PriceInputMappings;
1923
+ /**
1924
+ * 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'.
1925
+ */
1926
+ on_request_approved?: boolean;
1696
1927
  /**
1697
1928
  * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
1698
1929
  */
1699
1930
  type?: "one_time" | "recurring";
1700
1931
  /**
1701
- * 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'.
1932
+ * Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.
1933
+ * - `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity
1934
+ * - `tiered_graduated` indicates that the unit pricing will be computed using tiers attribute. The customer pays the price per unit in every range their purchase rises through.
1935
+ * - `tiered_volume` indicates that the unit pricing will be computed using tiers attribute. The customer pays the same unit price for all purchased units.
1936
+ * - `tiered_flatfee` While similar to tiered_volume, tiered flat fee charges for the same price (flat) for the entire range instead using the unit price to multiply the quantity.
1937
+ *
1702
1938
  */
1703
- on_request_approved?: boolean;
1939
+ pricing_model: "per_unit" | "tiered_graduated" | "tiered_volume" | "tiered_flatfee";
1704
1940
  }
1705
1941
  /**
1706
1942
  * Represents a price input to the pricing library.
@@ -1711,6 +1947,22 @@ declare namespace Components {
1711
1947
  * The quantity of products being purchased.
1712
1948
  */
1713
1949
  quantity?: number;
1950
+ price_mappings?: /**
1951
+ * example:
1952
+ * [
1953
+ * {
1954
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1955
+ * "frequency_unit": "weekly",
1956
+ * "value": 1000.245,
1957
+ * "name": "avg consumption",
1958
+ * "metadata": {
1959
+ * "journey_title": "energy journey",
1960
+ * "step_name": "avg consumption picker"
1961
+ * }
1962
+ * }
1963
+ * ]
1964
+ */
1965
+ PriceInputMappings;
1714
1966
  /**
1715
1967
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
1716
1968
  */
@@ -1744,6 +1996,10 @@ declare namespace Components {
1744
1996
  */
1745
1997
  _product?: {
1746
1998
  [name: string]: any;
1999
+ /**
2000
+ * The description for the product
2001
+ */
2002
+ description?: string;
1747
2003
  /**
1748
2004
  * The product code
1749
2005
  */
@@ -1830,10 +2086,31 @@ declare namespace Components {
1830
2086
  * The unit amount value
1831
2087
  */
1832
2088
  unit_amount?: number;
2089
+ /**
2090
+ * The unit gross amount value.
2091
+ */
2092
+ unit_amount_gross?: number;
2093
+ unit_amount_currency?: /**
2094
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
2095
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
2096
+ *
2097
+ * example:
2098
+ * EUR
2099
+ */
2100
+ Currency;
1833
2101
  /**
1834
2102
  * The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
1835
2103
  */
1836
2104
  unit_amount_decimal?: string;
2105
+ /**
2106
+ * Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.
2107
+ * - `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity
2108
+ * - `tiered_graduated` indicates that the unit pricing will be computed using tiers attribute. The customer pays the price per unit in every range their purchase rises through.
2109
+ * - `tiered_volume` indicates that the unit pricing will be computed using tiers attribute. The customer pays the same unit price for all purchased units.
2110
+ * - `tiered_flatfee` indicates that the unit pricing will be computed using tiers attribute. The customer pays the same unit price for all purchased units.
2111
+ *
2112
+ */
2113
+ pricing_model: "per_unit" | "tiered_graduated" | "tiered_volume" | "tiered_flatfee";
1837
2114
  /**
1838
2115
  * The snapshot of the price linked to the price item.
1839
2116
  * example:
@@ -1852,18 +2129,27 @@ declare namespace Components {
1852
2129
  */
1853
2130
  is_composite_price?: boolean;
1854
2131
  /**
1855
- * Describes how to compute the price per period. Either `per_unit` or `tiered`.
2132
+ * Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.
1856
2133
  * - `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity
1857
- * - `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes.
2134
+ * - `tiered_graduated` indicates that the unit pricing will be computed using tiers attribute. The customer pays the price per unit in every range their purchase rises through.
2135
+ * - `tiered_volume` indicates that the unit pricing will be computed using tiers attribute. The customer pays the same unit price for all purchased units.
2136
+ * - `tiered_flatfee` While similar to tiered_volume, tiered flat fee charges for the same price (flat) for the entire range instead using the unit price to multiply the quantity.
1858
2137
  *
1859
- * ⚠️ Tiered pricing is **not supported** yet.
2138
+ */
2139
+ pricing_model: "per_unit" | "tiered_graduated" | "tiered_volume" | "tiered_flatfee";
2140
+ /**
2141
+ * Defines an array of tiers. Each tier has an upper bound, an unit amount and a flat fee.
1860
2142
  *
1861
2143
  */
1862
- billing_scheme?: "per_unit";
2144
+ tiers?: PriceTier[];
1863
2145
  /**
1864
2146
  * A brief description of the price.
1865
2147
  */
1866
2148
  description?: string;
2149
+ /**
2150
+ * A detailed description of the price. This is shown on the order document and order table.
2151
+ */
2152
+ long_description?: string;
1867
2153
  /**
1868
2154
  * The default tax rate applicable to the product.
1869
2155
  * This field is deprecated, use the new `tax` attribute.
@@ -1887,7 +2173,6 @@ declare namespace Components {
1887
2173
  * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
1888
2174
  * "type": "VAT",
1889
2175
  * "description": "Tax description",
1890
- * "behavior": "Exclusive",
1891
2176
  * "active": "true",
1892
2177
  * "region": "DE",
1893
2178
  * "region_label": "Germany",
@@ -1903,15 +2188,9 @@ declare namespace Components {
1903
2188
  */
1904
2189
  Tax[];
1905
2190
  /**
1906
- * Specifies whether the price is considered `inclusive` of taxes or `exclusive` of taxes.
1907
- * One of `inclusive`, `exclusive`, or `unspecified`.
1908
- *
2191
+ * Specifies whether the price is considered `inclusive` of taxes or not.
1909
2192
  */
1910
- tax_behavior?: "inclusive" | "exclusive";
1911
- /**
1912
- * Defines the tiered pricing type of the price.
1913
- */
1914
- tiers_mode?: "standard";
2193
+ is_tax_inclusive?: boolean;
1915
2194
  /**
1916
2195
  * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
1917
2196
  */
@@ -1982,7 +2261,7 @@ declare namespace Components {
1982
2261
  /**
1983
2262
  * The unit of measurement used for display purposes and possibly for calculations when the price is variable.
1984
2263
  */
1985
- unit?: /* The unit of measurement used for display purposes and possibly for calculations when the price is variable. */ ("kw" | "kwh" | "m" | "m2" | "l") | string;
2264
+ unit?: /* The unit of measurement used for display purposes and possibly for calculations when the price is variable. */ ("kw" | "kwh" | "m" | "m2" | "l" | "cubic-meter" | "cubic-meter-h" | "ls" | "a" | "kva" | "w" | "wp" | "kwp") | string;
1986
2265
  /**
1987
2266
  * The price creation date
1988
2267
  */
@@ -2030,7 +2309,16 @@ declare namespace Components {
2030
2309
  /**
2031
2310
  * A valid set of product prices, quantities, (discounts) and taxes from a client.
2032
2311
  */
2033
- export type PriceItemsDto = (/* Represents a price input to the pricing library. */ PriceItemDto)[];
2312
+ export type PriceItemsDto = (/* Represents a price input to the pricing library. */ PriceItemDto | /* Represents a composite price input to the pricing library. */ CompositePriceItemDto)[];
2313
+ export interface PriceTier {
2314
+ up_to?: number | null;
2315
+ flat_fee_amount?: number;
2316
+ flat_fee_amount_decimal?: string;
2317
+ unit_amount?: number;
2318
+ unit_amount_decimal?: string;
2319
+ display_mode?: PriceTierDisplayMode;
2320
+ }
2321
+ export type PriceTierDisplayMode = "hidden" | "on_request";
2034
2322
  /**
2035
2323
  * The result from the calculation of a set of price items.
2036
2324
  */
@@ -2042,7 +2330,14 @@ declare namespace Components {
2042
2330
  * "$ref": "#/components/examples/price-item"
2043
2331
  * }
2044
2332
  */
2045
- PriceItem)[];
2333
+ PriceItem | /**
2334
+ * Represents a composite price input to the pricing library.
2335
+ * example:
2336
+ * {
2337
+ * "$ref": "#/components/examples/price-item"
2338
+ * }
2339
+ */
2340
+ CompositePriceItem)[];
2046
2341
  /**
2047
2342
  * Total of all items before (discounts or) taxes are applied.
2048
2343
  */
@@ -2051,7 +2346,23 @@ declare namespace Components {
2051
2346
  * Total of all items after (discounts and) taxes are applied.
2052
2347
  */
2053
2348
  amount_total?: number;
2349
+ /**
2350
+ * The unit gross amount value.
2351
+ */
2352
+ unit_amount_gross?: number;
2353
+ /**
2354
+ * This is the sum of all the price item tax amounts.
2355
+ */
2356
+ amount_tax?: number;
2054
2357
  total_details?: /* The total details with tax (and discount) aggregated totals. */ TotalDetails;
2358
+ currency?: /**
2359
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
2360
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
2361
+ *
2362
+ * example:
2363
+ * EUR
2364
+ */
2365
+ Currency;
2055
2366
  }
2056
2367
  /**
2057
2368
  * The product entity
@@ -2062,6 +2373,10 @@ declare namespace Components {
2062
2373
  */
2063
2374
  export interface Product {
2064
2375
  [name: string]: any;
2376
+ /**
2377
+ * The description for the product
2378
+ */
2379
+ description?: string;
2065
2380
  /**
2066
2381
  * The product code
2067
2382
  */
@@ -2144,6 +2459,22 @@ declare namespace Components {
2144
2459
  * An amount associated with a specific recurrence.
2145
2460
  */
2146
2461
  export interface RecurrenceAmount {
2462
+ /**
2463
+ * Total of all items before (discounts or) taxes are applied.
2464
+ */
2465
+ amount_subtotal: number;
2466
+ /**
2467
+ * Total of all items before (discounts or) taxes are applied, as a string with all the decimal places.
2468
+ */
2469
+ amount_subtotal_decimal: string;
2470
+ /**
2471
+ * Total of all items after (discounts and) taxes are applied.
2472
+ */
2473
+ amount_total: number;
2474
+ /**
2475
+ * Total of all items after (discounts and) taxes are applied, as a string with all the decimal places.
2476
+ */
2477
+ amount_total_decimal: string;
2147
2478
  /**
2148
2479
  * The price type.
2149
2480
  */
@@ -2151,24 +2482,44 @@ declare namespace Components {
2151
2482
  /**
2152
2483
  * The price billing period.
2153
2484
  */
2154
- billing_period?: string;
2155
- /**
2156
- * Total of all items, with same recurrence, before (discounts or) taxes are applied.
2157
- */
2158
- amount_subtotal: number;
2485
+ billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly";
2159
2486
  /**
2160
- * Total of all items, with same recurrence, after (discounts and) taxes are applied.
2487
+ * The unit gross amount value.
2161
2488
  */
2162
- amount_total: number;
2489
+ unit_amount_gross?: number;
2163
2490
  /**
2164
2491
  * Total of all items taxes, with same recurrence.
2165
2492
  */
2166
2493
  amount_tax?: number;
2494
+ currency?: /**
2495
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
2496
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
2497
+ *
2498
+ * example:
2499
+ * EUR
2500
+ */
2501
+ Currency;
2167
2502
  }
2168
2503
  /**
2169
2504
  * An amount associated with a specific recurrence.
2170
2505
  */
2171
2506
  export interface RecurrenceAmountDto {
2507
+ /**
2508
+ * Total of all items before (discounts or) taxes are applied.
2509
+ */
2510
+ amount_subtotal: number;
2511
+ /**
2512
+ * Total of all items before (discounts or) taxes are applied, as a string with all the decimal places.
2513
+ */
2514
+ amount_subtotal_decimal: string;
2515
+ /**
2516
+ * Total of all items after (discounts and) taxes are applied.
2517
+ */
2518
+ amount_total: number;
2519
+ /**
2520
+ * Total of all items after (discounts and) taxes are applied, as a string with all the decimal places.
2521
+ */
2522
+ amount_total_decimal: string;
2172
2523
  /**
2173
2524
  * The price type.
2174
2525
  */
@@ -2176,15 +2527,11 @@ declare namespace Components {
2176
2527
  /**
2177
2528
  * The price billing period.
2178
2529
  */
2179
- billing_period?: string;
2530
+ billing_period?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly";
2180
2531
  /**
2181
- * Total of all items, with same recurrence, before (discounts or) taxes are applied.
2532
+ * The unit gross amount value.
2182
2533
  */
2183
- amount_subtotal: number;
2184
- /**
2185
- * Total of all items, with same recurrence, after (discounts and) taxes are applied.
2186
- */
2187
- amount_total: number;
2534
+ unit_amount_gross?: number;
2188
2535
  /**
2189
2536
  * Total of all items taxes, with same recurrence.
2190
2537
  */
@@ -2198,7 +2545,6 @@ declare namespace Components {
2198
2545
  * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
2199
2546
  * "type": "VAT",
2200
2547
  * "description": "Tax description",
2201
- * "behavior": "Exclusive",
2202
2548
  * "active": "true",
2203
2549
  * "region": "DE",
2204
2550
  * "region_label": "Germany",
@@ -2230,7 +2576,6 @@ declare namespace Components {
2230
2576
  type: "VAT" | "GST" | "Custom";
2231
2577
  description?: string;
2232
2578
  rate: number;
2233
- behavior: "Exclusive" | "Inclusive" | "exclusive" | "inclusive";
2234
2579
  active?: boolean;
2235
2580
  region?: string;
2236
2581
  region_label?: string;
@@ -2265,7 +2610,6 @@ declare namespace Components {
2265
2610
  * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
2266
2611
  * "type": "VAT",
2267
2612
  * "description": "Tax description",
2268
- * "behavior": "Exclusive",
2269
2613
  * "active": "true",
2270
2614
  * "region": "DE",
2271
2615
  * "region_label": "Germany",
@@ -2316,7 +2660,6 @@ declare namespace Components {
2316
2660
  * "_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
2317
2661
  * "type": "VAT",
2318
2662
  * "description": "Tax description",
2319
- * "behavior": "Exclusive",
2320
2663
  * "active": "true",
2321
2664
  * "region": "DE",
2322
2665
  * "region_label": "Germany",
@@ -2363,6 +2706,49 @@ declare namespace Components {
2363
2706
  recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmount)[];
2364
2707
  };
2365
2708
  }
2709
+ /**
2710
+ * The availability rule error
2711
+ */
2712
+ export interface ValidateAvailabilityFileError {
2713
+ /**
2714
+ * The line number where the error was found
2715
+ */
2716
+ line?: number;
2717
+ /**
2718
+ * The error message
2719
+ */
2720
+ msg: string;
2721
+ /**
2722
+ * Data related to the error
2723
+ */
2724
+ data?: string;
2725
+ }
2726
+ /**
2727
+ * The availability map file result payload
2728
+ * example:
2729
+ * {
2730
+ * "rules_parsed_count": 8,
2731
+ * "errors": [
2732
+ * "File must be UTF-8 encoded",
2733
+ * "Error on line 3 - street_number must be of type number",
2734
+ * "Error on line 6 - start_date cant be greater than end_date"
2735
+ * ]
2736
+ * }
2737
+ */
2738
+ export interface ValidateAvailabilityFileResult {
2739
+ /**
2740
+ * The status of the validation
2741
+ */
2742
+ status: "success" | "error";
2743
+ /**
2744
+ * The number of rules successfully parsed
2745
+ */
2746
+ rules_parsed_count: number;
2747
+ /**
2748
+ * The errors found on the file
2749
+ */
2750
+ errors: /* The availability rule error */ ValidateAvailabilityFileError[];
2751
+ }
2366
2752
  }
2367
2753
  }
2368
2754
  declare namespace Paths {
@@ -2487,6 +2873,34 @@ declare namespace Paths {
2487
2873
  export type $400 = Components.Schemas.Error;
2488
2874
  }
2489
2875
  }
2876
+ namespace $ValidateAvailabilityFile {
2877
+ export interface HeaderParameters {
2878
+ "X-Epilot-Org-ID": Parameters.XEpilotOrgID;
2879
+ }
2880
+ namespace Parameters {
2881
+ export type Id = string;
2882
+ export type XEpilotOrgID = string;
2883
+ }
2884
+ export interface PathParameters {
2885
+ id: Parameters.Id;
2886
+ }
2887
+ namespace Responses {
2888
+ export type $200 = /**
2889
+ * The availability map file result payload
2890
+ * example:
2891
+ * {
2892
+ * "rules_parsed_count": 8,
2893
+ * "errors": [
2894
+ * "File must be UTF-8 encoded",
2895
+ * "Error on line 3 - street_number must be of type number",
2896
+ * "Error on line 6 - start_date cant be greater than end_date"
2897
+ * ]
2898
+ * }
2899
+ */
2900
+ Components.Schemas.ValidateAvailabilityFileResult;
2901
+ export type $400 = Components.Schemas.Error;
2902
+ }
2903
+ }
2490
2904
  namespace CreateOrder {
2491
2905
  export type RequestBody = /* Order Entity Payload */ Components.Schemas.OrderPayload;
2492
2906
  namespace Responses {
@@ -2585,6 +2999,16 @@ export interface OperationMethods {
2585
2999
  data?: Paths.$AvailabilityCheck.RequestBody,
2586
3000
  config?: AxiosRequestConfig
2587
3001
  ): OperationResponse<Paths.$AvailabilityCheck.Responses.$200>
3002
+ /**
3003
+ * $validateAvailabilityFile - validateAvailabilityFile
3004
+ *
3005
+ * Validates an availability file, it returns an array of errors if the file is invalid
3006
+ */
3007
+ '$validateAvailabilityFile'(
3008
+ parameters?: Parameters<Paths.$ValidateAvailabilityFile.PathParameters & Paths.$ValidateAvailabilityFile.HeaderParameters> | null,
3009
+ data?: any,
3010
+ config?: AxiosRequestConfig
3011
+ ): OperationResponse<Paths.$ValidateAvailabilityFile.Responses.$200>
2588
3012
  /**
2589
3013
  * $createOpportunity - createOpportunity
2590
3014
  *
@@ -2673,6 +3097,18 @@ export interface PathsDictionary {
2673
3097
  config?: AxiosRequestConfig
2674
3098
  ): OperationResponse<Paths.$AvailabilityCheck.Responses.$200>
2675
3099
  }
3100
+ ['/v1/validate-availability/{id}']: {
3101
+ /**
3102
+ * $validateAvailabilityFile - validateAvailabilityFile
3103
+ *
3104
+ * Validates an availability file, it returns an array of errors if the file is invalid
3105
+ */
3106
+ 'get'(
3107
+ parameters?: Parameters<Paths.$ValidateAvailabilityFile.PathParameters & Paths.$ValidateAvailabilityFile.HeaderParameters> | null,
3108
+ data?: any,
3109
+ config?: AxiosRequestConfig
3110
+ ): OperationResponse<Paths.$ValidateAvailabilityFile.Responses.$200>
3111
+ }
2676
3112
  ['/v1/public/opportunity']: {
2677
3113
  /**
2678
3114
  * $createOpportunity - createOpportunity