@epilot/pricing-client 3.28.0 → 3.30.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.
- package/dist/definition.js +1 -1
- package/dist/openapi-runtime.json +16 -21
- package/dist/openapi.d.ts +290 -14
- package/dist/openapi.json +323 -5
- package/package.json +1 -1
package/dist/definition.js
CHANGED
|
@@ -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","
|
|
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
|
-
|
|
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 {
|
|
@@ -481,6 +481,40 @@ declare namespace Components {
|
|
|
481
481
|
*/
|
|
482
482
|
_updated_at?: string;
|
|
483
483
|
};
|
|
484
|
+
/**
|
|
485
|
+
* The coupons applicable to the price item
|
|
486
|
+
*/
|
|
487
|
+
coupons?: (/**
|
|
488
|
+
* The coupon configuration
|
|
489
|
+
* example:
|
|
490
|
+
* {
|
|
491
|
+
* "_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
492
|
+
* "_schema": "coupon",
|
|
493
|
+
* "_org": "org_12345",
|
|
494
|
+
* "_created_at": "2024-01-15T10:00:00.000Z",
|
|
495
|
+
* "_updated_at": "2024-01-20T12:00:00.000Z",
|
|
496
|
+
* "_title": "Sample Coupon",
|
|
497
|
+
* "name": "Sample Coupon",
|
|
498
|
+
* "type": "fixed",
|
|
499
|
+
* "fixed_value": 555,
|
|
500
|
+
* "fixed_value_currency": "USD",
|
|
501
|
+
* "fixed_value_decimal": "5.55",
|
|
502
|
+
* "active": true,
|
|
503
|
+
* "prices": {
|
|
504
|
+
* "$relation": [
|
|
505
|
+
* {
|
|
506
|
+
* "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
|
|
507
|
+
* "_tags": [
|
|
508
|
+
* "discount",
|
|
509
|
+
* "special"
|
|
510
|
+
* ],
|
|
511
|
+
* "_schema": "price"
|
|
512
|
+
* }
|
|
513
|
+
* ]
|
|
514
|
+
* }
|
|
515
|
+
* }
|
|
516
|
+
*/
|
|
517
|
+
Coupon)[];
|
|
484
518
|
/**
|
|
485
519
|
* Specifies whether the price is considered `inclusive` of taxes or not.
|
|
486
520
|
*/
|
|
@@ -670,7 +704,37 @@ declare namespace Components {
|
|
|
670
704
|
* "$ref": "#/components/examples/price"
|
|
671
705
|
* }
|
|
672
706
|
*/
|
|
673
|
-
Price
|
|
707
|
+
Price | /**
|
|
708
|
+
* The coupon configuration
|
|
709
|
+
* example:
|
|
710
|
+
* {
|
|
711
|
+
* "_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
712
|
+
* "_schema": "coupon",
|
|
713
|
+
* "_org": "org_12345",
|
|
714
|
+
* "_created_at": "2024-01-15T10:00:00.000Z",
|
|
715
|
+
* "_updated_at": "2024-01-20T12:00:00.000Z",
|
|
716
|
+
* "_title": "Sample Coupon",
|
|
717
|
+
* "name": "Sample Coupon",
|
|
718
|
+
* "type": "fixed",
|
|
719
|
+
* "fixed_value": 555,
|
|
720
|
+
* "fixed_value_currency": "USD",
|
|
721
|
+
* "fixed_value_decimal": "5.55",
|
|
722
|
+
* "active": true,
|
|
723
|
+
* "prices": {
|
|
724
|
+
* "$relation": [
|
|
725
|
+
* {
|
|
726
|
+
* "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
|
|
727
|
+
* "_tags": [
|
|
728
|
+
* "discount",
|
|
729
|
+
* "special"
|
|
730
|
+
* ],
|
|
731
|
+
* "_schema": "price"
|
|
732
|
+
* }
|
|
733
|
+
* ]
|
|
734
|
+
* }
|
|
735
|
+
* }
|
|
736
|
+
*/
|
|
737
|
+
Coupon)[];
|
|
674
738
|
}
|
|
675
739
|
/**
|
|
676
740
|
* The cart checkout request payload
|
|
@@ -770,7 +834,7 @@ declare namespace Components {
|
|
|
770
834
|
* Represents a composite price input to the pricing library.
|
|
771
835
|
* example:
|
|
772
836
|
* {
|
|
773
|
-
* "$ref": "#/components/examples/price-item"
|
|
837
|
+
* "$ref": "#/components/examples/price-item/value"
|
|
774
838
|
* }
|
|
775
839
|
*/
|
|
776
840
|
export interface CompositePriceItem {
|
|
@@ -916,7 +980,7 @@ declare namespace Components {
|
|
|
916
980
|
* Represents a price item
|
|
917
981
|
* example:
|
|
918
982
|
* {
|
|
919
|
-
* "$ref": "#/components/examples/price-item"
|
|
983
|
+
* "$ref": "#/components/examples/price-item/value"
|
|
920
984
|
* }
|
|
921
985
|
*/
|
|
922
986
|
PriceItem[];
|
|
@@ -1075,6 +1139,40 @@ declare namespace Components {
|
|
|
1075
1139
|
*/
|
|
1076
1140
|
_updated_at?: string;
|
|
1077
1141
|
};
|
|
1142
|
+
/**
|
|
1143
|
+
* The coupons applicable to the price item
|
|
1144
|
+
*/
|
|
1145
|
+
coupons?: (/**
|
|
1146
|
+
* The coupon configuration
|
|
1147
|
+
* example:
|
|
1148
|
+
* {
|
|
1149
|
+
* "_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
1150
|
+
* "_schema": "coupon",
|
|
1151
|
+
* "_org": "org_12345",
|
|
1152
|
+
* "_created_at": "2024-01-15T10:00:00.000Z",
|
|
1153
|
+
* "_updated_at": "2024-01-20T12:00:00.000Z",
|
|
1154
|
+
* "_title": "Sample Coupon",
|
|
1155
|
+
* "name": "Sample Coupon",
|
|
1156
|
+
* "type": "fixed",
|
|
1157
|
+
* "fixed_value": 555,
|
|
1158
|
+
* "fixed_value_currency": "USD",
|
|
1159
|
+
* "fixed_value_decimal": "5.55",
|
|
1160
|
+
* "active": true,
|
|
1161
|
+
* "prices": {
|
|
1162
|
+
* "$relation": [
|
|
1163
|
+
* {
|
|
1164
|
+
* "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
|
|
1165
|
+
* "_tags": [
|
|
1166
|
+
* "discount",
|
|
1167
|
+
* "special"
|
|
1168
|
+
* ],
|
|
1169
|
+
* "_schema": "price"
|
|
1170
|
+
* }
|
|
1171
|
+
* ]
|
|
1172
|
+
* }
|
|
1173
|
+
* }
|
|
1174
|
+
*/
|
|
1175
|
+
Coupon)[];
|
|
1078
1176
|
/**
|
|
1079
1177
|
* Specifies whether the price is considered `inclusive` of taxes or not.
|
|
1080
1178
|
*/
|
|
@@ -1290,6 +1388,101 @@ declare namespace Components {
|
|
|
1290
1388
|
[name: string]: /* The computed price */ ComputedBasePrice;
|
|
1291
1389
|
}
|
|
1292
1390
|
export type ConsumptionTypeGetAg = "household" | "heating_pump" | "night_storage_heating" | "night_storage_heating_common_meter";
|
|
1391
|
+
/**
|
|
1392
|
+
* The coupon configuration
|
|
1393
|
+
* example:
|
|
1394
|
+
* {
|
|
1395
|
+
* "_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
1396
|
+
* "_schema": "coupon",
|
|
1397
|
+
* "_org": "org_12345",
|
|
1398
|
+
* "_created_at": "2024-01-15T10:00:00.000Z",
|
|
1399
|
+
* "_updated_at": "2024-01-20T12:00:00.000Z",
|
|
1400
|
+
* "_title": "Sample Coupon",
|
|
1401
|
+
* "name": "Sample Coupon",
|
|
1402
|
+
* "type": "fixed",
|
|
1403
|
+
* "fixed_value": 555,
|
|
1404
|
+
* "fixed_value_currency": "USD",
|
|
1405
|
+
* "fixed_value_decimal": "5.55",
|
|
1406
|
+
* "active": true,
|
|
1407
|
+
* "prices": {
|
|
1408
|
+
* "$relation": [
|
|
1409
|
+
* {
|
|
1410
|
+
* "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
|
|
1411
|
+
* "_tags": [
|
|
1412
|
+
* "discount",
|
|
1413
|
+
* "special"
|
|
1414
|
+
* ],
|
|
1415
|
+
* "_schema": "price"
|
|
1416
|
+
* }
|
|
1417
|
+
* ]
|
|
1418
|
+
* }
|
|
1419
|
+
* }
|
|
1420
|
+
*/
|
|
1421
|
+
export interface Coupon {
|
|
1422
|
+
[name: string]: any;
|
|
1423
|
+
_id: EntityId /* uuid */;
|
|
1424
|
+
/**
|
|
1425
|
+
* The auto-generated title for the title
|
|
1426
|
+
*/
|
|
1427
|
+
_title: string;
|
|
1428
|
+
/**
|
|
1429
|
+
* Organization Id the entity belongs to
|
|
1430
|
+
*/
|
|
1431
|
+
_org: string;
|
|
1432
|
+
/**
|
|
1433
|
+
* The schema of the entity, for coupons it is always `coupon`
|
|
1434
|
+
*/
|
|
1435
|
+
_schema: "coupon";
|
|
1436
|
+
_tags?: string[];
|
|
1437
|
+
/**
|
|
1438
|
+
* The creation date for the opportunity
|
|
1439
|
+
*/
|
|
1440
|
+
_created_at: string; // date-time
|
|
1441
|
+
/**
|
|
1442
|
+
* The date the coupon was last updated
|
|
1443
|
+
*/
|
|
1444
|
+
_updated_at: string; // date-time
|
|
1445
|
+
name: string;
|
|
1446
|
+
description?: string;
|
|
1447
|
+
type: "fixed" | "percentage";
|
|
1448
|
+
/**
|
|
1449
|
+
* Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
|
|
1450
|
+
*/
|
|
1451
|
+
percentage_value?: string;
|
|
1452
|
+
/**
|
|
1453
|
+
* Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.
|
|
1454
|
+
*/
|
|
1455
|
+
fixed_value?: number;
|
|
1456
|
+
/**
|
|
1457
|
+
* 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.
|
|
1458
|
+
*/
|
|
1459
|
+
fixed_value_decimal?: string;
|
|
1460
|
+
/**
|
|
1461
|
+
* Use if type is set to fixed. Three-letter ISO currency code, in lowercase.
|
|
1462
|
+
*/
|
|
1463
|
+
fixed_value_currency?: /* Use if type is set to fixed. Three-letter ISO currency code, in lowercase. */ /**
|
|
1464
|
+
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
|
|
1465
|
+
* ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
|
|
1466
|
+
*
|
|
1467
|
+
* example:
|
|
1468
|
+
* EUR
|
|
1469
|
+
*/
|
|
1470
|
+
Currency;
|
|
1471
|
+
active?: boolean;
|
|
1472
|
+
/**
|
|
1473
|
+
* The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.
|
|
1474
|
+
*/
|
|
1475
|
+
prices?: /* The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise. */ {
|
|
1476
|
+
$relation?: EntityRelation[];
|
|
1477
|
+
} | /**
|
|
1478
|
+
* The price entity schema for simple pricing
|
|
1479
|
+
* example:
|
|
1480
|
+
* {
|
|
1481
|
+
* "$ref": "#/components/examples/price"
|
|
1482
|
+
* }
|
|
1483
|
+
*/
|
|
1484
|
+
Price[];
|
|
1485
|
+
}
|
|
1293
1486
|
/**
|
|
1294
1487
|
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
|
|
1295
1488
|
* ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
|
|
@@ -2204,7 +2397,7 @@ declare namespace Components {
|
|
|
2204
2397
|
* Represents a price item
|
|
2205
2398
|
* example:
|
|
2206
2399
|
* {
|
|
2207
|
-
* "$ref": "#/components/examples/price-item"
|
|
2400
|
+
* "$ref": "#/components/examples/price-item/value"
|
|
2208
2401
|
* }
|
|
2209
2402
|
*/
|
|
2210
2403
|
export interface PriceItem {
|
|
@@ -2517,6 +2710,40 @@ declare namespace Components {
|
|
|
2517
2710
|
*/
|
|
2518
2711
|
_updated_at?: string;
|
|
2519
2712
|
};
|
|
2713
|
+
/**
|
|
2714
|
+
* The coupons applicable to the price item
|
|
2715
|
+
*/
|
|
2716
|
+
coupons?: (/**
|
|
2717
|
+
* The coupon configuration
|
|
2718
|
+
* example:
|
|
2719
|
+
* {
|
|
2720
|
+
* "_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
2721
|
+
* "_schema": "coupon",
|
|
2722
|
+
* "_org": "org_12345",
|
|
2723
|
+
* "_created_at": "2024-01-15T10:00:00.000Z",
|
|
2724
|
+
* "_updated_at": "2024-01-20T12:00:00.000Z",
|
|
2725
|
+
* "_title": "Sample Coupon",
|
|
2726
|
+
* "name": "Sample Coupon",
|
|
2727
|
+
* "type": "fixed",
|
|
2728
|
+
* "fixed_value": 555,
|
|
2729
|
+
* "fixed_value_currency": "USD",
|
|
2730
|
+
* "fixed_value_decimal": "5.55",
|
|
2731
|
+
* "active": true,
|
|
2732
|
+
* "prices": {
|
|
2733
|
+
* "$relation": [
|
|
2734
|
+
* {
|
|
2735
|
+
* "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
|
|
2736
|
+
* "_tags": [
|
|
2737
|
+
* "discount",
|
|
2738
|
+
* "special"
|
|
2739
|
+
* ],
|
|
2740
|
+
* "_schema": "price"
|
|
2741
|
+
* }
|
|
2742
|
+
* ]
|
|
2743
|
+
* }
|
|
2744
|
+
* }
|
|
2745
|
+
*/
|
|
2746
|
+
Coupon)[];
|
|
2520
2747
|
/**
|
|
2521
2748
|
* Specifies whether the price is considered `inclusive` of taxes or not.
|
|
2522
2749
|
*/
|
|
@@ -2745,14 +2972,14 @@ declare namespace Components {
|
|
|
2745
2972
|
* Represents a price item
|
|
2746
2973
|
* example:
|
|
2747
2974
|
* {
|
|
2748
|
-
* "$ref": "#/components/examples/price-item"
|
|
2975
|
+
* "$ref": "#/components/examples/price-item/value"
|
|
2749
2976
|
* }
|
|
2750
2977
|
*/
|
|
2751
2978
|
PriceItem | /**
|
|
2752
2979
|
* Represents a composite price input to the pricing library.
|
|
2753
2980
|
* example:
|
|
2754
2981
|
* {
|
|
2755
|
-
* "$ref": "#/components/examples/price-item"
|
|
2982
|
+
* "$ref": "#/components/examples/price-item/value"
|
|
2756
2983
|
* }
|
|
2757
2984
|
*/
|
|
2758
2985
|
CompositePriceItem)[];
|
|
@@ -2789,14 +3016,63 @@ declare namespace Components {
|
|
|
2789
3016
|
* Represents a price item
|
|
2790
3017
|
* example:
|
|
2791
3018
|
* {
|
|
2792
|
-
* "$ref": "#/components/examples/price-item"
|
|
3019
|
+
* "$ref": "#/components/examples/price-item/value"
|
|
3020
|
+
* }
|
|
3021
|
+
*/
|
|
3022
|
+
PriceItem | /**
|
|
3023
|
+
* Represents a composite price input to the pricing library.
|
|
3024
|
+
* example:
|
|
3025
|
+
* {
|
|
3026
|
+
* "$ref": "#/components/examples/price-item/value"
|
|
3027
|
+
* }
|
|
3028
|
+
*/
|
|
3029
|
+
CompositePriceItem)[];
|
|
3030
|
+
/**
|
|
3031
|
+
* Total of all items before (discounts or) taxes are applied.
|
|
3032
|
+
*/
|
|
3033
|
+
amount_subtotal?: number;
|
|
3034
|
+
/**
|
|
3035
|
+
* Total of all items after (discounts and) taxes are applied.
|
|
3036
|
+
*/
|
|
3037
|
+
amount_total?: number;
|
|
3038
|
+
/**
|
|
3039
|
+
* The unit gross amount value.
|
|
3040
|
+
*/
|
|
3041
|
+
unit_amount_gross?: number;
|
|
3042
|
+
/**
|
|
3043
|
+
* The unit net amount value.
|
|
3044
|
+
*/
|
|
3045
|
+
unit_amount_net?: number;
|
|
3046
|
+
/**
|
|
3047
|
+
* This is the sum of all the price item tax amounts.
|
|
3048
|
+
*/
|
|
3049
|
+
amount_tax?: number;
|
|
3050
|
+
total_details?: /* The total details with tax (and discount) aggregated totals. */ TotalDetails;
|
|
3051
|
+
currency?: /**
|
|
3052
|
+
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
|
|
3053
|
+
* ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
|
|
3054
|
+
*
|
|
3055
|
+
* example:
|
|
3056
|
+
* EUR
|
|
3057
|
+
*/
|
|
3058
|
+
Currency;
|
|
3059
|
+
}
|
|
3060
|
+
/**
|
|
3061
|
+
* The result from the calculation of a set of price items.
|
|
3062
|
+
*/
|
|
3063
|
+
export interface PricingDetailsResponse {
|
|
3064
|
+
items?: (/**
|
|
3065
|
+
* Represents a price item
|
|
3066
|
+
* example:
|
|
3067
|
+
* {
|
|
3068
|
+
* "$ref": "#/components/examples/price-item/value"
|
|
2793
3069
|
* }
|
|
2794
3070
|
*/
|
|
2795
3071
|
PriceItem | /**
|
|
2796
3072
|
* Represents a composite price input to the pricing library.
|
|
2797
3073
|
* example:
|
|
2798
3074
|
* {
|
|
2799
|
-
* "$ref": "#/components/examples/price-item"
|
|
3075
|
+
* "$ref": "#/components/examples/price-item/value"
|
|
2800
3076
|
* }
|
|
2801
3077
|
*/
|
|
2802
3078
|
CompositePriceItem)[];
|
|
@@ -3401,7 +3677,7 @@ declare namespace Paths {
|
|
|
3401
3677
|
line_items?: /* A valid set of product prices, quantities, (discounts) and taxes from a client. */ Components.Schemas.PriceItemsDto;
|
|
3402
3678
|
}
|
|
3403
3679
|
namespace Responses {
|
|
3404
|
-
export type $200 = /* The result from the calculation of a set of price items. */ Components.Schemas.
|
|
3680
|
+
export type $200 = /* The result from the calculation of a set of price items. */ Components.Schemas.PricingDetailsResponse;
|
|
3405
3681
|
export type $400 = Components.Schemas.Error;
|
|
3406
3682
|
}
|
|
3407
3683
|
}
|
|
@@ -3656,7 +3932,7 @@ export interface OperationMethods {
|
|
|
3656
3932
|
/**
|
|
3657
3933
|
* $calculatePricingDetails - calculatePricingDetails
|
|
3658
3934
|
*
|
|
3659
|
-
*
|
|
3935
|
+
* Computes a set of pricing details that can be persisted on an entity with the pricing capability enabled, e.g: Orders or Contracts.
|
|
3660
3936
|
*/
|
|
3661
3937
|
'$calculatePricingDetails'(
|
|
3662
3938
|
parameters?: Parameters<UnknownParamsObject> | null,
|
|
@@ -3765,7 +4041,7 @@ export interface OperationMethods {
|
|
|
3765
4041
|
config?: AxiosRequestConfig
|
|
3766
4042
|
): OperationResponse<Paths.$SearchStreets.Responses.$200>
|
|
3767
4043
|
/**
|
|
3768
|
-
* $computePrice -
|
|
4044
|
+
* $computePrice - calculatePricingDetails
|
|
3769
4045
|
*
|
|
3770
4046
|
* Returns the price for a given product type based on location and consumption
|
|
3771
4047
|
*/
|
|
@@ -3811,7 +4087,7 @@ export interface PathsDictionary {
|
|
|
3811
4087
|
/**
|
|
3812
4088
|
* $calculatePricingDetails - calculatePricingDetails
|
|
3813
4089
|
*
|
|
3814
|
-
*
|
|
4090
|
+
* Computes a set of pricing details that can be persisted on an entity with the pricing capability enabled, e.g: Orders or Contracts.
|
|
3815
4091
|
*/
|
|
3816
4092
|
'post'(
|
|
3817
4093
|
parameters?: Parameters<UnknownParamsObject> | null,
|
|
@@ -3940,7 +4216,7 @@ export interface PathsDictionary {
|
|
|
3940
4216
|
}
|
|
3941
4217
|
['/v1/public/integration/{integrationId}/compute-price']: {
|
|
3942
4218
|
/**
|
|
3943
|
-
* $computePrice -
|
|
4219
|
+
* $computePrice - calculatePricingDetails
|
|
3944
4220
|
*
|
|
3945
4221
|
* Returns the price for a given product type based on location and consumption
|
|
3946
4222
|
*/
|
package/dist/openapi.json
CHANGED
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"paths": {
|
|
114
114
|
"/v1/pricing:compute": {
|
|
115
115
|
"post": {
|
|
116
|
-
"description": "
|
|
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/
|
|
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": "
|
|
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
|
}
|
|
@@ -3282,6 +3402,18 @@
|
|
|
3282
3402
|
}
|
|
3283
3403
|
]
|
|
3284
3404
|
},
|
|
3405
|
+
"coupons": {
|
|
3406
|
+
"type": "array",
|
|
3407
|
+
"description": "The coupons applicable to the price item",
|
|
3408
|
+
"readOnly": true,
|
|
3409
|
+
"items": {
|
|
3410
|
+
"oneOf": [
|
|
3411
|
+
{
|
|
3412
|
+
"$ref": "#/components/schemas/Coupon"
|
|
3413
|
+
}
|
|
3414
|
+
]
|
|
3415
|
+
}
|
|
3416
|
+
},
|
|
3285
3417
|
"is_tax_inclusive": {
|
|
3286
3418
|
"type": "boolean",
|
|
3287
3419
|
"description": "Specifies whether the price is considered `inclusive` of taxes or not."
|
|
@@ -3660,7 +3792,7 @@
|
|
|
3660
3792
|
"description": "Represents a price item",
|
|
3661
3793
|
"type": "object",
|
|
3662
3794
|
"example": {
|
|
3663
|
-
"$ref": "#/components/examples/price-item"
|
|
3795
|
+
"$ref": "#/components/examples/price-item/value"
|
|
3664
3796
|
},
|
|
3665
3797
|
"allOf": [
|
|
3666
3798
|
{
|
|
@@ -3814,7 +3946,7 @@
|
|
|
3814
3946
|
"description": "Represents a price item",
|
|
3815
3947
|
"type": "object",
|
|
3816
3948
|
"example": {
|
|
3817
|
-
"$ref": "#/components/examples/price-item"
|
|
3949
|
+
"$ref": "#/components/examples/price-item/value"
|
|
3818
3950
|
},
|
|
3819
3951
|
"properties": {
|
|
3820
3952
|
"type": {
|
|
@@ -4103,6 +4235,51 @@
|
|
|
4103
4235
|
}
|
|
4104
4236
|
}
|
|
4105
4237
|
},
|
|
4238
|
+
"PricingDetailsResponse": {
|
|
4239
|
+
"type": "object",
|
|
4240
|
+
"description": "The result from the calculation of a set of price items.",
|
|
4241
|
+
"properties": {
|
|
4242
|
+
"items": {
|
|
4243
|
+
"type": "array",
|
|
4244
|
+
"items": {
|
|
4245
|
+
"oneOf": [
|
|
4246
|
+
{
|
|
4247
|
+
"$ref": "#/components/schemas/PriceItem"
|
|
4248
|
+
},
|
|
4249
|
+
{
|
|
4250
|
+
"$ref": "#/components/schemas/CompositePriceItem"
|
|
4251
|
+
}
|
|
4252
|
+
]
|
|
4253
|
+
}
|
|
4254
|
+
},
|
|
4255
|
+
"amount_subtotal": {
|
|
4256
|
+
"type": "integer",
|
|
4257
|
+
"description": "Total of all items before (discounts or) taxes are applied."
|
|
4258
|
+
},
|
|
4259
|
+
"amount_total": {
|
|
4260
|
+
"type": "integer",
|
|
4261
|
+
"description": "Total of all items after (discounts and) taxes are applied."
|
|
4262
|
+
},
|
|
4263
|
+
"unit_amount_gross": {
|
|
4264
|
+
"type": "integer",
|
|
4265
|
+
"description": "The unit gross amount value."
|
|
4266
|
+
},
|
|
4267
|
+
"unit_amount_net": {
|
|
4268
|
+
"type": "integer",
|
|
4269
|
+
"description": "The unit net amount value."
|
|
4270
|
+
},
|
|
4271
|
+
"amount_tax": {
|
|
4272
|
+
"type": "integer",
|
|
4273
|
+
"description": "This is the sum of all the price item tax amounts."
|
|
4274
|
+
},
|
|
4275
|
+
"total_details": {
|
|
4276
|
+
"$ref": "#/components/schemas/TotalDetails"
|
|
4277
|
+
},
|
|
4278
|
+
"currency": {
|
|
4279
|
+
"$ref": "#/components/schemas/Currency"
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
},
|
|
4106
4283
|
"BillingPeriod": {
|
|
4107
4284
|
"type": "string",
|
|
4108
4285
|
"enum": [
|
|
@@ -4536,6 +4713,147 @@
|
|
|
4536
4713
|
}
|
|
4537
4714
|
}
|
|
4538
4715
|
},
|
|
4716
|
+
"Coupon": {
|
|
4717
|
+
"type": "object",
|
|
4718
|
+
"description": "The coupon configuration",
|
|
4719
|
+
"additionalProperties": true,
|
|
4720
|
+
"required": [
|
|
4721
|
+
"name",
|
|
4722
|
+
"type",
|
|
4723
|
+
"_id",
|
|
4724
|
+
"_title",
|
|
4725
|
+
"_org",
|
|
4726
|
+
"_schema",
|
|
4727
|
+
"_created_at",
|
|
4728
|
+
"_updated_at"
|
|
4729
|
+
],
|
|
4730
|
+
"properties": {
|
|
4731
|
+
"_id": {
|
|
4732
|
+
"$ref": "#/components/schemas/EntityId",
|
|
4733
|
+
"readOnly": true
|
|
4734
|
+
},
|
|
4735
|
+
"_title": {
|
|
4736
|
+
"type": "string",
|
|
4737
|
+
"description": "The auto-generated title for the title",
|
|
4738
|
+
"readOnly": true
|
|
4739
|
+
},
|
|
4740
|
+
"_org": {
|
|
4741
|
+
"type": "string",
|
|
4742
|
+
"description": "Organization Id the entity belongs to",
|
|
4743
|
+
"readOnly": true
|
|
4744
|
+
},
|
|
4745
|
+
"_schema": {
|
|
4746
|
+
"type": "string",
|
|
4747
|
+
"enum": [
|
|
4748
|
+
"coupon"
|
|
4749
|
+
],
|
|
4750
|
+
"readOnly": true,
|
|
4751
|
+
"description": "The schema of the entity, for coupons it is always `coupon`"
|
|
4752
|
+
},
|
|
4753
|
+
"_tags": {
|
|
4754
|
+
"type": "array",
|
|
4755
|
+
"items": {
|
|
4756
|
+
"type": "string"
|
|
4757
|
+
}
|
|
4758
|
+
},
|
|
4759
|
+
"_created_at": {
|
|
4760
|
+
"type": "string",
|
|
4761
|
+
"format": "date-time",
|
|
4762
|
+
"readOnly": true,
|
|
4763
|
+
"description": "The creation date for the opportunity"
|
|
4764
|
+
},
|
|
4765
|
+
"_updated_at": {
|
|
4766
|
+
"type": "string",
|
|
4767
|
+
"format": "date-time",
|
|
4768
|
+
"readOnly": true,
|
|
4769
|
+
"description": "The date the coupon was last updated"
|
|
4770
|
+
},
|
|
4771
|
+
"name": {
|
|
4772
|
+
"type": "string"
|
|
4773
|
+
},
|
|
4774
|
+
"description": {
|
|
4775
|
+
"type": "string"
|
|
4776
|
+
},
|
|
4777
|
+
"type": {
|
|
4778
|
+
"type": "string",
|
|
4779
|
+
"enum": [
|
|
4780
|
+
"fixed",
|
|
4781
|
+
"percentage"
|
|
4782
|
+
]
|
|
4783
|
+
},
|
|
4784
|
+
"percentage_value": {
|
|
4785
|
+
"type": "string",
|
|
4786
|
+
"description": "Use if type is set to percentage. The percentage to be discounted, represented as a whole integer."
|
|
4787
|
+
},
|
|
4788
|
+
"fixed_value": {
|
|
4789
|
+
"description": "Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.",
|
|
4790
|
+
"type": "number"
|
|
4791
|
+
},
|
|
4792
|
+
"fixed_value_decimal": {
|
|
4793
|
+
"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.",
|
|
4794
|
+
"type": "string"
|
|
4795
|
+
},
|
|
4796
|
+
"fixed_value_currency": {
|
|
4797
|
+
"description": "Use if type is set to fixed. Three-letter ISO currency code, in lowercase.",
|
|
4798
|
+
"oneOf": [
|
|
4799
|
+
{
|
|
4800
|
+
"$ref": "#/components/schemas/Currency"
|
|
4801
|
+
}
|
|
4802
|
+
]
|
|
4803
|
+
},
|
|
4804
|
+
"active": {
|
|
4805
|
+
"type": "boolean"
|
|
4806
|
+
},
|
|
4807
|
+
"prices": {
|
|
4808
|
+
"description": "The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.",
|
|
4809
|
+
"oneOf": [
|
|
4810
|
+
{
|
|
4811
|
+
"type": "object",
|
|
4812
|
+
"properties": {
|
|
4813
|
+
"$relation": {
|
|
4814
|
+
"type": "array",
|
|
4815
|
+
"items": {
|
|
4816
|
+
"$ref": "#/components/schemas/EntityRelation"
|
|
4817
|
+
}
|
|
4818
|
+
}
|
|
4819
|
+
}
|
|
4820
|
+
},
|
|
4821
|
+
{
|
|
4822
|
+
"type": "array",
|
|
4823
|
+
"items": {
|
|
4824
|
+
"$ref": "#/components/schemas/Price"
|
|
4825
|
+
}
|
|
4826
|
+
}
|
|
4827
|
+
]
|
|
4828
|
+
}
|
|
4829
|
+
},
|
|
4830
|
+
"example": {
|
|
4831
|
+
"_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
4832
|
+
"_schema": "coupon",
|
|
4833
|
+
"_org": "org_12345",
|
|
4834
|
+
"_created_at": "2024-01-15T10:00:00.000Z",
|
|
4835
|
+
"_updated_at": "2024-01-20T12:00:00.000Z",
|
|
4836
|
+
"_title": "Sample Coupon",
|
|
4837
|
+
"name": "Sample Coupon",
|
|
4838
|
+
"type": "fixed",
|
|
4839
|
+
"fixed_value": 555,
|
|
4840
|
+
"fixed_value_currency": "USD",
|
|
4841
|
+
"fixed_value_decimal": "5.55",
|
|
4842
|
+
"active": true,
|
|
4843
|
+
"prices": {
|
|
4844
|
+
"$relation": [
|
|
4845
|
+
{
|
|
4846
|
+
"entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
|
|
4847
|
+
"_tags": [
|
|
4848
|
+
"discount",
|
|
4849
|
+
"special"
|
|
4850
|
+
],
|
|
4851
|
+
"_schema": "price"
|
|
4852
|
+
}
|
|
4853
|
+
]
|
|
4854
|
+
}
|
|
4855
|
+
}
|
|
4856
|
+
},
|
|
4539
4857
|
"PriceTier": {
|
|
4540
4858
|
"type": "object",
|
|
4541
4859
|
"properties": {
|