@epilot/pricing-client 3.47.5 → 3.47.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.
@@ -1 +1 @@
1
- (()=>{"use strict";var e={914:function(e,r,t){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var a=i(t(240));r.default=a.default},240:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"servers":[{"url":"https://pricing-api.sls.epilot.io"}],"paths":{"/v1/pricing:compute":{"post":{"operationId":"$calculatePricingDetails","requestBody":{"required":false,"content":{"application/json":{}}},"responses":{}}},"/v1/order":{"post":{"operationId":"createOrder","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/order/{id}":{"put":{"operationId":"putOrder","parameters":[{"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/cart:checkout":{"post":{"operationId":"$checkoutCart","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/catalog":{"post":{"operationId":"$searchCatalog","parameters":[{"in":"header","name":"X-Ivy-Org-ID"},{"in":"header","name":"Authorization"}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/catalog":{"post":{"operationId":"$privateSearchCatalog","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/validate-promo-codes":{"post":{"operationId":"$validatePromoCodes","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/availability:check":{"post":{"operationId":"$availabilityCheck","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/validate-availability/{id}":{"get":{"operationId":"$validateAvailabilityFile","parameters":[{"in":"path","name":"id","required":true},{"in":"header","name":"X-Epilot-Org-ID","required":true}],"responses":{}}},"/v1/public/historicMarketPrices":{"get":{"operationId":"$historicMarketPrices","parameters":[{"in":"query","name":"market","required":true},{"in":"query","name":"from","required":true},{"in":"query","name":"to","required":true},{"in":"query","name":"frequency","required":true}],"responses":{}}},"/v1/public/averageMarketPrice":{"get":{"operationId":"$averageMarketPrice","parameters":[{"in":"query","name":"market","required":true},{"in":"query","name":"interval","required":true}],"responses":{}}},"/v1/public/integration/{integrationId}/external-catalog":{"post":{"operationId":"$searchExternalCatalog","parameters":[{"in":"path","name":"integrationId","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/integration/{integrationId}/providers:search":{"post":{"operationId":"$searchProviders","parameters":[{"in":"header","name":"X-Epilot-Org-ID","required":true},{"in":"path","name":"integrationId","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/integration/{integrationId}/streets:search":{"post":{"operationId":"$searchStreets","parameters":[{"in":"header","name":"X-Epilot-Org-ID","required":true},{"in":"path","name":"integrationId","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/integration/{integrationId}/compute-price":{"post":{"operationId":"$computePrice","parameters":[{"in":"header","name":"X-Epilot-Org-ID","required":true},{"in":"path","name":"integrationId","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/integration/{integrationId}/credentials":{"get":{"operationId":"$getCredentials","parameters":[{"in":"path","name":"integrationId","required":true}],"responses":{}}},"/v1/integration/{integrationId}/credentials:save":{"put":{"operationId":"$saveCredentials","parameters":[{"in":"path","name":"integrationId","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/integration/{integrationId}/credentials:delete":{"delete":{"operationId":"$deleteCredentials","parameters":[{"in":"path","name":"integrationId","required":true}],"responses":{}}}},"components":{}}')}},r={},t=function t(i){var a=r[i];if(void 0!==a)return a.exports;var n=r[i]={exports:{}};return e[i].call(n.exports,n,n.exports,t),n.exports}(914),i=exports;for(var a in t)i[a]=t[a];t.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={914:function(e,r,t){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});var a=i(t(240));r.default=a.default},240:e=>{e.exports=JSON.parse('{"openapi":"3.0.3","info":{"title":"","version":""},"servers":[{"url":"https://pricing-api.sls.epilot.io"}],"paths":{"/v1/pricing:compute":{"post":{"operationId":"$calculatePricingDetails","requestBody":{"required":false,"content":{"application/json":{}}},"responses":{}}},"/v1/order":{"post":{"operationId":"createOrder","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/order/{id}":{"put":{"operationId":"putOrder","parameters":[{"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/cart:checkout":{"post":{"operationId":"$checkoutCart","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/catalog":{"post":{"operationId":"$searchCatalog","parameters":[{"in":"header","name":"X-Ivy-Org-ID"},{"in":"header","name":"Authorization"}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/catalog":{"post":{"operationId":"$privateSearchCatalog","requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/validate-promo-codes":{"post":{"operationId":"$validatePromoCodes","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/availability:check":{"post":{"operationId":"$availabilityCheck","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/validate-availability/{id}":{"get":{"operationId":"$validateAvailabilityFile","parameters":[{"in":"path","name":"id","required":true},{"in":"header","name":"X-Epilot-Org-ID","required":true}],"responses":{}}},"/v1/public/historicMarketPrices":{"get":{"operationId":"$historicMarketPrices","parameters":[{"in":"query","name":"market","required":true},{"in":"query","name":"bidding_zone","required":true},{"in":"query","name":"frequency","required":true},{"in":"query","name":"from","required":true},{"in":"query","name":"to","required":true}],"responses":{}}},"/v1/public/averageMarketPrice":{"get":{"operationId":"$averageMarketPrice","parameters":[{"in":"query","name":"market","required":true},{"in":"query","name":"bidding_zone","required":true},{"in":"query","name":"from","required":true},{"in":"query","name":"to","required":true}],"responses":{}}},"/v1/public/integration/{integrationId}/external-catalog":{"post":{"operationId":"$searchExternalCatalog","parameters":[{"in":"path","name":"integrationId","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/integration/{integrationId}/providers:search":{"post":{"operationId":"$searchProviders","parameters":[{"in":"header","name":"X-Epilot-Org-ID","required":true},{"in":"path","name":"integrationId","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/integration/{integrationId}/streets:search":{"post":{"operationId":"$searchStreets","parameters":[{"in":"header","name":"X-Epilot-Org-ID","required":true},{"in":"path","name":"integrationId","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}},"responses":{}}},"/v1/public/integration/{integrationId}/compute-price":{"post":{"operationId":"$computePrice","parameters":[{"in":"header","name":"X-Epilot-Org-ID","required":true},{"in":"path","name":"integrationId","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/integration/{integrationId}/credentials":{"get":{"operationId":"$getCredentials","parameters":[{"in":"path","name":"integrationId","required":true}],"responses":{}}},"/v1/integration/{integrationId}/credentials:save":{"put":{"operationId":"$saveCredentials","parameters":[{"in":"path","name":"integrationId","required":true}],"requestBody":{"content":{"application/json":{}}},"responses":{}}},"/v1/integration/{integrationId}/credentials:delete":{"delete":{"operationId":"$deleteCredentials","parameters":[{"in":"path","name":"integrationId","required":true}],"responses":{}}}},"components":{}}')}},r={},t=function t(i){var a=r[i];if(void 0!==a)return a.exports;var n=r[i]={exports:{}};return e[i].call(n.exports,n,n.exports,t),n.exports}(914),i=exports;for(var a in t)i[a]=t[a];t.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
@@ -173,17 +173,22 @@
173
173
  },
174
174
  {
175
175
  "in": "query",
176
- "name": "from",
176
+ "name": "bidding_zone",
177
177
  "required": true
178
178
  },
179
179
  {
180
180
  "in": "query",
181
- "name": "to",
181
+ "name": "frequency",
182
182
  "required": true
183
183
  },
184
184
  {
185
185
  "in": "query",
186
- "name": "frequency",
186
+ "name": "from",
187
+ "required": true
188
+ },
189
+ {
190
+ "in": "query",
191
+ "name": "to",
187
192
  "required": true
188
193
  }
189
194
  ],
@@ -201,7 +206,17 @@
201
206
  },
202
207
  {
203
208
  "in": "query",
204
- "name": "interval",
209
+ "name": "bidding_zone",
210
+ "required": true
211
+ },
212
+ {
213
+ "in": "query",
214
+ "name": "from",
215
+ "required": true
216
+ },
217
+ {
218
+ "in": "query",
219
+ "name": "to",
205
220
  "required": true
206
221
  }
207
222
  ],
package/dist/openapi.d.ts CHANGED
@@ -456,14 +456,18 @@ declare namespace Components {
456
456
  * The id of the price.
457
457
  */
458
458
  price_id?: string;
459
- /**
460
- * The flag for prices that contain price components.
461
- */
462
- is_composite_price?: boolean;
463
459
  /**
464
460
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
465
461
  */
466
462
  description?: string;
463
+ /**
464
+ * The description for the product.
465
+ */
466
+ product_description?: string;
467
+ /**
468
+ * The name for the product.
469
+ */
470
+ product_name?: string;
467
471
  price_mappings?: /**
468
472
  * example:
469
473
  * [
@@ -717,37 +721,7 @@ declare namespace Components {
717
721
  /**
718
722
  * The coupons applicable to the price item
719
723
  */
720
- _coupons?: (/**
721
- * The coupon configuration
722
- * example:
723
- * {
724
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
725
- * "_schema": "coupon",
726
- * "_org": "org_12345",
727
- * "_created_at": "2024-01-15T10:00:00.000Z",
728
- * "_updated_at": "2024-01-20T12:00:00.000Z",
729
- * "_title": "Sample Coupon",
730
- * "name": "Sample Coupon",
731
- * "type": "fixed",
732
- * "fixed_value": 555,
733
- * "fixed_value_currency": "USD",
734
- * "fixed_value_decimal": "5.55",
735
- * "active": true,
736
- * "prices": {
737
- * "$relation": [
738
- * {
739
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
740
- * "_tags": [
741
- * "discount",
742
- * "special"
743
- * ],
744
- * "_schema": "price"
745
- * }
746
- * ]
747
- * }
748
- * }
749
- */
750
- Coupon)[];
724
+ _coupons?: (CouponItem)[];
751
725
  /**
752
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'.
753
727
  */
@@ -770,14 +744,18 @@ declare namespace Components {
770
744
  * The id of the price.
771
745
  */
772
746
  price_id?: string;
773
- /**
774
- * The flag for prices that contain price components.
775
- */
776
- is_composite_price?: boolean;
777
747
  /**
778
748
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
779
749
  */
780
750
  description?: string;
751
+ /**
752
+ * The description for the product.
753
+ */
754
+ product_description?: string;
755
+ /**
756
+ * The name for the product.
757
+ */
758
+ product_name?: string;
781
759
  /**
782
760
  * Price mapping information required to compute totals
783
761
  */
@@ -919,14 +897,18 @@ declare namespace Components {
919
897
  * The id of the price.
920
898
  */
921
899
  price_id?: string;
922
- /**
923
- * The flag for prices that contain price components.
924
- */
925
- is_composite_price?: boolean;
926
900
  /**
927
901
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
928
902
  */
929
903
  description?: string;
904
+ /**
905
+ * The description for the product.
906
+ */
907
+ product_description?: string;
908
+ /**
909
+ * The name for the product.
910
+ */
911
+ product_name?: string;
930
912
  price_mappings?: /**
931
913
  * example:
932
914
  * [
@@ -1077,37 +1059,7 @@ declare namespace Components {
1077
1059
  /**
1078
1060
  * The coupons applicable to the price item
1079
1061
  */
1080
- _coupons?: (/**
1081
- * The coupon configuration
1082
- * example:
1083
- * {
1084
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
1085
- * "_schema": "coupon",
1086
- * "_org": "org_12345",
1087
- * "_created_at": "2024-01-15T10:00:00.000Z",
1088
- * "_updated_at": "2024-01-20T12:00:00.000Z",
1089
- * "_title": "Sample Coupon",
1090
- * "name": "Sample Coupon",
1091
- * "type": "fixed",
1092
- * "fixed_value": 555,
1093
- * "fixed_value_currency": "USD",
1094
- * "fixed_value_decimal": "5.55",
1095
- * "active": true,
1096
- * "prices": {
1097
- * "$relation": [
1098
- * {
1099
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
1100
- * "_tags": [
1101
- * "discount",
1102
- * "special"
1103
- * ],
1104
- * "_schema": "price"
1105
- * }
1106
- * ]
1107
- * }
1108
- * }
1109
- */
1110
- Coupon)[];
1062
+ _coupons?: (CouponItem)[];
1111
1063
  }
1112
1064
  export interface BasicAuthCredentials {
1113
1065
  /**
@@ -1600,14 +1552,18 @@ declare namespace Components {
1600
1552
  * The id of the price.
1601
1553
  */
1602
1554
  price_id?: string;
1603
- /**
1604
- * The flag for prices that contain price components.
1605
- */
1606
- is_composite_price?: boolean;
1607
1555
  /**
1608
1556
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
1609
1557
  */
1610
1558
  description?: string;
1559
+ /**
1560
+ * The description for the product.
1561
+ */
1562
+ product_description?: string;
1563
+ /**
1564
+ * The name for the product.
1565
+ */
1566
+ product_name?: string;
1611
1567
  price_mappings?: /**
1612
1568
  * example:
1613
1569
  * [
@@ -1861,37 +1817,7 @@ declare namespace Components {
1861
1817
  /**
1862
1818
  * The coupons applicable to the price item
1863
1819
  */
1864
- _coupons?: (/**
1865
- * The coupon configuration
1866
- * example:
1867
- * {
1868
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
1869
- * "_schema": "coupon",
1870
- * "_org": "org_12345",
1871
- * "_created_at": "2024-01-15T10:00:00.000Z",
1872
- * "_updated_at": "2024-01-20T12:00:00.000Z",
1873
- * "_title": "Sample Coupon",
1874
- * "name": "Sample Coupon",
1875
- * "type": "fixed",
1876
- * "fixed_value": 555,
1877
- * "fixed_value_currency": "USD",
1878
- * "fixed_value_decimal": "5.55",
1879
- * "active": true,
1880
- * "prices": {
1881
- * "$relation": [
1882
- * {
1883
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
1884
- * "_tags": [
1885
- * "discount",
1886
- * "special"
1887
- * ],
1888
- * "_schema": "price"
1889
- * }
1890
- * ]
1891
- * }
1892
- * }
1893
- */
1894
- Coupon)[];
1820
+ _coupons?: (CouponItem)[];
1895
1821
  /**
1896
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'.
1897
1823
  */
@@ -1926,14 +1852,18 @@ declare namespace Components {
1926
1852
  * The id of the price.
1927
1853
  */
1928
1854
  price_id?: string;
1929
- /**
1930
- * The flag for prices that contain price components.
1931
- */
1932
- is_composite_price?: boolean;
1933
1855
  /**
1934
1856
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
1935
1857
  */
1936
1858
  description?: string;
1859
+ /**
1860
+ * The description for the product.
1861
+ */
1862
+ product_description?: string;
1863
+ /**
1864
+ * The name for the product.
1865
+ */
1866
+ product_name?: string;
1937
1867
  price_mappings?: /**
1938
1868
  * example:
1939
1869
  * [
@@ -2084,37 +2014,11 @@ declare namespace Components {
2084
2014
  /**
2085
2015
  * The coupons applicable to the price item
2086
2016
  */
2087
- _coupons?: (/**
2088
- * The coupon configuration
2089
- * example:
2090
- * {
2091
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
2092
- * "_schema": "coupon",
2093
- * "_org": "org_12345",
2094
- * "_created_at": "2024-01-15T10:00:00.000Z",
2095
- * "_updated_at": "2024-01-20T12:00:00.000Z",
2096
- * "_title": "Sample Coupon",
2097
- * "name": "Sample Coupon",
2098
- * "type": "fixed",
2099
- * "fixed_value": 555,
2100
- * "fixed_value_currency": "USD",
2101
- * "fixed_value_decimal": "5.55",
2102
- * "active": true,
2103
- * "prices": {
2104
- * "$relation": [
2105
- * {
2106
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
2107
- * "_tags": [
2108
- * "discount",
2109
- * "special"
2110
- * ],
2111
- * "_schema": "price"
2112
- * }
2113
- * ]
2114
- * }
2115
- * }
2017
+ _coupons?: (CouponItem)[];
2018
+ /**
2019
+ * The flag for prices that contain price components.
2116
2020
  */
2117
- Coupon)[];
2021
+ is_composite_price?: true;
2118
2022
  /**
2119
2023
  * Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).
2120
2024
  */
@@ -2484,6 +2388,66 @@ declare namespace Components {
2484
2388
  [name: string]: number;
2485
2389
  };
2486
2390
  }
2391
+ export interface CouponItem {
2392
+ _id?: EntityId /* uuid */;
2393
+ /**
2394
+ * The auto-generated title for the title
2395
+ */
2396
+ _title?: string;
2397
+ /**
2398
+ * Organization Id the entity belongs to
2399
+ */
2400
+ _org?: string;
2401
+ /**
2402
+ * The schema of the entity, for coupons it is always `coupon`
2403
+ */
2404
+ _schema: "coupon";
2405
+ _tags?: string[];
2406
+ /**
2407
+ * The creation date for the opportunity
2408
+ */
2409
+ _created_at?: string; // date-time
2410
+ /**
2411
+ * The date the coupon was last updated
2412
+ */
2413
+ _updated_at?: string; // date-time
2414
+ name?: string | null;
2415
+ description?: string | null;
2416
+ type: "fixed" | "percentage";
2417
+ category: "discount" | "cashback";
2418
+ /**
2419
+ * Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
2420
+ */
2421
+ percentage_value?: string | null;
2422
+ /**
2423
+ * Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.
2424
+ */
2425
+ fixed_value?: number;
2426
+ /**
2427
+ * 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.
2428
+ */
2429
+ fixed_value_decimal?: string;
2430
+ /**
2431
+ * Use if type is set to fixed. Three-letter ISO currency code, in lowercase.
2432
+ */
2433
+ fixed_value_currency?: /* Use if type is set to fixed. Three-letter ISO currency code, in lowercase. */ /**
2434
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
2435
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
2436
+ *
2437
+ * example:
2438
+ * EUR
2439
+ */
2440
+ Currency;
2441
+ /**
2442
+ * The cashback period, for now it's limited to either 0 months or 12 months
2443
+ */
2444
+ cashback_period?: "0" | "12";
2445
+ active?: boolean;
2446
+ /**
2447
+ * Whether the coupon requires a promo code to be applied
2448
+ */
2449
+ requires_promo_code?: boolean;
2450
+ }
2487
2451
  /**
2488
2452
  * The coupon configuration
2489
2453
  * example:
@@ -3859,14 +3823,18 @@ declare namespace Components {
3859
3823
  * The id of the price.
3860
3824
  */
3861
3825
  price_id?: string;
3862
- /**
3863
- * The flag for prices that contain price components.
3864
- */
3865
- is_composite_price?: boolean;
3866
3826
  /**
3867
3827
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
3868
3828
  */
3869
3829
  description?: string;
3830
+ /**
3831
+ * The description for the product.
3832
+ */
3833
+ product_description?: string;
3834
+ /**
3835
+ * The name for the product.
3836
+ */
3837
+ product_name?: string;
3870
3838
  price_mappings?: /**
3871
3839
  * example:
3872
3840
  * [
@@ -4120,37 +4088,7 @@ declare namespace Components {
4120
4088
  /**
4121
4089
  * The coupons applicable to the price item
4122
4090
  */
4123
- _coupons?: (/**
4124
- * The coupon configuration
4125
- * example:
4126
- * {
4127
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
4128
- * "_schema": "coupon",
4129
- * "_org": "org_12345",
4130
- * "_created_at": "2024-01-15T10:00:00.000Z",
4131
- * "_updated_at": "2024-01-20T12:00:00.000Z",
4132
- * "_title": "Sample Coupon",
4133
- * "name": "Sample Coupon",
4134
- * "type": "fixed",
4135
- * "fixed_value": 555,
4136
- * "fixed_value_currency": "USD",
4137
- * "fixed_value_decimal": "5.55",
4138
- * "active": true,
4139
- * "prices": {
4140
- * "$relation": [
4141
- * {
4142
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
4143
- * "_tags": [
4144
- * "discount",
4145
- * "special"
4146
- * ],
4147
- * "_schema": "price"
4148
- * }
4149
- * ]
4150
- * }
4151
- * }
4152
- */
4153
- Coupon)[];
4091
+ _coupons?: (CouponItem)[];
4154
4092
  /**
4155
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'.
4156
4094
  */
@@ -4195,14 +4133,18 @@ declare namespace Components {
4195
4133
  * The id of the price.
4196
4134
  */
4197
4135
  price_id?: string;
4198
- /**
4199
- * The flag for prices that contain price components.
4200
- */
4201
- is_composite_price?: boolean;
4202
4136
  /**
4203
4137
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
4204
4138
  */
4205
4139
  description?: string;
4140
+ /**
4141
+ * The description for the product.
4142
+ */
4143
+ product_description?: string;
4144
+ /**
4145
+ * The name for the product.
4146
+ */
4147
+ product_name?: string;
4206
4148
  price_mappings?: /**
4207
4149
  * example:
4208
4150
  * [
@@ -4353,37 +4295,7 @@ declare namespace Components {
4353
4295
  /**
4354
4296
  * The coupons applicable to the price item
4355
4297
  */
4356
- _coupons?: (/**
4357
- * The coupon configuration
4358
- * example:
4359
- * {
4360
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
4361
- * "_schema": "coupon",
4362
- * "_org": "org_12345",
4363
- * "_created_at": "2024-01-15T10:00:00.000Z",
4364
- * "_updated_at": "2024-01-20T12:00:00.000Z",
4365
- * "_title": "Sample Coupon",
4366
- * "name": "Sample Coupon",
4367
- * "type": "fixed",
4368
- * "fixed_value": 555,
4369
- * "fixed_value_currency": "USD",
4370
- * "fixed_value_decimal": "5.55",
4371
- * "active": true,
4372
- * "prices": {
4373
- * "$relation": [
4374
- * {
4375
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
4376
- * "_tags": [
4377
- * "discount",
4378
- * "special"
4379
- * ],
4380
- * "_schema": "price"
4381
- * }
4382
- * ]
4383
- * }
4384
- * }
4385
- */
4386
- Coupon)[];
4298
+ _coupons?: (CouponItem)[];
4387
4299
  /**
4388
4300
  * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
4389
4301
  */
@@ -4412,6 +4324,10 @@ declare namespace Components {
4412
4324
  * The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
4413
4325
  */
4414
4326
  unit_amount_decimal?: string;
4327
+ /**
4328
+ * The flag for prices that contain price components.
4329
+ */
4330
+ is_composite_price?: false;
4415
4331
  /**
4416
4332
  * Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.
4417
4333
  * - `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity
@@ -4422,7 +4338,7 @@ declare namespace Components {
4422
4338
  * - `external_getag` indicates that the price is influenced by aquisition fees provided by GetAG.
4423
4339
  *
4424
4340
  */
4425
- pricing_model: "per_unit" | "tiered_graduated" | "tiered_volume" | "tiered_flatfee" | "dynamic_tariff" | "external_getag";
4341
+ pricing_model?: "per_unit" | "tiered_graduated" | "tiered_volume" | "tiered_flatfee" | "dynamic_tariff" | "external_getag";
4426
4342
  /**
4427
4343
  * The snapshot of the price linked to the price item.
4428
4344
  * example:
@@ -4604,6 +4520,7 @@ declare namespace Components {
4604
4520
  _tags?: string[];
4605
4521
  };
4606
4522
  }
4523
+ export type PriceItemUnion = /* Represents a price input to the pricing library. */ PriceItemDto | /* Represents a composite price input to the pricing library. */ CompositePriceItemDto;
4607
4524
  /**
4608
4525
  * Tracks a set of product prices, quantities, (discounts) and taxes.
4609
4526
  */
@@ -4625,7 +4542,7 @@ declare namespace Components {
4625
4542
  /**
4626
4543
  * A valid set of product prices, quantities, (discounts) and taxes from a client.
4627
4544
  */
4628
- export type PriceItemsDto = (/* Represents a price input to the pricing library. */ PriceItemDto | /* Represents a composite price input to the pricing library. */ CompositePriceItemDto)[];
4545
+ export type PriceItemsDto = PriceItemUnion[];
4629
4546
  export interface PriceTier {
4630
4547
  up_to?: number | null;
4631
4548
  flat_fee_amount?: number;
@@ -6331,6 +6248,7 @@ export type ComputedPriceBreakdown = Components.Schemas.ComputedPriceBreakdown;
6331
6248
  export type ComputedPriceComponents = Components.Schemas.ComputedPriceComponents;
6332
6249
  export type ConsumptionTypeGetAg = Components.Schemas.ConsumptionTypeGetAg;
6333
6250
  export type Coupon = Components.Schemas.Coupon;
6251
+ export type CouponItem = Components.Schemas.CouponItem;
6334
6252
  export type CouponWithoutPromoCodes = Components.Schemas.CouponWithoutPromoCodes;
6335
6253
  export type Currency = Components.Schemas.Currency;
6336
6254
  export type Customer = Components.Schemas.Customer;
@@ -6375,6 +6293,7 @@ export type PriceInputMapping = Components.Schemas.PriceInputMapping;
6375
6293
  export type PriceInputMappings = Components.Schemas.PriceInputMappings;
6376
6294
  export type PriceItem = Components.Schemas.PriceItem;
6377
6295
  export type PriceItemDto = Components.Schemas.PriceItemDto;
6296
+ export type PriceItemUnion = Components.Schemas.PriceItemUnion;
6378
6297
  export type PriceItems = Components.Schemas.PriceItems;
6379
6298
  export type PriceItemsDto = Components.Schemas.PriceItemsDto;
6380
6299
  export type PriceTier = Components.Schemas.PriceTier;
package/dist/openapi.json CHANGED
@@ -159,6 +159,14 @@
159
159
  "price_id": "396cb5f3-ea0b-4629-99ca-303661de5a9b",
160
160
  "quantity": 2
161
161
  },
162
+ {
163
+ "product_id": "c5695fb5-f02d-4e46-9fb2-a36dc4e9876f",
164
+ "price_id": "396cb5f3-ea0b-4629-99ca-303661de5a9b",
165
+ "quantity": 2,
166
+ "coupon_ids": [
167
+ "0f8c4852-23fa-4a64-a2f3-88702335f094"
168
+ ]
169
+ },
162
170
  {
163
171
  "product_id": "c5695fb5-f02d-4e46-9fb2-a36dc4e9876f",
164
172
  "price_id": "2abe0c6f-63ef-417b-8c85-5546359382d9",
@@ -175,6 +183,263 @@
175
183
  }
176
184
  }
177
185
  ]
186
+ },
187
+ {
188
+ "product_id": "c5695fb5-f02d-4e46-9fb2-a36dc4e9876f",
189
+ "price_id": "b59acf37-3cc0-456c-a712-1db0fc478d2d",
190
+ "quantity": 1,
191
+ "price_component_coupon_ids": {
192
+ "583fb57a-7549-4624-82d6-342d5e6542f7": [
193
+ "0f8c4852-23fa-4a64-a2f3-88702335f094"
194
+ ]
195
+ },
196
+ "price_mappings": [
197
+ {
198
+ "price_id": "25c7dc77-ac80-480a-92c0-8c0e913b5534",
199
+ "frequency_unit": "yearly",
200
+ "value": 10000,
201
+ "name": "Estimated consumption",
202
+ "metadata": {
203
+ "journey_title": "P&G",
204
+ "step_name": "Number Inputs"
205
+ }
206
+ }
207
+ ],
208
+ "item_components": [
209
+ {
210
+ "pricing_model": "per_unit",
211
+ "quantity": 1,
212
+ "type": "recurring",
213
+ "billing_period": "monthly",
214
+ "price_id": "583fb57a-7549-4624-82d6-342d5e6542f7",
215
+ "product_id": "c5695fb5-f02d-4e46-9fb2-a36dc4e9876f",
216
+ "_price": {
217
+ "pricing_model": "per_unit",
218
+ "unit_amount": 1500,
219
+ "unit_amount_currency": "EUR",
220
+ "unit_amount_decimal": "15",
221
+ "sales_tax": "standard",
222
+ "active": true,
223
+ "price_display_in_journeys": "show_price",
224
+ "type": "recurring",
225
+ "_title": "Base Price",
226
+ "tax": [
227
+ {
228
+ "_schema": "tax",
229
+ "active": true,
230
+ "description": "GST",
231
+ "rate": 19,
232
+ "region": "DE",
233
+ "type": "Custom",
234
+ "_id": "d792070e-328d-4d2c-8aba-5ac7b23ff621",
235
+ "_org": "739224",
236
+ "_created_at": "2024-12-18T14:14:53.340Z",
237
+ "_updated_at": "2025-02-11T11:07:49.660Z",
238
+ "_title": "GST",
239
+ "behavior": "inclusive"
240
+ }
241
+ ],
242
+ "tax_behavior": "inclusive",
243
+ "billing_period": "monthly",
244
+ "billing_duration_unit": "months",
245
+ "notice_time_unit": "months",
246
+ "termination_time_unit": "months",
247
+ "renewal_duration_unit": "months",
248
+ "description": "Base Price",
249
+ "is_tax_inclusive": false,
250
+ "internal_description": "Base Price",
251
+ "variable_price": true
252
+ },
253
+ "taxes": [
254
+ {
255
+ "tax": {
256
+ "_schema": "tax",
257
+ "active": true,
258
+ "description": "GST",
259
+ "rate": 19,
260
+ "region": "DE",
261
+ "type": "Custom",
262
+ "_id": "d792070e-328d-4d2c-8aba-5ac7b23ff621",
263
+ "_org": "739224",
264
+ "_created_at": "2024-12-18T14:14:53.340Z",
265
+ "_updated_at": "2025-02-11T11:07:49.660Z",
266
+ "_title": "GST",
267
+ "behavior": "inclusive"
268
+ },
269
+ "amount": 285
270
+ }
271
+ ],
272
+ "unit_amount": 1000,
273
+ "unit_amount_decimal": "10",
274
+ "currency": "EUR",
275
+ "description": "Base Price",
276
+ "is_tax_inclusive": false
277
+ },
278
+ {
279
+ "pricing_model": "per_unit",
280
+ "quantity": 1,
281
+ "type": "recurring",
282
+ "billing_period": "monthly",
283
+ "price_id": "25c7dc77-ac80-480a-92c0-8c0e913b5534",
284
+ "product_id": "c5695fb5-f02d-4e46-9fb2-a36dc4e9876f",
285
+ "_price": {
286
+ "_id": "25c7dc77-ac80-480a-92c0-8c0e913b5534",
287
+ "active": true,
288
+ "description": "Work Price",
289
+ "is_tax_inclusive": true,
290
+ "price_display_in_journeys": "show_price",
291
+ "pricing_model": "per_unit",
292
+ "type": "recurring",
293
+ "unit_amount": 10,
294
+ "unit_amount_currency": "EUR",
295
+ "unit_amount_decimal": "0.10",
296
+ "variable_price": true,
297
+ "billing_period": "monthly",
298
+ "internal_description": "Work Price",
299
+ "_title": "Work Price",
300
+ "unit": "kwh"
301
+ },
302
+ "taxes": [
303
+ {
304
+ "tax": {
305
+ "_schema": "tax",
306
+ "active": true,
307
+ "description": "19%",
308
+ "rate": 19,
309
+ "region": "DE",
310
+ "type": "VAT",
311
+ "_id": "bd488a36-cae5-4b18-9ca5-f5cbf6d9735b",
312
+ "_org": "739224",
313
+ "_created_at": "2025-01-15T12:04:52.431Z",
314
+ "_updated_at": "2025-01-15T12:04:52.431Z",
315
+ "_title": "19%"
316
+ },
317
+ "amount": 1331
318
+ }
319
+ ],
320
+ "unit_amount": 8,
321
+ "unit_amount_decimal": "0.08",
322
+ "currency": "EUR",
323
+ "description": "Work Price",
324
+ "is_tax_inclusive": true
325
+ }
326
+ ]
327
+ },
328
+ {
329
+ "description": "Product Name",
330
+ "quantity": 1,
331
+ "is_composite_price": true,
332
+ "item_components": [
333
+ {
334
+ "quantity": 1,
335
+ "description": "Price Description",
336
+ "unit_amount": 10000,
337
+ "unit_amount_decimal": "100",
338
+ "unit_amount_currency": "EUR",
339
+ "pricing_model": "per_unit",
340
+ "taxes": [
341
+ {
342
+ "rate": "nontaxable",
343
+ "rateValue": 0,
344
+ "amount": 0
345
+ }
346
+ ],
347
+ "type": "one_time",
348
+ "is_tax_inclusive": true
349
+ }
350
+ ],
351
+ "currency": "EUR"
352
+ },
353
+ {
354
+ "price_id": "b59acf37-3cc0-456c-a712-1db0fc478d2d",
355
+ "product_id": "c5695fb5-f02d-4e46-9fb2-a36dc4e9876f",
356
+ "quantity": 1,
357
+ "description": "Power Test",
358
+ "is_composite_price": true,
359
+ "item_components": [
360
+ {
361
+ "price_id": "583fb57a-7549-4624-82d6-342d5e6542f7",
362
+ "product_id": "c5695fb5-f02d-4e46-9fb2-a36dc4e9876f",
363
+ "quantity": 1,
364
+ "description": "Base Price",
365
+ "unit_amount": 1500,
366
+ "unit_amount_decimal": "15",
367
+ "unit_amount_currency": "EUR",
368
+ "pricing_model": "per_unit",
369
+ "type": "recurring",
370
+ "billing_period": "monthly",
371
+ "is_tax_inclusive": false,
372
+ "_coupons": [
373
+ {
374
+ "name": "My Custom Discount",
375
+ "type": "fixed",
376
+ "fixed_value": 500,
377
+ "fixed_value_currency": "EUR",
378
+ "fixed_value_decimal": "5",
379
+ "category": "discount",
380
+ "active": true,
381
+ "_schema": "coupon",
382
+ "requires_promo_code": false,
383
+ "_org": "739224",
384
+ "_created_at": "2025-02-24T10:01:24.537Z",
385
+ "_updated_at": "2025-02-24T10:01:24.537Z",
386
+ "percentage_value": "0",
387
+ "_title": "My Custom Discount"
388
+ }
389
+ ]
390
+ },
391
+ {
392
+ "price_id": "25c7dc77-ac80-480a-92c0-8c0e913b5534",
393
+ "product_id": "c5695fb5-f02d-4e46-9fb2-a36dc4e9876f",
394
+ "quantity": 1,
395
+ "description": "Work Price",
396
+ "unit_amount": 10,
397
+ "unit_amount_decimal": "0.10123",
398
+ "unit_amount_currency": "EUR",
399
+ "pricing_model": "per_unit",
400
+ "taxes": [
401
+ {
402
+ "tax": {
403
+ "_schema": "tax",
404
+ "active": true,
405
+ "description": "19%",
406
+ "rate": 19,
407
+ "region": "DE",
408
+ "type": "VAT",
409
+ "_id": "bd488a36-cae5-4b18-9ca5-f5cbf6d9735b",
410
+ "_org": "739224",
411
+ "_created_at": "2025-01-15T12:04:52.431Z",
412
+ "_updated_at": "2025-01-15T12:04:52.431Z",
413
+ "_title": "19%"
414
+ },
415
+ "amount": 2
416
+ }
417
+ ],
418
+ "type": "recurring",
419
+ "billing_period": "monthly",
420
+ "unit_amount_net": 8,
421
+ "unit_amount_gross": 10,
422
+ "amount_subtotal": 8,
423
+ "amount_total": 10,
424
+ "amount_tax": 2,
425
+ "is_tax_inclusive": true,
426
+ "unit_amount_net_decimal": "0.084033613445",
427
+ "unit_amount_gross_decimal": "0.1",
428
+ "amount_subtotal_decimal": "0.084033613445",
429
+ "amount_total_decimal": "0.1"
430
+ }
431
+ ],
432
+ "price_mappings": [
433
+ {
434
+ "price_id": "583fb57a-7549-4624-82d6-342d5e6542f7",
435
+ "value": 1
436
+ },
437
+ {
438
+ "price_id": "25c7dc77-ac80-480a-92c0-8c0e913b5534",
439
+ "value": 2000
440
+ }
441
+ ],
442
+ "currency": "EUR"
178
443
  }
179
444
  ]
180
445
  }
@@ -4081,7 +4346,7 @@
4081
4346
  "$ref": "#/components/schemas/MetaData"
4082
4347
  },
4083
4348
  "quantity": {
4084
- "type": "integer",
4349
+ "type": "number",
4085
4350
  "description": "The quantity of products being purchased."
4086
4351
  },
4087
4352
  "product_id": {
@@ -4092,14 +4357,18 @@
4092
4357
  "type": "string",
4093
4358
  "description": "The id of the price."
4094
4359
  },
4095
- "is_composite_price": {
4096
- "description": "The flag for prices that contain price components.",
4097
- "type": "boolean"
4098
- },
4099
4360
  "description": {
4100
4361
  "type": "string",
4101
4362
  "description": "An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name."
4102
4363
  },
4364
+ "product_description": {
4365
+ "type": "string",
4366
+ "description": "The description for the product."
4367
+ },
4368
+ "product_name": {
4369
+ "type": "string",
4370
+ "description": "The name for the product."
4371
+ },
4103
4372
  "price_mappings": {
4104
4373
  "description": "Price mapping information required to compute totals",
4105
4374
  "$ref": "#/components/schemas/PriceInputMappings"
@@ -4118,18 +4387,28 @@
4118
4387
  }
4119
4388
  }
4120
4389
  },
4390
+ "PriceItemUnion": {
4391
+ "anyOf": [
4392
+ {
4393
+ "$ref": "#/components/schemas/PriceItemDto"
4394
+ },
4395
+ {
4396
+ "$ref": "#/components/schemas/CompositePriceItemDto"
4397
+ }
4398
+ ],
4399
+ "discriminator": {
4400
+ "propertyName": "is_composite_price",
4401
+ "mapping": {
4402
+ "false": "#/components/schemas/PriceItemDto",
4403
+ "true": "#/components/schemas/CompositePriceItemDto"
4404
+ }
4405
+ }
4406
+ },
4121
4407
  "PriceItemsDto": {
4122
4408
  "description": "A valid set of product prices, quantities, (discounts) and taxes from a client.",
4123
4409
  "type": "array",
4124
4410
  "items": {
4125
- "anyOf": [
4126
- {
4127
- "$ref": "#/components/schemas/PriceItemDto"
4128
- },
4129
- {
4130
- "$ref": "#/components/schemas/CompositePriceItemDto"
4131
- }
4132
- ]
4411
+ "$ref": "#/components/schemas/PriceItemUnion"
4133
4412
  }
4134
4413
  },
4135
4414
  "BasePriceItemDto": {
@@ -4197,7 +4476,7 @@
4197
4476
  "items": {
4198
4477
  "oneOf": [
4199
4478
  {
4200
- "$ref": "#/components/schemas/Coupon"
4479
+ "$ref": "#/components/schemas/CouponItem"
4201
4480
  }
4202
4481
  ]
4203
4482
  }
@@ -4205,113 +4484,128 @@
4205
4484
  }
4206
4485
  },
4207
4486
  "PriceItemDto": {
4487
+ "description": "Represents a price input to the pricing library.",
4208
4488
  "allOf": [
4209
4489
  {
4210
4490
  "$ref": "#/components/schemas/BasePriceItemDto"
4211
- }
4212
- ],
4213
- "description": "Represents a price input to the pricing library.",
4214
- "type": "object",
4215
- "properties": {
4216
- "type": {
4217
- "type": "string",
4218
- "description": "One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.",
4219
- "enum": [
4220
- "one_time",
4221
- "recurring"
4222
- ]
4223
- },
4224
- "billing_period": {
4225
- "type": "string",
4226
- "description": "The price billing period.",
4227
- "enum": [
4228
- "weekly",
4229
- "monthly",
4230
- "every_quarter",
4231
- "every_6_months",
4232
- "yearly"
4233
- ]
4234
- },
4235
- "unit_amount": {
4236
- "type": "integer",
4237
- "description": "The unit amount value"
4238
- },
4239
- "unit_amount_gross": {
4240
- "type": "integer",
4241
- "description": "The unit gross amount value."
4242
- },
4243
- "unit_amount_currency": {
4244
- "$ref": "#/components/schemas/Currency"
4245
- },
4246
- "unit_amount_decimal": {
4247
- "description": "The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
4248
- "type": "string"
4249
- },
4250
- "pricing_model": {
4251
- "type": "string",
4252
- "description": "Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.\n- `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity\n- `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.\n- `tiered_volume` indicates that the unit pricing will be computed using tiers attribute. The customer pays the same unit price for all purchased units.\n- `tiered_flatfee` indicates that the unit pricing will be computed using tiers attribute. The customer pays the same unit price for all purchased units.\n- `dynamic_tariff` indicates that the price is dynamically dependend on the (quarter)-hourly spot market price.\n- `external_getag` indicates that the price is influenced by aquisition fees provided by GetAG.\n",
4253
- "enum": [
4254
- "per_unit",
4255
- "tiered_graduated",
4256
- "tiered_volume",
4257
- "tiered_flatfee",
4258
- "dynamic_tariff",
4259
- "external_getag"
4260
- ]
4261
4491
  },
4262
- "_price": {
4263
- "description": "The snapshot of the price linked to the price item.",
4264
- "allOf": [
4265
- {
4266
- "$ref": "#/components/schemas/Price"
4492
+ {
4493
+ "type": "object",
4494
+ "properties": {
4495
+ "type": {
4496
+ "type": "string",
4497
+ "description": "One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.",
4498
+ "enum": [
4499
+ "one_time",
4500
+ "recurring"
4501
+ ]
4502
+ },
4503
+ "billing_period": {
4504
+ "type": "string",
4505
+ "description": "The price billing period.",
4506
+ "enum": [
4507
+ "weekly",
4508
+ "monthly",
4509
+ "every_quarter",
4510
+ "every_6_months",
4511
+ "yearly"
4512
+ ]
4513
+ },
4514
+ "unit_amount": {
4515
+ "type": "integer",
4516
+ "description": "The unit amount value"
4517
+ },
4518
+ "unit_amount_gross": {
4519
+ "type": "integer",
4520
+ "description": "The unit gross amount value."
4521
+ },
4522
+ "unit_amount_currency": {
4523
+ "$ref": "#/components/schemas/Currency"
4524
+ },
4525
+ "unit_amount_decimal": {
4526
+ "description": "The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
4527
+ "type": "string"
4528
+ },
4529
+ "is_composite_price": {
4530
+ "description": "The flag for prices that contain price components.",
4531
+ "type": "boolean",
4532
+ "enum": [
4533
+ false
4534
+ ]
4535
+ },
4536
+ "pricing_model": {
4537
+ "type": "string",
4538
+ "description": "Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.\n- `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity\n- `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.\n- `tiered_volume` indicates that the unit pricing will be computed using tiers attribute. The customer pays the same unit price for all purchased units.\n- `tiered_flatfee` indicates that the unit pricing will be computed using tiers attribute. The customer pays the same unit price for all purchased units.\n- `dynamic_tariff` indicates that the price is dynamically dependend on the (quarter)-hourly spot market price.\n- `external_getag` indicates that the price is influenced by aquisition fees provided by GetAG.\n",
4539
+ "enum": [
4540
+ "per_unit",
4541
+ "tiered_graduated",
4542
+ "tiered_volume",
4543
+ "tiered_flatfee",
4544
+ "dynamic_tariff",
4545
+ "external_getag"
4546
+ ]
4547
+ },
4548
+ "_price": {
4549
+ "description": "The snapshot of the price linked to the price item.",
4550
+ "allOf": [
4551
+ {
4552
+ "$ref": "#/components/schemas/Price"
4553
+ }
4554
+ ]
4267
4555
  }
4268
- ]
4556
+ }
4269
4557
  }
4270
- },
4271
- "required": [
4272
- "pricing_model"
4273
4558
  ]
4274
4559
  },
4275
4560
  "CompositePriceItemDto": {
4561
+ "description": "Represents a composite price input to the pricing library.",
4276
4562
  "allOf": [
4277
4563
  {
4278
4564
  "$ref": "#/components/schemas/BasePriceItemDto"
4279
- }
4280
- ],
4281
- "description": "Represents a composite price input to the pricing library.",
4282
- "type": "object",
4283
- "properties": {
4284
- "item_components": {
4285
- "type": "array",
4286
- "description": "Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).",
4287
- "items": {
4288
- "$ref": "#/components/schemas/PriceItemDto"
4289
- }
4290
- },
4291
- "selected_price_component_ids": {
4292
- "type": "array",
4293
- "description": "The ids of the price components that should be selected for the price calculation.",
4294
- "items": {
4295
- "type": "string",
4296
- "description": "The id of the price component"
4297
- }
4298
4565
  },
4299
- "price_component_coupon_ids": {
4566
+ {
4300
4567
  "type": "object",
4301
- "description": "The map of coupon ids applicable to the price components",
4302
- "readOnly": true,
4303
- "additionalProperties": {
4304
- "type": "array",
4305
- "items": {
4306
- "type": "string",
4307
- "description": "The id of the coupon"
4568
+ "properties": {
4569
+ "is_composite_price": {
4570
+ "description": "The flag for prices that contain price components.",
4571
+ "type": "boolean",
4572
+ "enum": [
4573
+ true
4574
+ ]
4575
+ },
4576
+ "item_components": {
4577
+ "type": "array",
4578
+ "description": "Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).",
4579
+ "items": {
4580
+ "$ref": "#/components/schemas/PriceItemDto"
4581
+ }
4582
+ },
4583
+ "selected_price_component_ids": {
4584
+ "type": "array",
4585
+ "description": "The ids of the price components that should be selected for the price calculation.",
4586
+ "items": {
4587
+ "type": "string",
4588
+ "description": "The id of the price component"
4589
+ }
4590
+ },
4591
+ "price_component_coupon_ids": {
4592
+ "type": "object",
4593
+ "description": "The map of coupon ids applicable to the price components",
4594
+ "readOnly": true,
4595
+ "additionalProperties": {
4596
+ "type": "array",
4597
+ "items": {
4598
+ "type": "string",
4599
+ "description": "The id of the coupon"
4600
+ }
4601
+ }
4602
+ },
4603
+ "_price": {
4604
+ "$ref": "#/components/schemas/CompositePrice"
4308
4605
  }
4309
4606
  }
4310
- },
4311
- "_price": {
4312
- "$ref": "#/components/schemas/CompositePrice"
4313
4607
  }
4314
- }
4608
+ ]
4315
4609
  },
4316
4610
  "TaxAmountDto": {
4317
4611
  "type": "object",
@@ -4770,7 +5064,7 @@
4770
5064
  "items": {
4771
5065
  "oneOf": [
4772
5066
  {
4773
- "$ref": "#/components/schemas/Coupon"
5067
+ "$ref": "#/components/schemas/CouponItem"
4774
5068
  }
4775
5069
  ]
4776
5070
  }
@@ -5843,6 +6137,115 @@
5843
6137
  }
5844
6138
  }
5845
6139
  },
6140
+ "CouponItem": {
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
+ },
5846
6249
  "CouponWithoutPromoCodes": {
5847
6250
  "allOf": [
5848
6251
  {
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@epilot/pricing-client",
3
- "version": "3.47.5",
3
+ "version": "3.47.7",
4
4
  "description": "Client for epilot Pricing APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "author": "epilot GmbH",
8
8
  "license": "MIT",
9
+ "private": false,
9
10
  "repository": {
10
11
  "type": "git",
11
12
  "url": "git+https://github.com/epilot-dev/sdk-js.git",