@epilot/pricing-client 2.1.9 → 2.2.1

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
@@ -252,6 +252,25 @@ declare namespace Components {
252
252
  * The sum of amounts of the price items by recurrence.
253
253
  */
254
254
  recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmount)[];
255
+ /**
256
+ * Price mapping information required to compute totals
257
+ */
258
+ price_mappings?: /**
259
+ * example:
260
+ * [
261
+ * {
262
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
263
+ * "frequency_unit": "weekly",
264
+ * "value": 1000.245,
265
+ * "name": "avg consumption",
266
+ * "metadata": {
267
+ * "journey_title": "energy journey",
268
+ * "step_name": "avg consumption picker"
269
+ * }
270
+ * }
271
+ * ]
272
+ */
273
+ PriceInputMappings;
255
274
  }
256
275
  /**
257
276
  * Represents a valid base price item from a client.
@@ -262,6 +281,25 @@ declare namespace Components {
262
281
  * The quantity of products being purchased.
263
282
  */
264
283
  quantity?: number;
284
+ /**
285
+ * Price mapping information required to compute totals
286
+ */
287
+ price_mappings?: /**
288
+ * example:
289
+ * [
290
+ * {
291
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
292
+ * "frequency_unit": "weekly",
293
+ * "value": 1000.245,
294
+ * "name": "avg consumption",
295
+ * "metadata": {
296
+ * "journey_title": "energy journey",
297
+ * "step_name": "avg consumption picker"
298
+ * }
299
+ * }
300
+ * ]
301
+ */
302
+ PriceInputMappings;
265
303
  /**
266
304
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
267
305
  */
@@ -735,6 +773,22 @@ declare namespace Components {
735
773
  * The sum of amounts of the price items by recurrence.
736
774
  */
737
775
  recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmount)[];
776
+ price_mappings?: /**
777
+ * example:
778
+ * [
779
+ * {
780
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
781
+ * "frequency_unit": "weekly",
782
+ * "value": 1000.245,
783
+ * "name": "avg consumption",
784
+ * "metadata": {
785
+ * "journey_title": "energy journey",
786
+ * "step_name": "avg consumption picker"
787
+ * }
788
+ * }
789
+ * ]
790
+ */
791
+ PriceInputMappings;
738
792
  /**
739
793
  * Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).
740
794
  */
@@ -756,6 +810,22 @@ declare namespace Components {
756
810
  * The quantity of products being purchased.
757
811
  */
758
812
  quantity?: number;
813
+ price_mappings?: /**
814
+ * example:
815
+ * [
816
+ * {
817
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
818
+ * "frequency_unit": "weekly",
819
+ * "value": 1000.245,
820
+ * "name": "avg consumption",
821
+ * "metadata": {
822
+ * "journey_title": "energy journey",
823
+ * "step_name": "avg consumption picker"
824
+ * }
825
+ * }
826
+ * ]
827
+ */
828
+ PriceInputMappings;
759
829
  /**
760
830
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
761
831
  */
@@ -1319,7 +1389,7 @@ declare namespace Components {
1319
1389
  *
1320
1390
  */
1321
1391
  OrderStatus;
1322
- line_items?: /* Tracks a set of product prices, quantities, (discounts) and taxes. */ PriceItems;
1392
+ line_items?: /* A valid set of product prices, quantities, (discounts) and taxes from a client. */ PriceItemsDto;
1323
1393
  /**
1324
1394
  * type of source, e.g. journey or manual
1325
1395
  * example:
@@ -1549,6 +1619,14 @@ declare namespace Components {
1549
1619
  * The renewal period duration unit
1550
1620
  */
1551
1621
  renewal_duration_unit?: "weeks" | "months" | "years";
1622
+ /**
1623
+ * The flag for prices that can be influenced by external variables such as user input.
1624
+ */
1625
+ variable_price?: boolean;
1626
+ /**
1627
+ * The unit of measurement used for display purposes and possibly for calculations when the price is variable.
1628
+ */
1629
+ unit?: /* The unit of measurement used for display purposes and possibly for calculations when the price is variable. */ ("kw" | "kwh" | "m" | "m2" | "l") | string;
1552
1630
  /**
1553
1631
  * The price creation date
1554
1632
  */
@@ -1590,6 +1668,57 @@ declare namespace Components {
1590
1668
  */
1591
1669
  _tags?: string[];
1592
1670
  }
1671
+ /**
1672
+ * example:
1673
+ * {
1674
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1675
+ * "frequency_unit": "weekly",
1676
+ * "value": 1000.245,
1677
+ * "name": "avg consumption",
1678
+ * "metadata": {
1679
+ * "journey_title": "energy journey",
1680
+ * "step_name": "avg consumption picker"
1681
+ * }
1682
+ * }
1683
+ */
1684
+ export interface PriceInputMapping {
1685
+ price_id?: string;
1686
+ frequency_unit?: "weekly" | "monthly" | "every_quarter" | "every_6_months" | "yearly" | "one_time";
1687
+ name?: string;
1688
+ value?: number;
1689
+ metadata?: {
1690
+ [name: string]: string;
1691
+ };
1692
+ }
1693
+ /**
1694
+ * example:
1695
+ * [
1696
+ * {
1697
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1698
+ * "frequency_unit": "weekly",
1699
+ * "value": 1000.245,
1700
+ * "name": "avg consumption",
1701
+ * "metadata": {
1702
+ * "journey_title": "energy journey",
1703
+ * "step_name": "avg consumption picker"
1704
+ * }
1705
+ * }
1706
+ * ]
1707
+ */
1708
+ export type PriceInputMappings = /**
1709
+ * example:
1710
+ * {
1711
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1712
+ * "frequency_unit": "weekly",
1713
+ * "value": 1000.245,
1714
+ * "name": "avg consumption",
1715
+ * "metadata": {
1716
+ * "journey_title": "energy journey",
1717
+ * "step_name": "avg consumption picker"
1718
+ * }
1719
+ * }
1720
+ */
1721
+ PriceInputMapping[];
1593
1722
  /**
1594
1723
  * Represents a price item
1595
1724
  * example:
@@ -1685,6 +1814,22 @@ declare namespace Components {
1685
1814
  * The sum of amounts of the price items by recurrence.
1686
1815
  */
1687
1816
  recurrences?: (/* An amount associated with a specific recurrence. */ RecurrenceAmount)[];
1817
+ price_mappings?: /**
1818
+ * example:
1819
+ * [
1820
+ * {
1821
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1822
+ * "frequency_unit": "weekly",
1823
+ * "value": 1000.245,
1824
+ * "name": "avg consumption",
1825
+ * "metadata": {
1826
+ * "journey_title": "energy journey",
1827
+ * "step_name": "avg consumption picker"
1828
+ * }
1829
+ * }
1830
+ * ]
1831
+ */
1832
+ PriceInputMappings;
1688
1833
  /**
1689
1834
  * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
1690
1835
  */
@@ -1703,6 +1848,22 @@ declare namespace Components {
1703
1848
  * The quantity of products being purchased.
1704
1849
  */
1705
1850
  quantity?: number;
1851
+ price_mappings?: /**
1852
+ * example:
1853
+ * [
1854
+ * {
1855
+ * "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1856
+ * "frequency_unit": "weekly",
1857
+ * "value": 1000.245,
1858
+ * "name": "avg consumption",
1859
+ * "metadata": {
1860
+ * "journey_title": "energy journey",
1861
+ * "step_name": "avg consumption picker"
1862
+ * }
1863
+ * }
1864
+ * ]
1865
+ */
1866
+ PriceInputMappings;
1706
1867
  /**
1707
1868
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
1708
1869
  */
@@ -1967,6 +2128,14 @@ declare namespace Components {
1967
2128
  * The renewal period duration unit
1968
2129
  */
1969
2130
  renewal_duration_unit?: "weeks" | "months" | "years";
2131
+ /**
2132
+ * The flag for prices that can be influenced by external variables such as user input.
2133
+ */
2134
+ variable_price?: boolean;
2135
+ /**
2136
+ * The unit of measurement used for display purposes and possibly for calculations when the price is variable.
2137
+ */
2138
+ unit?: /* The unit of measurement used for display purposes and possibly for calculations when the price is variable. */ ("kw" | "kwh" | "m" | "m2" | "l") | string;
1970
2139
  /**
1971
2140
  * The price creation date
1972
2141
  */
package/dist/openapi.json CHANGED
@@ -191,6 +191,147 @@
191
191
  }
192
192
  ]
193
193
  }
194
+ },
195
+ "Order with Simple Prices and Dynamic Pricing": {
196
+ "value": {
197
+ "status": "quote",
198
+ "source_type": "manual",
199
+ "expires_at": "2022-06-30T16:17:00.000Z",
200
+ "line_items": [
201
+ {
202
+ "price_id": "632b18b5-3f50-4231-b8d5-f8c33a392ed0",
203
+ "product_id": "3d1c9987-a7ae-4c1c-a7ef-e12caccab4e0",
204
+ "price_mappings": [
205
+ {
206
+ "price_id": "632b18b5-3f50-4231-b8d5-f8c33a392ed0",
207
+ "frequency_unit": "yearly",
208
+ "value": 12000,
209
+ "name": "Estimated consumption",
210
+ "metadata": {
211
+ "journey_title": "P&G",
212
+ "step_name": "Number Inputs"
213
+ }
214
+ }
215
+ ],
216
+ "quantity": 16
217
+ }
218
+ ],
219
+ "currency": "EUR",
220
+ "payment_method": [
221
+ {
222
+ "type": "IBAN",
223
+ "details": {}
224
+ }
225
+ ],
226
+ "billing_contact": {
227
+ "$relation": [
228
+ {
229
+ "entity_id": "1834a54e-b68f-4f7f-a98a-fe16f11bc2a5",
230
+ "_tags": []
231
+ }
232
+ ]
233
+ },
234
+ "billing_first_name": "Joao",
235
+ "billing_last_name": "Pinho",
236
+ "billing_email": "j.pinho@epilot.cloud",
237
+ "billing_company_name": "epilot cloud",
238
+ "billing_address": [
239
+ {
240
+ "_tags": [],
241
+ "street": "Im Media Park",
242
+ "street_number": "8a",
243
+ "postal_code": "52000",
244
+ "city": "Cologne",
245
+ "country": "DE",
246
+ "additional_info": ""
247
+ }
248
+ ],
249
+ "delivery_address": [],
250
+ "dates": [
251
+ {
252
+ "_tags": [
253
+ "Instalation Date"
254
+ ],
255
+ "dates": "",
256
+ "value": "2022-06-30T16:29:00.000Z"
257
+ }
258
+ ]
259
+ }
260
+ },
261
+ "Order with Composite Prices and Dynamic Pricing": {
262
+ "value": {
263
+ "status": "quote",
264
+ "source_type": "manual",
265
+ "expires_at": "2022-06-30T16:17:00.000Z",
266
+ "line_items": [
267
+ {
268
+ "price_id": "b3900bf3-020c-4c58-8af9-32f2682929e3",
269
+ "product_id": "924f6881-7ae3-4e2e-a1dd-2d81b8fa2e32",
270
+ "price_mappings": [
271
+ {
272
+ "price_id": "6dc88d6f-ba33-45ee-b5d0-62641344a0d9",
273
+ "frequency_unit": "yearly",
274
+ "value": 12000,
275
+ "name": "Estimated consumption",
276
+ "metadata": {
277
+ "journey_title": "P&G",
278
+ "step_name": "Number Inputs"
279
+ }
280
+ },
281
+ {
282
+ "price_id": "60eb12cd-703d-4d41-9265-577ff657bfc9",
283
+ "value": 10,
284
+ "name": "Distance to power meter",
285
+ "metadata": {
286
+ "journey_title": "P&G",
287
+ "step_name": "Number Inputs"
288
+ }
289
+ }
290
+ ],
291
+ "quantity": 1
292
+ }
293
+ ],
294
+ "currency": "EUR",
295
+ "payment_method": [
296
+ {
297
+ "type": "IBAN",
298
+ "details": {}
299
+ }
300
+ ],
301
+ "billing_contact": {
302
+ "$relation": [
303
+ {
304
+ "entity_id": "1834a54e-b68f-4f7f-a98a-fe16f11bc2a5",
305
+ "_tags": []
306
+ }
307
+ ]
308
+ },
309
+ "billing_first_name": "Joao",
310
+ "billing_last_name": "Pinho",
311
+ "billing_email": "j.pinho@epilot.cloud",
312
+ "billing_company_name": "epilot cloud",
313
+ "billing_address": [
314
+ {
315
+ "_tags": [],
316
+ "street": "Im Media Park",
317
+ "street_number": "8a",
318
+ "postal_code": "52000",
319
+ "city": "Cologne",
320
+ "country": "DE",
321
+ "additional_info": ""
322
+ }
323
+ ],
324
+ "delivery_address": [],
325
+ "dates": [
326
+ {
327
+ "_tags": [
328
+ "Instalation Date"
329
+ ],
330
+ "dates": "",
331
+ "value": "2022-06-30T16:29:00.000Z"
332
+ }
333
+ ]
334
+ }
194
335
  }
195
336
  },
196
337
  "schema": {
@@ -1415,6 +1556,30 @@
1415
1556
  "years"
1416
1557
  ]
1417
1558
  },
1559
+ "variable_price": {
1560
+ "description": "The flag for prices that can be influenced by external variables such as user input.",
1561
+ "type": "boolean"
1562
+ },
1563
+ "unit": {
1564
+ "description": "The unit of measurement used for display purposes and possibly for calculations when the price is variable.",
1565
+ "anyOf": [
1566
+ {
1567
+ "type": "string",
1568
+ "description": "built-in units",
1569
+ "enum": [
1570
+ "kw",
1571
+ "kwh",
1572
+ "m",
1573
+ "m2",
1574
+ "l"
1575
+ ]
1576
+ },
1577
+ {
1578
+ "type": "string",
1579
+ "description": "user custom unit"
1580
+ }
1581
+ ]
1582
+ },
1418
1583
  "_created_at": {
1419
1584
  "description": "The price creation date",
1420
1585
  "type": "string"
@@ -1566,6 +1731,65 @@
1566
1731
  ]
1567
1732
  }
1568
1733
  },
1734
+ "PriceInputMappings": {
1735
+ "type": "array",
1736
+ "items": {
1737
+ "$ref": "#/components/schemas/PriceInputMapping"
1738
+ },
1739
+ "example": [
1740
+ {
1741
+ "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1742
+ "frequency_unit": "weekly",
1743
+ "value": 1000.245,
1744
+ "name": "avg consumption",
1745
+ "metadata": {
1746
+ "journey_title": "energy journey",
1747
+ "step_name": "avg consumption picker"
1748
+ }
1749
+ }
1750
+ ]
1751
+ },
1752
+ "PriceInputMapping": {
1753
+ "type": "object",
1754
+ "properties": {
1755
+ "price_id": {
1756
+ "type": "string"
1757
+ },
1758
+ "frequency_unit": {
1759
+ "type": "string",
1760
+ "enum": [
1761
+ "weekly",
1762
+ "monthly",
1763
+ "every_quarter",
1764
+ "every_6_months",
1765
+ "yearly",
1766
+ "one_time"
1767
+ ]
1768
+ },
1769
+ "name": {
1770
+ "type": "string"
1771
+ },
1772
+ "value": {
1773
+ "type": "number"
1774
+ },
1775
+ "metadata": {
1776
+ "type": "object",
1777
+ "additionalProperties": {
1778
+ "type": "string"
1779
+ }
1780
+ }
1781
+ },
1782
+ "example": {
1783
+ "price_id": "589B011B-F8D9-4F8E-AD71-BACE4B543C0F",
1784
+ "frequency_unit": "weekly",
1785
+ "value": 1000.245,
1786
+ "name": "avg consumption",
1787
+ "metadata": {
1788
+ "journey_title": "energy journey",
1789
+ "step_name": "avg consumption picker"
1790
+ }
1791
+ }
1792
+ },
1569
1793
  "CatalogSearch": {
1570
1794
  "description": "A catalog search payload",
1571
1795
  "type": "object",
@@ -1867,6 +2091,10 @@
1867
2091
  "type": "integer",
1868
2092
  "description": "The quantity of products being purchased."
1869
2093
  },
2094
+ "price_mappings": {
2095
+ "description": "Price mapping information required to compute totals",
2096
+ "$ref": "#/components/schemas/PriceInputMappings"
2097
+ },
1870
2098
  "description": {
1871
2099
  "type": "string",
1872
2100
  "description": "An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name."
@@ -2142,7 +2370,7 @@
2142
2370
  "$ref": "#/components/schemas/OrderStatus"
2143
2371
  },
2144
2372
  "line_items": {
2145
- "$ref": "#/components/schemas/PriceItems"
2373
+ "$ref": "#/components/schemas/PriceItemsDto"
2146
2374
  },
2147
2375
  "source_type": {
2148
2376
  "type": "string",
@@ -2332,6 +2560,10 @@
2332
2560
  }
2333
2561
  ]
2334
2562
  }
2563
+ },
2564
+ "price_mappings": {
2565
+ "description": "Price mapping information required to compute totals",
2566
+ "$ref": "#/components/schemas/PriceInputMappings"
2335
2567
  }
2336
2568
  }
2337
2569
  },
@@ -2973,12 +3205,6 @@
2973
3205
  "value": {
2974
3206
  "mode": "create_order",
2975
3207
  "cart": {
2976
- "metadata": [
2977
- {
2978
- "key": "journey-id",
2979
- "value": "8d0a2235-97ce-42d0-88a3-e374634ca44e"
2980
- }
2981
- ],
2982
3208
  "customer": {
2983
3209
  "first_name": "john",
2984
3210
  "last_name": "doe",
@@ -3005,20 +3231,15 @@
3005
3231
  },
3006
3232
  "line_items": [
3007
3233
  {
3008
- "quantity": 1,
3009
- "product": "b7185fb7-b10f-4875-bda7-288631446555",
3010
- "price": "df240bab-9f71-4a9a-a9e1-59f18827dbf9"
3234
+ "quantity": 3,
3235
+ "product_id": "b7185fb7-b10f-4875-bda7-288631446555",
3236
+ "price_id": "df240bab-9f71-4a9a-a9e1-59f18827dbf9"
3011
3237
  },
3012
3238
  {
3013
- "quantity": 1,
3014
- "product": "zzzzzz-b10f-4875-bda7-288631446555",
3015
- "price": "zzzzz-9f71-4a9a-a9e1-59f18827dbf9"
3239
+ "quantity": 2,
3240
+ "product_id": "607d2952-8f3e-484f-a82b-4880528b7f55",
3241
+ "price_id": "7b028fdf-0b0a-4077-a8f1-d0cbbd14b7cf"
3016
3242
  }
3017
- ],
3018
- "files": [
3019
- "xf240bab-9f71-4a9a-a9e1-59f18827dbf9",
3020
- "yf240bab-9f71-4a9a-a9e1-59f18827dbf9",
3021
- "zf240bab-9f71-4a9a-a9e1-59f18827dbf9"
3022
3243
  ]
3023
3244
  }
3024
3245
  }