@epilot/pricing-client 3.28.0 → 3.29.0

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,t,r){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(240));t.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/order":{"post":{"operationId":"createOrder","requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/order/{id}":{"put":{"operationId":"putOrder","parameters":[{"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/public/cart:checkout":{"post":{"operationId":"$checkoutCart","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/public/catalog":{"post":{"operationId":"$searchCatalog","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/catalog":{"post":{"operationId":"$privateSearchCatalog","requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/public/availability:check":{"post":{"operationId":"$availabilityCheck","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/validate-availability/{id}":{"get":{"operationId":"$validateAvailabilityFile","parameters":[{"in":"path","name":"id","required":true},{"in":"header","name":"X-Epilot-Org-ID","required":true}]}},"/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":{}}}}},"/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":{}}}}},"/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":{}}}}},"/v1/integration/{integrationId}/credentials":{"get":{"operationId":"$getCredentials","parameters":[{"in":"path","name":"integrationId","required":true}]}},"/v1/integration/{integrationId}/credentials:save":{"put":{"operationId":"$saveCredentials","parameters":[{"in":"path","name":"integrationId","required":true}],"requestBody":{"content":{"application/json":{}}}}},"/v1/integration/{integrationId}/credentials:delete":{"delete":{"operationId":"$deleteCredentials","parameters":[{"in":"path","name":"integrationId","required":true}]}},"/v1/public/opportunity":{"post":{"deprecated":true,"operationId":"$createOpportunity","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}}}}},"components":{}}')}},t={},r=function r(i){var a=t[i];if(void 0!==a)return a.exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,r),n.exports}(914),i=exports;for(var a in r)i[a]=r[a];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var e={914:function(e,t,r){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(240));t.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":{}}}}},"/v1/order":{"post":{"operationId":"createOrder","requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/order/{id}":{"put":{"operationId":"putOrder","parameters":[{"in":"path","name":"id","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/public/cart:checkout":{"post":{"operationId":"$checkoutCart","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/public/catalog":{"post":{"operationId":"$searchCatalog","parameters":[{"in":"header","name":"X-Ivy-Org-ID"},{"in":"header","name":"Authorization"}],"requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/catalog":{"post":{"operationId":"$privateSearchCatalog","requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/public/availability:check":{"post":{"operationId":"$availabilityCheck","parameters":[{"in":"header","name":"X-Ivy-Org-ID","required":true}],"requestBody":{"required":true,"content":{"application/json":{}}}}},"/v1/validate-availability/{id}":{"get":{"operationId":"$validateAvailabilityFile","parameters":[{"in":"path","name":"id","required":true},{"in":"header","name":"X-Epilot-Org-ID","required":true}]}},"/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":{}}}}},"/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":{}}}}},"/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":{}}}}},"/v1/integration/{integrationId}/credentials":{"get":{"operationId":"$getCredentials","parameters":[{"in":"path","name":"integrationId","required":true}]}},"/v1/integration/{integrationId}/credentials:save":{"put":{"operationId":"$saveCredentials","parameters":[{"in":"path","name":"integrationId","required":true}],"requestBody":{"content":{"application/json":{}}}}},"/v1/integration/{integrationId}/credentials:delete":{"delete":{"operationId":"$deleteCredentials","parameters":[{"in":"path","name":"integrationId","required":true}]}}},"components":{}}')}},t={},r=function r(i){var a=t[i];if(void 0!==a)return a.exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,r),n.exports}(914),i=exports;for(var a in r)i[a]=r[a];r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0})})();
@@ -10,6 +10,17 @@
10
10
  }
11
11
  ],
12
12
  "paths": {
13
+ "/v1/pricing:compute": {
14
+ "post": {
15
+ "operationId": "$calculatePricingDetails",
16
+ "requestBody": {
17
+ "required": false,
18
+ "content": {
19
+ "application/json": {}
20
+ }
21
+ }
22
+ }
23
+ },
13
24
  "/v1/order": {
14
25
  "post": {
15
26
  "operationId": "createOrder",
@@ -63,8 +74,11 @@
63
74
  "parameters": [
64
75
  {
65
76
  "in": "header",
66
- "name": "X-Ivy-Org-ID",
67
- "required": true
77
+ "name": "X-Ivy-Org-ID"
78
+ },
79
+ {
80
+ "in": "header",
81
+ "name": "Authorization"
68
82
  }
69
83
  ],
70
84
  "requestBody": {
@@ -229,25 +243,6 @@
229
243
  }
230
244
  ]
231
245
  }
232
- },
233
- "/v1/public/opportunity": {
234
- "post": {
235
- "deprecated": true,
236
- "operationId": "$createOpportunity",
237
- "parameters": [
238
- {
239
- "in": "header",
240
- "name": "X-Ivy-Org-ID",
241
- "required": true
242
- }
243
- ],
244
- "requestBody": {
245
- "required": true,
246
- "content": {
247
- "application/json": {}
248
- }
249
- }
250
- }
251
246
  }
252
247
  },
253
248
  "components": {}
package/dist/openapi.d.ts CHANGED
@@ -179,7 +179,7 @@ declare namespace Components {
179
179
  * Represents a price item
180
180
  * example:
181
181
  * {
182
- * "$ref": "#/components/examples/price-item"
182
+ * "$ref": "#/components/examples/price-item/value"
183
183
  * }
184
184
  */
185
185
  export interface BasePriceItem {
@@ -670,7 +670,37 @@ declare namespace Components {
670
670
  * "$ref": "#/components/examples/price"
671
671
  * }
672
672
  */
673
- Price)[];
673
+ Price | /**
674
+ * The coupon configuration
675
+ * example:
676
+ * {
677
+ * "_id": "123e4567-e89b-12d3-a456-426614174000",
678
+ * "_schema": "coupon",
679
+ * "_org": "org_12345",
680
+ * "_created_at": "2024-01-15T10:00:00.000Z",
681
+ * "_updated_at": "2024-01-20T12:00:00.000Z",
682
+ * "_title": "Sample Coupon",
683
+ * "name": "Sample Coupon",
684
+ * "type": "fixed",
685
+ * "fixed_value": 555,
686
+ * "fixed_value_currency": "USD",
687
+ * "fixed_value_decimal": "5.55",
688
+ * "active": true,
689
+ * "prices": {
690
+ * "$relation": [
691
+ * {
692
+ * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
693
+ * "_tags": [
694
+ * "discount",
695
+ * "special"
696
+ * ],
697
+ * "_schema": "price"
698
+ * }
699
+ * ]
700
+ * }
701
+ * }
702
+ */
703
+ Coupon)[];
674
704
  }
675
705
  /**
676
706
  * The cart checkout request payload
@@ -770,7 +800,7 @@ declare namespace Components {
770
800
  * Represents a composite price input to the pricing library.
771
801
  * example:
772
802
  * {
773
- * "$ref": "#/components/examples/price-item"
803
+ * "$ref": "#/components/examples/price-item/value"
774
804
  * }
775
805
  */
776
806
  export interface CompositePriceItem {
@@ -916,7 +946,7 @@ declare namespace Components {
916
946
  * Represents a price item
917
947
  * example:
918
948
  * {
919
- * "$ref": "#/components/examples/price-item"
949
+ * "$ref": "#/components/examples/price-item/value"
920
950
  * }
921
951
  */
922
952
  PriceItem[];
@@ -1290,6 +1320,101 @@ declare namespace Components {
1290
1320
  [name: string]: /* The computed price */ ComputedBasePrice;
1291
1321
  }
1292
1322
  export type ConsumptionTypeGetAg = "household" | "heating_pump" | "night_storage_heating" | "night_storage_heating_common_meter";
1323
+ /**
1324
+ * The coupon configuration
1325
+ * example:
1326
+ * {
1327
+ * "_id": "123e4567-e89b-12d3-a456-426614174000",
1328
+ * "_schema": "coupon",
1329
+ * "_org": "org_12345",
1330
+ * "_created_at": "2024-01-15T10:00:00.000Z",
1331
+ * "_updated_at": "2024-01-20T12:00:00.000Z",
1332
+ * "_title": "Sample Coupon",
1333
+ * "name": "Sample Coupon",
1334
+ * "type": "fixed",
1335
+ * "fixed_value": 555,
1336
+ * "fixed_value_currency": "USD",
1337
+ * "fixed_value_decimal": "5.55",
1338
+ * "active": true,
1339
+ * "prices": {
1340
+ * "$relation": [
1341
+ * {
1342
+ * "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
1343
+ * "_tags": [
1344
+ * "discount",
1345
+ * "special"
1346
+ * ],
1347
+ * "_schema": "price"
1348
+ * }
1349
+ * ]
1350
+ * }
1351
+ * }
1352
+ */
1353
+ export interface Coupon {
1354
+ [name: string]: any;
1355
+ _id: EntityId /* uuid */;
1356
+ /**
1357
+ * The auto-generated title for the title
1358
+ */
1359
+ _title: string;
1360
+ /**
1361
+ * Organization Id the entity belongs to
1362
+ */
1363
+ _org: string;
1364
+ /**
1365
+ * The schema of the entity, for coupons it is always `coupon`
1366
+ */
1367
+ _schema: "coupon";
1368
+ _tags?: string[];
1369
+ /**
1370
+ * The creation date for the opportunity
1371
+ */
1372
+ _created_at: string; // date-time
1373
+ /**
1374
+ * The date the coupon was last updated
1375
+ */
1376
+ _updated_at: string; // date-time
1377
+ name: string;
1378
+ description?: string;
1379
+ type: "fixed" | "percentage";
1380
+ /**
1381
+ * Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
1382
+ */
1383
+ percentage_value?: number;
1384
+ /**
1385
+ * Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.
1386
+ */
1387
+ fixed_value?: number;
1388
+ /**
1389
+ * 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.
1390
+ */
1391
+ fixed_value_decimal?: string;
1392
+ /**
1393
+ * Use if type is set to fixed. Three-letter ISO currency code, in lowercase.
1394
+ */
1395
+ fixed_value_currency?: /* Use if type is set to fixed. Three-letter ISO currency code, in lowercase. */ /**
1396
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
1397
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
1398
+ *
1399
+ * example:
1400
+ * EUR
1401
+ */
1402
+ Currency;
1403
+ active?: boolean;
1404
+ /**
1405
+ * The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.
1406
+ */
1407
+ prices?: /* The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise. */ {
1408
+ $relation?: EntityRelation[];
1409
+ } | /**
1410
+ * The price entity schema for simple pricing
1411
+ * example:
1412
+ * {
1413
+ * "$ref": "#/components/examples/price"
1414
+ * }
1415
+ */
1416
+ Price[];
1417
+ }
1293
1418
  /**
1294
1419
  * Three-letter ISO currency code, in lowercase. Must be a supported currency.
1295
1420
  * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
@@ -2204,7 +2329,7 @@ declare namespace Components {
2204
2329
  * Represents a price item
2205
2330
  * example:
2206
2331
  * {
2207
- * "$ref": "#/components/examples/price-item"
2332
+ * "$ref": "#/components/examples/price-item/value"
2208
2333
  * }
2209
2334
  */
2210
2335
  export interface PriceItem {
@@ -2745,14 +2870,14 @@ declare namespace Components {
2745
2870
  * Represents a price item
2746
2871
  * example:
2747
2872
  * {
2748
- * "$ref": "#/components/examples/price-item"
2873
+ * "$ref": "#/components/examples/price-item/value"
2749
2874
  * }
2750
2875
  */
2751
2876
  PriceItem | /**
2752
2877
  * Represents a composite price input to the pricing library.
2753
2878
  * example:
2754
2879
  * {
2755
- * "$ref": "#/components/examples/price-item"
2880
+ * "$ref": "#/components/examples/price-item/value"
2756
2881
  * }
2757
2882
  */
2758
2883
  CompositePriceItem)[];
@@ -2789,14 +2914,63 @@ declare namespace Components {
2789
2914
  * Represents a price item
2790
2915
  * example:
2791
2916
  * {
2792
- * "$ref": "#/components/examples/price-item"
2917
+ * "$ref": "#/components/examples/price-item/value"
2918
+ * }
2919
+ */
2920
+ PriceItem | /**
2921
+ * Represents a composite price input to the pricing library.
2922
+ * example:
2923
+ * {
2924
+ * "$ref": "#/components/examples/price-item/value"
2925
+ * }
2926
+ */
2927
+ CompositePriceItem)[];
2928
+ /**
2929
+ * Total of all items before (discounts or) taxes are applied.
2930
+ */
2931
+ amount_subtotal?: number;
2932
+ /**
2933
+ * Total of all items after (discounts and) taxes are applied.
2934
+ */
2935
+ amount_total?: number;
2936
+ /**
2937
+ * The unit gross amount value.
2938
+ */
2939
+ unit_amount_gross?: number;
2940
+ /**
2941
+ * The unit net amount value.
2942
+ */
2943
+ unit_amount_net?: number;
2944
+ /**
2945
+ * This is the sum of all the price item tax amounts.
2946
+ */
2947
+ amount_tax?: number;
2948
+ total_details?: /* The total details with tax (and discount) aggregated totals. */ TotalDetails;
2949
+ currency?: /**
2950
+ * Three-letter ISO currency code, in lowercase. Must be a supported currency.
2951
+ * ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
2952
+ *
2953
+ * example:
2954
+ * EUR
2955
+ */
2956
+ Currency;
2957
+ }
2958
+ /**
2959
+ * The result from the calculation of a set of price items.
2960
+ */
2961
+ export interface PricingDetailsResponse {
2962
+ items?: (/**
2963
+ * Represents a price item
2964
+ * example:
2965
+ * {
2966
+ * "$ref": "#/components/examples/price-item/value"
2793
2967
  * }
2794
2968
  */
2795
2969
  PriceItem | /**
2796
2970
  * Represents a composite price input to the pricing library.
2797
2971
  * example:
2798
2972
  * {
2799
- * "$ref": "#/components/examples/price-item"
2973
+ * "$ref": "#/components/examples/price-item/value"
2800
2974
  * }
2801
2975
  */
2802
2976
  CompositePriceItem)[];
@@ -3401,7 +3575,7 @@ declare namespace Paths {
3401
3575
  line_items?: /* A valid set of product prices, quantities, (discounts) and taxes from a client. */ Components.Schemas.PriceItemsDto;
3402
3576
  }
3403
3577
  namespace Responses {
3404
- export type $200 = /* The result from the calculation of a set of price items. */ Components.Schemas.PricingDetails;
3578
+ export type $200 = /* The result from the calculation of a set of price items. */ Components.Schemas.PricingDetailsResponse;
3405
3579
  export type $400 = Components.Schemas.Error;
3406
3580
  }
3407
3581
  }
@@ -3656,7 +3830,7 @@ export interface OperationMethods {
3656
3830
  /**
3657
3831
  * $calculatePricingDetails - calculatePricingDetails
3658
3832
  *
3659
- * Compute price
3833
+ * Computes a set of pricing details that can be persisted on an entity with the pricing capability enabled, e.g: Orders or Contracts.
3660
3834
  */
3661
3835
  '$calculatePricingDetails'(
3662
3836
  parameters?: Parameters<UnknownParamsObject> | null,
@@ -3765,7 +3939,7 @@ export interface OperationMethods {
3765
3939
  config?: AxiosRequestConfig
3766
3940
  ): OperationResponse<Paths.$SearchStreets.Responses.$200>
3767
3941
  /**
3768
- * $computePrice - computePrice
3942
+ * $computePrice - calculatePricingDetails
3769
3943
  *
3770
3944
  * Returns the price for a given product type based on location and consumption
3771
3945
  */
@@ -3811,7 +3985,7 @@ export interface PathsDictionary {
3811
3985
  /**
3812
3986
  * $calculatePricingDetails - calculatePricingDetails
3813
3987
  *
3814
- * Compute price
3988
+ * Computes a set of pricing details that can be persisted on an entity with the pricing capability enabled, e.g: Orders or Contracts.
3815
3989
  */
3816
3990
  'post'(
3817
3991
  parameters?: Parameters<UnknownParamsObject> | null,
@@ -3940,7 +4114,7 @@ export interface PathsDictionary {
3940
4114
  }
3941
4115
  ['/v1/public/integration/{integrationId}/compute-price']: {
3942
4116
  /**
3943
- * $computePrice - computePrice
4117
+ * $computePrice - calculatePricingDetails
3944
4118
  *
3945
4119
  * Returns the price for a given product type based on location and consumption
3946
4120
  */
package/dist/openapi.json CHANGED
@@ -113,7 +113,7 @@
113
113
  "paths": {
114
114
  "/v1/pricing:compute": {
115
115
  "post": {
116
- "description": "Compute price",
116
+ "description": "Computes a set of pricing details that can be persisted on an entity with the pricing capability enabled, e.g: Orders or Contracts.",
117
117
  "summary": "calculatePricingDetails",
118
118
  "operationId": "$calculatePricingDetails",
119
119
  "tags": [
@@ -169,7 +169,124 @@
169
169
  "content": {
170
170
  "application/json": {
171
171
  "schema": {
172
- "$ref": "#/components/schemas/PricingDetails"
172
+ "$ref": "#/components/schemas/PricingDetailsResponse"
173
+ },
174
+ "example": {
175
+ "amount_subtotal": 1000,
176
+ "amount_total": 1000,
177
+ "amount_tax": 0,
178
+ "total_details": {
179
+ "amount_tax": 0,
180
+ "breakdown": {
181
+ "taxes": [
182
+ {
183
+ "tax": {
184
+ "rate": 0
185
+ },
186
+ "amount": 0
187
+ }
188
+ ],
189
+ "recurrences": [
190
+ {
191
+ "type": "one_time",
192
+ "unit_amount_gross": 1000,
193
+ "unit_amount_net": 1000,
194
+ "amount_subtotal": 1000,
195
+ "amount_total": 1000,
196
+ "amount_subtotal_decimal": "10",
197
+ "amount_total_decimal": "10",
198
+ "amount_tax": 0
199
+ }
200
+ ],
201
+ "recurrencesByTax": [
202
+ {
203
+ "type": "one_time",
204
+ "amount_total": 1000,
205
+ "amount_subtotal": 1000,
206
+ "amount_tax": 0,
207
+ "tax": {
208
+ "tax": {
209
+ "rate": 0
210
+ },
211
+ "amount": 0
212
+ }
213
+ }
214
+ ]
215
+ }
216
+ },
217
+ "line_items": [
218
+ {
219
+ "product_id": "c5695fb5-f02d-4e46-9fb2-a36dc4e9876f",
220
+ "price_id": "396cb5f3-ea0b-4629-99ca-303661de5a9b",
221
+ "quantity": 1,
222
+ "currency": "EUR",
223
+ "_price": {
224
+ "description": "Standard price component",
225
+ "pricing_model": "per_unit",
226
+ "unit_amount_currency": "EUR",
227
+ "unit_amount": 1000,
228
+ "unit_amount_decimal": "10",
229
+ "is_tax_inclusive": true,
230
+ "price_display_in_journeys": "show_price",
231
+ "active": true,
232
+ "variable_price": false,
233
+ "type": "one_time",
234
+ "billing_period": null,
235
+ "billing_duration_amount": null,
236
+ "billing_duration_unit": null,
237
+ "notice_time_amount": null,
238
+ "notice_time_unit": null,
239
+ "termination_time_amount": null,
240
+ "termination_time_unit": null,
241
+ "renewal_duration_amount": null,
242
+ "renewal_duration_unit": null,
243
+ "price_components": null,
244
+ "_tags": [],
245
+ "_title": "Standard price component",
246
+ "_id": "396cb5f3-ea0b-4629-99ca-303661de5a9b",
247
+ "internal_description": "Standard price component"
248
+ },
249
+ "_product": {
250
+ "type": "product",
251
+ "_title": "Product PH",
252
+ "name": "Product PH ",
253
+ "price_options": {
254
+ "$relation": [
255
+ {
256
+ "entity_id": "396cb5f3-ea0b-4629-99ca-303661de5a9b",
257
+ "_tags": [],
258
+ "_schema": "price"
259
+ }
260
+ ]
261
+ },
262
+ "_id": "c5695fb5-f02d-4e46-9fb2-a36dc4e9876f",
263
+ "active": true,
264
+ "internal_name": "Product PH",
265
+ "description": ""
266
+ },
267
+ "description": "Standard price component",
268
+ "unit_amount": 1000,
269
+ "unit_amount_net": 1000,
270
+ "unit_amount_net_decimal": "10",
271
+ "unit_amount_gross": 1000,
272
+ "unit_amount_gross_decimal": "10",
273
+ "unit_amount_decimal": "10",
274
+ "amount_subtotal": 1000,
275
+ "amount_total": 1000,
276
+ "amount_tax": 0,
277
+ "taxes": [
278
+ {
279
+ "rate": "nontaxable",
280
+ "rateValue": 0,
281
+ "amount": 0
282
+ }
283
+ ],
284
+ "is_tax_inclusive": true,
285
+ "amount_subtotal_decimal": "10",
286
+ "amount_total_decimal": "10"
287
+ }
288
+ ],
289
+ "currency": "EUR"
173
290
  }
174
291
  }
175
292
  }
@@ -1191,7 +1308,7 @@
1191
1308
  "example": "getag"
1192
1309
  }
1193
1310
  ],
1194
- "summary": "computePrice",
1311
+ "summary": "calculatePricingDetails",
1195
1312
  "tags": [
1196
1313
  "External Integrations API"
1197
1314
  ],
@@ -2546,6 +2663,9 @@
2546
2663
  },
2547
2664
  {
2548
2665
  "$ref": "#/components/schemas/Price"
2666
+ },
2667
+ {
2668
+ "$ref": "#/components/schemas/Coupon"
2549
2669
  }
2550
2670
  ]
2551
2671
  }
@@ -3660,7 +3780,7 @@
3660
3780
  "description": "Represents a price item",
3661
3781
  "type": "object",
3662
3782
  "example": {
3663
- "$ref": "#/components/examples/price-item"
3783
+ "$ref": "#/components/examples/price-item/value"
3664
3784
  },
3665
3785
  "allOf": [
3666
3786
  {
@@ -3814,7 +3934,7 @@
3814
3934
  "description": "Represents a price item",
3815
3935
  "type": "object",
3816
3936
  "example": {
3817
- "$ref": "#/components/examples/price-item"
3937
+ "$ref": "#/components/examples/price-item/value"
3818
3938
  },
3819
3939
  "properties": {
3820
3940
  "type": {
@@ -4103,6 +4223,51 @@
4103
4223
  }
4104
4224
  }
4105
4225
  },
4226
+ "PricingDetailsResponse": {
4227
+ "type": "object",
4228
+ "description": "The result from the calculation of a set of price items.",
4229
+ "properties": {
4230
+ "items": {
4231
+ "type": "array",
4232
+ "items": {
4233
+ "oneOf": [
4234
+ {
4235
+ "$ref": "#/components/schemas/PriceItem"
4236
+ },
4237
+ {
4238
+ "$ref": "#/components/schemas/CompositePriceItem"
4239
+ }
4240
+ ]
4241
+ }
4242
+ },
4243
+ "amount_subtotal": {
4244
+ "type": "integer",
4245
+ "description": "Total of all items before (discounts or) taxes are applied."
4246
+ },
4247
+ "amount_total": {
4248
+ "type": "integer",
4249
+ "description": "Total of all items after (discounts and) taxes are applied."
4250
+ },
4251
+ "unit_amount_gross": {
4252
+ "type": "integer",
4253
+ "description": "The unit gross amount value."
4254
+ },
4255
+ "unit_amount_net": {
4256
+ "type": "integer",
4257
+ "description": "The unit net amount value."
4258
+ },
4259
+ "amount_tax": {
4260
+ "type": "integer",
4261
+ "description": "This is the sum of all the price item tax amounts."
4262
+ },
4263
+ "total_details": {
4264
+ "$ref": "#/components/schemas/TotalDetails"
4265
+ },
4266
+ "currency": {
4267
+ "$ref": "#/components/schemas/Currency"
4268
+ }
4269
+ }
4270
+ },
4106
4271
  "BillingPeriod": {
4107
4272
  "type": "string",
4108
4273
  "enum": [
@@ -4536,6 +4701,147 @@
4536
4701
  }
4537
4702
  }
4538
4703
  },
4704
+ "Coupon": {
4705
+ "type": "object",
4706
+ "description": "The coupon configuration",
4707
+ "additionalProperties": true,
4708
+ "required": [
4709
+ "name",
4710
+ "type",
4711
+ "_id",
4712
+ "_title",
4713
+ "_org",
4714
+ "_schema",
4715
+ "_created_at",
4716
+ "_updated_at"
4717
+ ],
4718
+ "properties": {
4719
+ "_id": {
4720
+ "$ref": "#/components/schemas/EntityId",
4721
+ "readOnly": true
4722
+ },
4723
+ "_title": {
4724
+ "type": "string",
4725
+ "description": "The auto-generated title for the title",
4726
+ "readOnly": true
4727
+ },
4728
+ "_org": {
4729
+ "type": "string",
4730
+ "description": "Organization Id the entity belongs to",
4731
+ "readOnly": true
4732
+ },
4733
+ "_schema": {
4734
+ "type": "string",
4735
+ "enum": [
4736
+ "coupon"
4737
+ ],
4738
+ "readOnly": true,
4739
+ "description": "The schema of the entity, for coupons it is always `coupon`"
4740
+ },
4741
+ "_tags": {
4742
+ "type": "array",
4743
+ "items": {
4744
+ "type": "string"
4745
+ }
4746
+ },
4747
+ "_created_at": {
4748
+ "type": "string",
4749
+ "format": "date-time",
4750
+ "readOnly": true,
4751
+ "description": "The creation date for the opportunity"
4752
+ },
4753
+ "_updated_at": {
4754
+ "type": "string",
4755
+ "format": "date-time",
4756
+ "readOnly": true,
4757
+ "description": "The date the coupon was last updated"
4758
+ },
4759
+ "name": {
4760
+ "type": "string"
4761
+ },
4762
+ "description": {
4763
+ "type": "string"
4764
+ },
4765
+ "type": {
4766
+ "type": "string",
4767
+ "enum": [
4768
+ "fixed",
4769
+ "percentage"
4770
+ ]
4771
+ },
4772
+ "percentage_value": {
4773
+ "type": "number",
4774
+ "description": "Use if type is set to percentage. The percentage to be discounted, represented as a whole integer."
4775
+ },
4776
+ "fixed_value": {
4777
+ "description": "Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.",
4778
+ "type": "number"
4779
+ },
4780
+ "fixed_value_decimal": {
4781
+ "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.",
4782
+ "type": "string"
4783
+ },
4784
+ "fixed_value_currency": {
4785
+ "description": "Use if type is set to fixed. Three-letter ISO currency code, in lowercase.",
4786
+ "oneOf": [
4787
+ {
4788
+ "$ref": "#/components/schemas/Currency"
4789
+ }
4790
+ ]
4791
+ },
4792
+ "active": {
4793
+ "type": "boolean"
4794
+ },
4795
+ "prices": {
4796
+ "description": "The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.",
4797
+ "oneOf": [
4798
+ {
4799
+ "type": "object",
4800
+ "properties": {
4801
+ "$relation": {
4802
+ "type": "array",
4803
+ "items": {
4804
+ "$ref": "#/components/schemas/EntityRelation"
4805
+ }
4806
+ }
4807
+ }
4808
+ },
4809
+ {
4810
+ "type": "array",
4811
+ "items": {
4812
+ "$ref": "#/components/schemas/Price"
4813
+ }
4814
+ }
4815
+ ]
4816
+ }
4817
+ },
4818
+ "example": {
4819
+ "_id": "123e4567-e89b-12d3-a456-426614174000",
4820
+ "_schema": "coupon",
4821
+ "_org": "org_12345",
4822
+ "_created_at": "2024-01-15T10:00:00.000Z",
4823
+ "_updated_at": "2024-01-20T12:00:00.000Z",
4824
+ "_title": "Sample Coupon",
4825
+ "name": "Sample Coupon",
4826
+ "type": "fixed",
4827
+ "fixed_value": 555,
4828
+ "fixed_value_currency": "USD",
4829
+ "fixed_value_decimal": "5.55",
4830
+ "active": true,
4831
+ "prices": {
4832
+ "$relation": [
4833
+ {
4834
+ "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
4835
+ "_tags": [
4836
+ "discount",
4837
+ "special"
4838
+ ],
4839
+ "_schema": "price"
4840
+ }
4841
+ ]
4842
+ }
4843
+ }
4844
+ },
4539
4845
  "PriceTier": {
4540
4846
  "type": "object",
4541
4847
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot/pricing-client",
3
- "version": "3.28.0",
3
+ "version": "3.29.0",
4
4
  "description": "Client for epilot Pricing APIs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",