@epilot/pricing-client 3.47.6 → 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,10 +456,6 @@ 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
  */
@@ -725,37 +721,7 @@ declare namespace Components {
725
721
  /**
726
722
  * The coupons applicable to the price item
727
723
  */
728
- _coupons?: (/**
729
- * The coupon configuration
730
- * example:
731
- * {
732
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
733
- * "_schema": "coupon",
734
- * "_org": "org_12345",
735
- * "_created_at": "2024-01-15T10:00:00.000Z",
736
- * "_updated_at": "2024-01-20T12:00:00.000Z",
737
- * "_title": "Sample Coupon",
738
- * "name": "Sample Coupon",
739
- * "type": "fixed",
740
- * "fixed_value": 555,
741
- * "fixed_value_currency": "USD",
742
- * "fixed_value_decimal": "5.55",
743
- * "active": true,
744
- * "prices": {
745
- * "$relation": [
746
- * {
747
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
748
- * "_tags": [
749
- * "discount",
750
- * "special"
751
- * ],
752
- * "_schema": "price"
753
- * }
754
- * ]
755
- * }
756
- * }
757
- */
758
- Coupon)[];
724
+ _coupons?: (CouponItem)[];
759
725
  /**
760
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'.
761
727
  */
@@ -778,10 +744,6 @@ declare namespace Components {
778
744
  * The id of the price.
779
745
  */
780
746
  price_id?: string;
781
- /**
782
- * The flag for prices that contain price components.
783
- */
784
- is_composite_price?: boolean;
785
747
  /**
786
748
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
787
749
  */
@@ -935,10 +897,6 @@ declare namespace Components {
935
897
  * The id of the price.
936
898
  */
937
899
  price_id?: string;
938
- /**
939
- * The flag for prices that contain price components.
940
- */
941
- is_composite_price?: boolean;
942
900
  /**
943
901
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
944
902
  */
@@ -1101,37 +1059,7 @@ declare namespace Components {
1101
1059
  /**
1102
1060
  * The coupons applicable to the price item
1103
1061
  */
1104
- _coupons?: (/**
1105
- * The coupon configuration
1106
- * example:
1107
- * {
1108
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
1109
- * "_schema": "coupon",
1110
- * "_org": "org_12345",
1111
- * "_created_at": "2024-01-15T10:00:00.000Z",
1112
- * "_updated_at": "2024-01-20T12:00:00.000Z",
1113
- * "_title": "Sample Coupon",
1114
- * "name": "Sample Coupon",
1115
- * "type": "fixed",
1116
- * "fixed_value": 555,
1117
- * "fixed_value_currency": "USD",
1118
- * "fixed_value_decimal": "5.55",
1119
- * "active": true,
1120
- * "prices": {
1121
- * "$relation": [
1122
- * {
1123
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
1124
- * "_tags": [
1125
- * "discount",
1126
- * "special"
1127
- * ],
1128
- * "_schema": "price"
1129
- * }
1130
- * ]
1131
- * }
1132
- * }
1133
- */
1134
- Coupon)[];
1062
+ _coupons?: (CouponItem)[];
1135
1063
  }
1136
1064
  export interface BasicAuthCredentials {
1137
1065
  /**
@@ -1624,10 +1552,6 @@ declare namespace Components {
1624
1552
  * The id of the price.
1625
1553
  */
1626
1554
  price_id?: string;
1627
- /**
1628
- * The flag for prices that contain price components.
1629
- */
1630
- is_composite_price?: boolean;
1631
1555
  /**
1632
1556
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
1633
1557
  */
@@ -1893,37 +1817,7 @@ declare namespace Components {
1893
1817
  /**
1894
1818
  * The coupons applicable to the price item
1895
1819
  */
1896
- _coupons?: (/**
1897
- * The coupon configuration
1898
- * example:
1899
- * {
1900
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
1901
- * "_schema": "coupon",
1902
- * "_org": "org_12345",
1903
- * "_created_at": "2024-01-15T10:00:00.000Z",
1904
- * "_updated_at": "2024-01-20T12:00:00.000Z",
1905
- * "_title": "Sample Coupon",
1906
- * "name": "Sample Coupon",
1907
- * "type": "fixed",
1908
- * "fixed_value": 555,
1909
- * "fixed_value_currency": "USD",
1910
- * "fixed_value_decimal": "5.55",
1911
- * "active": true,
1912
- * "prices": {
1913
- * "$relation": [
1914
- * {
1915
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
1916
- * "_tags": [
1917
- * "discount",
1918
- * "special"
1919
- * ],
1920
- * "_schema": "price"
1921
- * }
1922
- * ]
1923
- * }
1924
- * }
1925
- */
1926
- Coupon)[];
1820
+ _coupons?: (CouponItem)[];
1927
1821
  /**
1928
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'.
1929
1823
  */
@@ -1958,10 +1852,6 @@ declare namespace Components {
1958
1852
  * The id of the price.
1959
1853
  */
1960
1854
  price_id?: string;
1961
- /**
1962
- * The flag for prices that contain price components.
1963
- */
1964
- is_composite_price?: boolean;
1965
1855
  /**
1966
1856
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
1967
1857
  */
@@ -2124,37 +2014,11 @@ declare namespace Components {
2124
2014
  /**
2125
2015
  * The coupons applicable to the price item
2126
2016
  */
2127
- _coupons?: (/**
2128
- * The coupon configuration
2129
- * example:
2130
- * {
2131
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
2132
- * "_schema": "coupon",
2133
- * "_org": "org_12345",
2134
- * "_created_at": "2024-01-15T10:00:00.000Z",
2135
- * "_updated_at": "2024-01-20T12:00:00.000Z",
2136
- * "_title": "Sample Coupon",
2137
- * "name": "Sample Coupon",
2138
- * "type": "fixed",
2139
- * "fixed_value": 555,
2140
- * "fixed_value_currency": "USD",
2141
- * "fixed_value_decimal": "5.55",
2142
- * "active": true,
2143
- * "prices": {
2144
- * "$relation": [
2145
- * {
2146
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
2147
- * "_tags": [
2148
- * "discount",
2149
- * "special"
2150
- * ],
2151
- * "_schema": "price"
2152
- * }
2153
- * ]
2154
- * }
2155
- * }
2017
+ _coupons?: (CouponItem)[];
2018
+ /**
2019
+ * The flag for prices that contain price components.
2156
2020
  */
2157
- Coupon)[];
2021
+ is_composite_price?: true;
2158
2022
  /**
2159
2023
  * Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).
2160
2024
  */
@@ -2524,6 +2388,66 @@ declare namespace Components {
2524
2388
  [name: string]: number;
2525
2389
  };
2526
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
+ }
2527
2451
  /**
2528
2452
  * The coupon configuration
2529
2453
  * example:
@@ -3899,10 +3823,6 @@ declare namespace Components {
3899
3823
  * The id of the price.
3900
3824
  */
3901
3825
  price_id?: string;
3902
- /**
3903
- * The flag for prices that contain price components.
3904
- */
3905
- is_composite_price?: boolean;
3906
3826
  /**
3907
3827
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
3908
3828
  */
@@ -4168,37 +4088,7 @@ declare namespace Components {
4168
4088
  /**
4169
4089
  * The coupons applicable to the price item
4170
4090
  */
4171
- _coupons?: (/**
4172
- * The coupon configuration
4173
- * example:
4174
- * {
4175
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
4176
- * "_schema": "coupon",
4177
- * "_org": "org_12345",
4178
- * "_created_at": "2024-01-15T10:00:00.000Z",
4179
- * "_updated_at": "2024-01-20T12:00:00.000Z",
4180
- * "_title": "Sample Coupon",
4181
- * "name": "Sample Coupon",
4182
- * "type": "fixed",
4183
- * "fixed_value": 555,
4184
- * "fixed_value_currency": "USD",
4185
- * "fixed_value_decimal": "5.55",
4186
- * "active": true,
4187
- * "prices": {
4188
- * "$relation": [
4189
- * {
4190
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
4191
- * "_tags": [
4192
- * "discount",
4193
- * "special"
4194
- * ],
4195
- * "_schema": "price"
4196
- * }
4197
- * ]
4198
- * }
4199
- * }
4200
- */
4201
- Coupon)[];
4091
+ _coupons?: (CouponItem)[];
4202
4092
  /**
4203
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'.
4204
4094
  */
@@ -4243,10 +4133,6 @@ declare namespace Components {
4243
4133
  * The id of the price.
4244
4134
  */
4245
4135
  price_id?: string;
4246
- /**
4247
- * The flag for prices that contain price components.
4248
- */
4249
- is_composite_price?: boolean;
4250
4136
  /**
4251
4137
  * An arbitrary string attached to the price item. Often useful for displaying to users. Defaults to product name.
4252
4138
  */
@@ -4409,37 +4295,7 @@ declare namespace Components {
4409
4295
  /**
4410
4296
  * The coupons applicable to the price item
4411
4297
  */
4412
- _coupons?: (/**
4413
- * The coupon configuration
4414
- * example:
4415
- * {
4416
- * "_id": "123e4567-e89b-12d3-a456-426614174000",
4417
- * "_schema": "coupon",
4418
- * "_org": "org_12345",
4419
- * "_created_at": "2024-01-15T10:00:00.000Z",
4420
- * "_updated_at": "2024-01-20T12:00:00.000Z",
4421
- * "_title": "Sample Coupon",
4422
- * "name": "Sample Coupon",
4423
- * "type": "fixed",
4424
- * "fixed_value": 555,
4425
- * "fixed_value_currency": "USD",
4426
- * "fixed_value_decimal": "5.55",
4427
- * "active": true,
4428
- * "prices": {
4429
- * "$relation": [
4430
- * {
4431
- * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
4432
- * "_tags": [
4433
- * "discount",
4434
- * "special"
4435
- * ],
4436
- * "_schema": "price"
4437
- * }
4438
- * ]
4439
- * }
4440
- * }
4441
- */
4442
- Coupon)[];
4298
+ _coupons?: (CouponItem)[];
4443
4299
  /**
4444
4300
  * One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
4445
4301
  */
@@ -4468,6 +4324,10 @@ declare namespace Components {
4468
4324
  * The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.
4469
4325
  */
4470
4326
  unit_amount_decimal?: string;
4327
+ /**
4328
+ * The flag for prices that contain price components.
4329
+ */
4330
+ is_composite_price?: false;
4471
4331
  /**
4472
4332
  * Describes how to compute the price per period. Either `per_unit`, `tiered_graduated` or `tiered_volume`.
4473
4333
  * - `per_unit` indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity
@@ -4478,7 +4338,7 @@ declare namespace Components {
4478
4338
  * - `external_getag` indicates that the price is influenced by aquisition fees provided by GetAG.
4479
4339
  *
4480
4340
  */
4481
- 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";
4482
4342
  /**
4483
4343
  * The snapshot of the price linked to the price item.
4484
4344
  * example:
@@ -4660,6 +4520,7 @@ declare namespace Components {
4660
4520
  _tags?: string[];
4661
4521
  };
4662
4522
  }
4523
+ export type PriceItemUnion = /* Represents a price input to the pricing library. */ PriceItemDto | /* Represents a composite price input to the pricing library. */ CompositePriceItemDto;
4663
4524
  /**
4664
4525
  * Tracks a set of product prices, quantities, (discounts) and taxes.
4665
4526
  */
@@ -4681,7 +4542,7 @@ declare namespace Components {
4681
4542
  /**
4682
4543
  * A valid set of product prices, quantities, (discounts) and taxes from a client.
4683
4544
  */
4684
- 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[];
4685
4546
  export interface PriceTier {
4686
4547
  up_to?: number | null;
4687
4548
  flat_fee_amount?: number;
@@ -6387,6 +6248,7 @@ export type ComputedPriceBreakdown = Components.Schemas.ComputedPriceBreakdown;
6387
6248
  export type ComputedPriceComponents = Components.Schemas.ComputedPriceComponents;
6388
6249
  export type ConsumptionTypeGetAg = Components.Schemas.ConsumptionTypeGetAg;
6389
6250
  export type Coupon = Components.Schemas.Coupon;
6251
+ export type CouponItem = Components.Schemas.CouponItem;
6390
6252
  export type CouponWithoutPromoCodes = Components.Schemas.CouponWithoutPromoCodes;
6391
6253
  export type Currency = Components.Schemas.Currency;
6392
6254
  export type Customer = Components.Schemas.Customer;
@@ -6431,6 +6293,7 @@ export type PriceInputMapping = Components.Schemas.PriceInputMapping;
6431
6293
  export type PriceInputMappings = Components.Schemas.PriceInputMappings;
6432
6294
  export type PriceItem = Components.Schemas.PriceItem;
6433
6295
  export type PriceItemDto = Components.Schemas.PriceItemDto;
6296
+ export type PriceItemUnion = Components.Schemas.PriceItemUnion;
6434
6297
  export type PriceItems = Components.Schemas.PriceItems;
6435
6298
  export type PriceItemsDto = Components.Schemas.PriceItemsDto;
6436
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,10 +4357,6 @@
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."
@@ -4126,18 +4387,28 @@
4126
4387
  }
4127
4388
  }
4128
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
+ },
4129
4407
  "PriceItemsDto": {
4130
4408
  "description": "A valid set of product prices, quantities, (discounts) and taxes from a client.",
4131
4409
  "type": "array",
4132
4410
  "items": {
4133
- "anyOf": [
4134
- {
4135
- "$ref": "#/components/schemas/PriceItemDto"
4136
- },
4137
- {
4138
- "$ref": "#/components/schemas/CompositePriceItemDto"
4139
- }
4140
- ]
4411
+ "$ref": "#/components/schemas/PriceItemUnion"
4141
4412
  }
4142
4413
  },
4143
4414
  "BasePriceItemDto": {
@@ -4205,7 +4476,7 @@
4205
4476
  "items": {
4206
4477
  "oneOf": [
4207
4478
  {
4208
- "$ref": "#/components/schemas/Coupon"
4479
+ "$ref": "#/components/schemas/CouponItem"
4209
4480
  }
4210
4481
  ]
4211
4482
  }
@@ -4213,113 +4484,128 @@
4213
4484
  }
4214
4485
  },
4215
4486
  "PriceItemDto": {
4487
+ "description": "Represents a price input to the pricing library.",
4216
4488
  "allOf": [
4217
4489
  {
4218
4490
  "$ref": "#/components/schemas/BasePriceItemDto"
4219
- }
4220
- ],
4221
- "description": "Represents a price input to the pricing library.",
4222
- "type": "object",
4223
- "properties": {
4224
- "type": {
4225
- "type": "string",
4226
- "description": "One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.",
4227
- "enum": [
4228
- "one_time",
4229
- "recurring"
4230
- ]
4231
- },
4232
- "billing_period": {
4233
- "type": "string",
4234
- "description": "The price billing period.",
4235
- "enum": [
4236
- "weekly",
4237
- "monthly",
4238
- "every_quarter",
4239
- "every_6_months",
4240
- "yearly"
4241
- ]
4242
4491
  },
4243
- "unit_amount": {
4244
- "type": "integer",
4245
- "description": "The unit amount value"
4246
- },
4247
- "unit_amount_gross": {
4248
- "type": "integer",
4249
- "description": "The unit gross amount value."
4250
- },
4251
- "unit_amount_currency": {
4252
- "$ref": "#/components/schemas/Currency"
4253
- },
4254
- "unit_amount_decimal": {
4255
- "description": "The unit amount in cents to be charged, represented as a decimal string with at most 12 decimal places.",
4256
- "type": "string"
4257
- },
4258
- "pricing_model": {
4259
- "type": "string",
4260
- "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",
4261
- "enum": [
4262
- "per_unit",
4263
- "tiered_graduated",
4264
- "tiered_volume",
4265
- "tiered_flatfee",
4266
- "dynamic_tariff",
4267
- "external_getag"
4268
- ]
4269
- },
4270
- "_price": {
4271
- "description": "The snapshot of the price linked to the price item.",
4272
- "allOf": [
4273
- {
4274
- "$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
+ ]
4275
4555
  }
4276
- ]
4556
+ }
4277
4557
  }
4278
- },
4279
- "required": [
4280
- "pricing_model"
4281
4558
  ]
4282
4559
  },
4283
4560
  "CompositePriceItemDto": {
4561
+ "description": "Represents a composite price input to the pricing library.",
4284
4562
  "allOf": [
4285
4563
  {
4286
4564
  "$ref": "#/components/schemas/BasePriceItemDto"
4287
- }
4288
- ],
4289
- "description": "Represents a composite price input to the pricing library.",
4290
- "type": "object",
4291
- "properties": {
4292
- "item_components": {
4293
- "type": "array",
4294
- "description": "Contains price item configurations, per price component, when the main price item is a [composite price](/api/pricing#tag/dynamic_price_schema).",
4295
- "items": {
4296
- "$ref": "#/components/schemas/PriceItemDto"
4297
- }
4298
- },
4299
- "selected_price_component_ids": {
4300
- "type": "array",
4301
- "description": "The ids of the price components that should be selected for the price calculation.",
4302
- "items": {
4303
- "type": "string",
4304
- "description": "The id of the price component"
4305
- }
4306
4565
  },
4307
- "price_component_coupon_ids": {
4566
+ {
4308
4567
  "type": "object",
4309
- "description": "The map of coupon ids applicable to the price components",
4310
- "readOnly": true,
4311
- "additionalProperties": {
4312
- "type": "array",
4313
- "items": {
4314
- "type": "string",
4315
- "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"
4316
4605
  }
4317
4606
  }
4318
- },
4319
- "_price": {
4320
- "$ref": "#/components/schemas/CompositePrice"
4321
4607
  }
4322
- }
4608
+ ]
4323
4609
  },
4324
4610
  "TaxAmountDto": {
4325
4611
  "type": "object",
@@ -4778,7 +5064,7 @@
4778
5064
  "items": {
4779
5065
  "oneOf": [
4780
5066
  {
4781
- "$ref": "#/components/schemas/Coupon"
5067
+ "$ref": "#/components/schemas/CouponItem"
4782
5068
  }
4783
5069
  ]
4784
5070
  }
@@ -5851,6 +6137,115 @@
5851
6137
  }
5852
6138
  }
5853
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
+ },
5854
6249
  "CouponWithoutPromoCodes": {
5855
6250
  "allOf": [
5856
6251
  {
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@epilot/pricing-client",
3
- "version": "3.47.6",
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",