@epilot/pricing-client 2.0.1 → 2.1.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.json CHANGED
@@ -38,9 +38,9 @@
38
38
  "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Order\" exampleRef=\"#/components/examples/order-with-simple-prices\" />\n"
39
39
  },
40
40
  {
41
- "name": "order_with_bundles",
42
- "x-displayName": "Order (with Price Bundles)",
43
- "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Order\" exampleRef=\"#/components/examples/order-with-price-bundles\" />\n"
41
+ "name": "order_composite_prices",
42
+ "x-displayName": "Order (with Composite Prices)",
43
+ "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Order\" exampleRef=\"#/components/examples/order-with-composite-prices\" />\n"
44
44
  },
45
45
  {
46
46
  "name": "opportunity_schema",
@@ -59,8 +59,8 @@
59
59
  },
60
60
  {
61
61
  "name": "dynamic_price_schema",
62
- "x-displayName": "Price Bundle",
63
- "description": "<SchemaDefinition schemaRef=\"#/components/schemas/PriceBundle\" exampleRef=\"#/components/examples/price-bundle\" />\n"
62
+ "x-displayName": "Composite Price",
63
+ "description": "<SchemaDefinition schemaRef=\"#/components/schemas/CompositePrice\" exampleRef=\"#/components/examples/composite-price\" />\n"
64
64
  }
65
65
  ],
66
66
  "x-tagGroups": [
@@ -82,7 +82,7 @@
82
82
  {
83
83
  "name": "Examples",
84
84
  "tags": [
85
- "order_with_bundles"
85
+ "order_composite_prices"
86
86
  ]
87
87
  },
88
88
  {
@@ -646,7 +646,7 @@
646
646
  },
647
647
  "price_options": {
648
648
  "type": "object",
649
- "description": "A set of [prices](/api/pricing#tag/simple_price_schema) or [price bundles](/api/pricing#tag/dynamic_price_schema) for the current product.",
649
+ "description": "A set of [prices](/api/pricing#tag/simple_price_schema) or [composite prices](/api/pricing#tag/dynamic_price_schema) for the current product.",
650
650
  "properties": {
651
651
  "$relation": {
652
652
  "type": "array",
@@ -1259,11 +1259,11 @@
1259
1259
  }
1260
1260
  }
1261
1261
  },
1262
- "PriceBundle": {
1262
+ "CompositePrice": {
1263
1263
  "type": "object",
1264
1264
  "description": "The price entity schema for dynamic pricing",
1265
1265
  "example": {
1266
- "$ref": "#/components/examples/price-bundle"
1266
+ "$ref": "#/components/examples/composite-price"
1267
1267
  },
1268
1268
  "additionalProperties": true,
1269
1269
  "readOnly": true,
@@ -1278,7 +1278,7 @@
1278
1278
  },
1279
1279
  "price_components": {
1280
1280
  "type": "object",
1281
- "description": "A set of [price](/api/pricing#tag/simple_price_schema) components that define the price bundle.",
1281
+ "description": "A set of [price](/api/pricing#tag/simple_price_schema) components that define the composite price.",
1282
1282
  "properties": {
1283
1283
  "$relation": {
1284
1284
  "type": "array",
@@ -1288,6 +1288,14 @@
1288
1288
  }
1289
1289
  }
1290
1290
  },
1291
+ "unit_amount_currency": {
1292
+ "description": "Three-letter ISO currency code, in lowercase.",
1293
+ "oneOf": [
1294
+ {
1295
+ "$ref": "#/components/schemas/Currency"
1296
+ }
1297
+ ]
1298
+ },
1291
1299
  "_created_at": {
1292
1300
  "description": "The price creation date",
1293
1301
  "type": "string"
@@ -1310,7 +1318,7 @@
1310
1318
  },
1311
1319
  "_tags": {
1312
1320
  "type": "array",
1313
- "description": "An arbitrary set of tags attached to the price bundle",
1321
+ "description": "An arbitrary set of tags attached to the composite price",
1314
1322
  "items": {
1315
1323
  "type": "string"
1316
1324
  }
@@ -1328,9 +1336,12 @@
1328
1336
  "description": "By default, the quantity is set to 1, when greater than 1 this value is used as a multiplicative factor.\nE.g: 16 x Solar Modules - Premium price.\n",
1329
1337
  "type": "number"
1330
1338
  },
1339
+ "item": {
1340
+ "$ref": "#/components/schemas/Price"
1341
+ },
1331
1342
  "_tags": {
1332
1343
  "type": "array",
1333
- "description": "An arbitrary set of tags attached to the bundle - component relation",
1344
+ "description": "An arbitrary set of tags attached to the composite price - component relation",
1334
1345
  "items": {
1335
1346
  "type": "string"
1336
1347
  }
@@ -1672,6 +1683,14 @@
1672
1683
  "type": "string",
1673
1684
  "description": "The id of the price."
1674
1685
  },
1686
+ "unit_amount": {
1687
+ "type": "integer",
1688
+ "description": "The unit amount value"
1689
+ },
1690
+ "unit_amount_decimal": {
1691
+ "description": "The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
1692
+ "type": "string"
1693
+ },
1675
1694
  "taxes": {
1676
1695
  "type": "array",
1677
1696
  "description": "The taxes applied to the price item.",
@@ -1697,7 +1716,11 @@
1697
1716
  }
1698
1717
  },
1699
1718
  "_price": {
1700
- "$ref": "#/components/schemas/Price"
1719
+ "anyOf": [
1720
+ {
1721
+ "$ref": "#/components/schemas/Price"
1722
+ }
1723
+ ]
1701
1724
  },
1702
1725
  "_product": {
1703
1726
  "description": "The product linked to the price item.",
@@ -1705,6 +1728,31 @@
1705
1728
  }
1706
1729
  }
1707
1730
  },
1731
+ "CompositePriceItemDto": {
1732
+ "allOf": [
1733
+ {
1734
+ "$ref": "#/components/schemas/PriceItemDto"
1735
+ }
1736
+ ],
1737
+ "description": "Represents a composite price input to the pricing library.",
1738
+ "type": "object",
1739
+ "properties": {
1740
+ "item_components": {
1741
+ "type": "array",
1742
+ "description": "Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).",
1743
+ "items": {
1744
+ "$ref": "#/components/schemas/PriceItemDto"
1745
+ }
1746
+ },
1747
+ "_price": {
1748
+ "anyOf": [
1749
+ {
1750
+ "$ref": "#/components/schemas/CompositePrice"
1751
+ }
1752
+ ]
1753
+ }
1754
+ }
1755
+ },
1708
1756
  "TaxAmountDto": {
1709
1757
  "type": "object",
1710
1758
  "description": "A valid tax rate from a client.",
@@ -1944,15 +1992,36 @@
1944
1992
  "oneOf": [
1945
1993
  {
1946
1994
  "$ref": "#/components/schemas/PriceItem"
1995
+ },
1996
+ {
1997
+ "$ref": "#/components/schemas/CompositePriceItem"
1947
1998
  }
1948
1999
  ]
1949
2000
  }
1950
2001
  },
2002
+ "CompositePriceItem": {
2003
+ "allOf": [
2004
+ {
2005
+ "$ref": "#/components/schemas/PriceItem"
2006
+ }
2007
+ ],
2008
+ "description": "Represents a composite price input to the pricing library.",
2009
+ "type": "object",
2010
+ "properties": {
2011
+ "item_components": {
2012
+ "type": "array",
2013
+ "description": "Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).",
2014
+ "items": {
2015
+ "$ref": "#/components/schemas/PriceItem"
2016
+ }
2017
+ }
2018
+ }
2019
+ },
1951
2020
  "PriceItem": {
1952
2021
  "description": "Represents a price item",
1953
2022
  "type": "object",
1954
2023
  "example": {
1955
- "$ref": "#/components/examples/order-with-simple-prices"
2024
+ "$ref": "#/components/examples/price-item"
1956
2025
  },
1957
2026
  "properties": {
1958
2027
  "id": {
@@ -1963,13 +2032,6 @@
1963
2032
  "metadata": {
1964
2033
  "$ref": "#/components/schemas/MetaData"
1965
2034
  },
1966
- "item_components": {
1967
- "type": "array",
1968
- "description": "Contains price item configurations, per price component, when the main price item is a [price bundle](/api/pricing#tag/dynamic_price_schema).",
1969
- "items": {
1970
- "$ref": "#/components/schemas/PriceItemComponent"
1971
- }
1972
- },
1973
2035
  "unit_amount": {
1974
2036
  "type": "integer",
1975
2037
  "description": "The unit amount value",
@@ -1985,6 +2047,10 @@
1985
2047
  "description": "Net unit amount without taxes or discounts.",
1986
2048
  "readOnly": true
1987
2049
  },
2050
+ "unit_amount_decimal": {
2051
+ "description": "The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
2052
+ "type": "string"
2053
+ },
1988
2054
  "amount_total": {
1989
2055
  "type": "integer",
1990
2056
  "description": "Total after (discounts and) taxes.",
@@ -2009,11 +2075,18 @@
2009
2075
  "type": "string",
2010
2076
  "description": "The id of the price."
2011
2077
  },
2078
+ "is_composite_price": {
2079
+ "description": "The flag for prices that contain price components.",
2080
+ "type": "boolean"
2081
+ },
2012
2082
  "_price": {
2013
2083
  "description": "The price snapshot data.",
2014
2084
  "anyOf": [
2015
2085
  {
2016
2086
  "$ref": "#/components/schemas/Price"
2087
+ },
2088
+ {
2089
+ "$ref": "#/components/schemas/CompositePrice"
2017
2090
  }
2018
2091
  ]
2019
2092
  },
@@ -2051,13 +2124,6 @@
2051
2124
  }
2052
2125
  }
2053
2126
  },
2054
- "PriceItemComponent": {
2055
- "oneOf": [
2056
- {
2057
- "$ref": "#/components/schemas/PriceItem"
2058
- }
2059
- ]
2060
- },
2061
2127
  "TaxAmount": {
2062
2128
  "type": "object",
2063
2129
  "description": "A tax amount associated with a specific tax rate.",
@@ -2277,47 +2343,58 @@
2277
2343
  },
2278
2344
  "street": {
2279
2345
  "type": "string",
2280
- "description": "The first line of the address. Typically the street address or PO Box number."
2346
+ "description": "The first line of the address. Typically the street address or PO Box number.",
2347
+ "nullable": true
2281
2348
  },
2282
2349
  "street_number": {
2283
2350
  "type": "string",
2284
- "description": "The second line of the address. Typically the number of the apartment, suite, or unit."
2351
+ "description": "The second line of the address. Typically the number of the apartment, suite, or unit.",
2352
+ "nullable": true
2285
2353
  },
2286
2354
  "postal_code": {
2287
2355
  "type": "string",
2288
- "description": "The postal code for the address."
2356
+ "description": "The postal code for the address.",
2357
+ "nullable": true
2289
2358
  },
2290
2359
  "city": {
2291
2360
  "type": "string",
2292
- "description": "The name of the city, district, village, or town."
2361
+ "description": "The name of the city, district, village, or town.",
2362
+ "nullable": true
2293
2363
  },
2294
2364
  "country": {
2295
2365
  "type": "string",
2296
- "description": "The two-letter code for the country of the address."
2366
+ "description": "The two-letter code for the country of the address.",
2367
+ "nullable": true
2297
2368
  },
2298
2369
  "additional_info": {
2299
2370
  "type": "string",
2300
- "description": "An additional description for the address"
2371
+ "description": "An additional description for the address",
2372
+ "nullable": true
2301
2373
  },
2302
2374
  "company_name": {
2303
2375
  "type": "string",
2304
- "description": "the company name, usually used as extra delivery instructions"
2376
+ "description": "the company name, usually used as extra delivery instructions",
2377
+ "nullable": true
2305
2378
  },
2306
2379
  "first_name": {
2307
2380
  "type": "string",
2308
- "description": "the first name of the recipient, usually used as extra delivery instructions"
2381
+ "description": "the first name of the recipient, usually used as extra delivery instructions",
2382
+ "nullable": true
2309
2383
  },
2310
2384
  "last_name": {
2311
2385
  "type": "string",
2312
- "description": "the last name of the recipient, usually used as extra delivery instructions"
2386
+ "description": "the last name of the recipient, usually used as extra delivery instructions",
2387
+ "nullable": true
2313
2388
  },
2314
2389
  "salutation": {
2315
2390
  "type": "string",
2316
- "description": "the salutation of the recipient, usually used as extra delivery instructions"
2391
+ "description": "the salutation of the recipient, usually used as extra delivery instructions",
2392
+ "nullable": true
2317
2393
  },
2318
2394
  "title": {
2319
2395
  "type": "string",
2320
- "description": "the title of the recipient, usually used as extra delivery instructions"
2396
+ "description": "the title of the recipient, usually used as extra delivery instructions",
2397
+ "nullable": true
2321
2398
  }
2322
2399
  }
2323
2400
  },
@@ -3207,7 +3284,7 @@
3207
3284
  "_updated_at": "2022-06-03T16:29:46.303Z"
3208
3285
  }
3209
3286
  },
3210
- "order-with-price-bundles": {
3287
+ "order-with-composite-prices": {
3211
3288
  "value": {
3212
3289
  "metadata": [
3213
3290
  {
@@ -3409,7 +3486,7 @@
3409
3486
  "name": "Cool box",
3410
3487
  "_title": "Cool box"
3411
3488
  },
3412
- "description": "Price Bundle - Test 1",
3489
+ "description": "Price Component",
3413
3490
  "unit_amount": 90000,
3414
3491
  "amount_subtotal": 270000,
3415
3492
  "amount_total": 286200
@@ -3785,12 +3862,12 @@
3785
3862
  "_updated_at": "2022-06-03T16:04:10.369Z"
3786
3863
  }
3787
3864
  },
3788
- "price-bundle": {
3865
+ "composite-price": {
3789
3866
  "value": {
3790
3867
  "_id": "c2a95ca9-7a50-41a4-a73c-b5fb1a57d40f",
3791
3868
  "_schema": "price",
3792
- "_title": "My Price Bundle",
3793
- "description": "My Price Bundle",
3869
+ "_title": "My Composite Price",
3870
+ "description": "My Composite Price",
3794
3871
  "_org": "739224",
3795
3872
  "_created_at": "2022-02-18T10:10:26.439Z",
3796
3873
  "_updated_at": "2022-02-18T11:53:04.191Z",
@@ -3870,6 +3947,72 @@
3870
3947
  ]
3871
3948
  }
3872
3949
  }
3950
+ },
3951
+ "price-item": {
3952
+ "value": {
3953
+ "amount_subtotal": 10000,
3954
+ "amount_total": 10600,
3955
+ "currency": "EUR",
3956
+ "description": "Annual internet service",
3957
+ "price_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
3958
+ "product_id": "6241487f-b7fd-428b-ab92-24ee0b37fd84",
3959
+ "taxes": [
3960
+ {
3961
+ "amount": "600",
3962
+ "tax": {
3963
+ "active": true,
3964
+ "behavior": "Exclusive",
3965
+ "description": "Without Behaviour",
3966
+ "rate": "6",
3967
+ "region": "DE",
3968
+ "type": "VAT",
3969
+ "_created_at": "2022-02-07T14:49:08.831Z",
3970
+ "_id": "18bbbc2e-2c37-4f91-924a-07ae60d830e4",
3971
+ "_org": "739224",
3972
+ "_schema": "tax",
3973
+ "_title": "Tax Without Behaviour",
3974
+ "_updated_at": "2022-02-07T14:49:08.831Z"
3975
+ }
3976
+ }
3977
+ ],
3978
+ "unit_amount": 10000,
3979
+ "unit_amount_net": 10000,
3980
+ "_price": {
3981
+ "unit_amount": 10000,
3982
+ "unit_amount_currency": "EUR",
3983
+ "unit_amount_decimal": "100.00",
3984
+ "sales_tax": "standard",
3985
+ "tax_behavior": "exclusive",
3986
+ "price_display_in_journeys": "show_price",
3987
+ "type": "one_time",
3988
+ "billing_period": "weekly",
3989
+ "billing_duration_unit": "months",
3990
+ "notice_time_unit": "months",
3991
+ "termination_time_unit": "months",
3992
+ "renewal_duration_unit": "months",
3993
+ "_schema": "price",
3994
+ "_title": "Solar Panel Module",
3995
+ "description": "Solar Panel Module",
3996
+ "active": true,
3997
+ "tax": {
3998
+ "$relation": [
3999
+ {
4000
+ "entity_id": "24641e82-0690-4135-8b43-ef12a9b1c5dc"
4001
+ }
4002
+ ]
4003
+ },
4004
+ "_id": "7e24ff5d-d580-4136-a32f-19191eed039a",
4005
+ "_org": "728",
4006
+ "_created_at": "2022-06-03T16:04:10.369Z",
4007
+ "_updated_at": "2022-06-03T16:04:10.369Z"
4008
+ },
4009
+ "_product": {
4010
+ "name": "Cool box",
4011
+ "type": "product",
4012
+ "_id": "73f857a4-0fbc-4aa6-983f-87c0d6d410a6",
4013
+ "_title": "Cool box"
4014
+ }
4015
+ }
3873
4016
  }
3874
4017
  }
3875
4018
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/pricing-client",
3
- "version": "2.0.1",
3
+ "version": "2.1.2",
4
4
  "description": "Client for epilot Pricing APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -69,5 +69,5 @@
69
69
  "webpack": "~5.18.0",
70
70
  "webpack-cli": "^4.4.0"
71
71
  },
72
- "gitHead": "3c752b53105f0bf26dc37a682af3b592b993d264"
72
+ "gitHead": "f6176e92cb46cd8a48aa0f010adf17682b8d22b5"
73
73
  }