@epilot/pricing-client 3.54.4 → 3.55.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/openapi.d.ts +136 -2
- package/dist/openapi.json +84 -2
- package/package.json +1 -1
package/dist/openapi.d.ts
CHANGED
|
@@ -4114,6 +4114,84 @@ declare namespace Components {
|
|
|
4114
4114
|
export interface ComputedPriceComponents {
|
|
4115
4115
|
[name: string]: /* The computed price */ ComputedBasePrice;
|
|
4116
4116
|
}
|
|
4117
|
+
/**
|
|
4118
|
+
* An error from a conditional-pricing operation, carrying a machine-readable `code`
|
|
4119
|
+
* from the conditional-pricing vocabulary plus any structured data about the failure,
|
|
4120
|
+
* so a client can branch on the kind of failure rather than parse the message.
|
|
4121
|
+
* Referenced only by the operations that emit these codes; every other operation
|
|
4122
|
+
* keeps the plain `Error` shape.
|
|
4123
|
+
*
|
|
4124
|
+
*/
|
|
4125
|
+
export interface ConditionalPricingError {
|
|
4126
|
+
/**
|
|
4127
|
+
* Error message
|
|
4128
|
+
*/
|
|
4129
|
+
message: string;
|
|
4130
|
+
/**
|
|
4131
|
+
* The HTTP status code
|
|
4132
|
+
*/
|
|
4133
|
+
status?: number;
|
|
4134
|
+
/**
|
|
4135
|
+
* The cause of the error (visible for bad requests - http 400)
|
|
4136
|
+
*/
|
|
4137
|
+
cause?: string;
|
|
4138
|
+
/**
|
|
4139
|
+
* The error message. Carries the same string as `message`, which the shared `Error`
|
|
4140
|
+
* schema requires — `error` is the field responses have always used, and every caller
|
|
4141
|
+
* to date reads. Declared here rather than on the shared `Error` because a request
|
|
4142
|
+
* validation failure puts a list of validation errors in this field instead of a
|
|
4143
|
+
* string, and those responses reference `Error` directly.
|
|
4144
|
+
*
|
|
4145
|
+
*/
|
|
4146
|
+
error?: string;
|
|
4147
|
+
code?: /**
|
|
4148
|
+
* Machine-readable failure mode of a conditional-pricing operation, allowing clients
|
|
4149
|
+
* to branch on the kind of failure instead of parsing the error message.
|
|
4150
|
+
*
|
|
4151
|
+
* - `NOT_FOUND` (404): the addressed entity, variant or version does not exist
|
|
4152
|
+
* - `AMBIGUOUS_RESOLUTION` (409): several variants match the given context while a single result was requested
|
|
4153
|
+
* - `TUPLE_CONFLICT` (409): the condition tuple is already claimed by another variant
|
|
4154
|
+
* - `VERSION_CONFLICT` (409): a version already exists at the given `valid_from` on that variant
|
|
4155
|
+
* - `SUPERSEDED_VERSION` (409): the addressed version has been superseded
|
|
4156
|
+
* - `CONDITION_UNDEFINED` (400): the context names a condition the entity's schema does not define
|
|
4157
|
+
* - `OPERATOR_UNSUPPORTED` (400): the requested operator is not applicable to the condition's type
|
|
4158
|
+
* - `CONTEXT_FORMAT_INVALID` (400): a context value is malformed for its condition type
|
|
4159
|
+
* - `TOO_MANY_MATCHES` (400): a multi-match resolve exceeded its result cap
|
|
4160
|
+
* - `WRITE_CONFLICT` (409): transient write contention, retryable unlike `TUPLE_CONFLICT`
|
|
4161
|
+
*
|
|
4162
|
+
* Each code is emitted with the HTTP status shown above, and only with that status.
|
|
4163
|
+
*
|
|
4164
|
+
*/
|
|
4165
|
+
ConditionalPricingErrorCode;
|
|
4166
|
+
/**
|
|
4167
|
+
* Structured data about the failure, shaped by the accompanying `code`
|
|
4168
|
+
* (e.g. the candidate variants of an `ambiguous-resolution`). Only present
|
|
4169
|
+
* when the failure has structured data to report, and never without a `code`.
|
|
4170
|
+
*
|
|
4171
|
+
*/
|
|
4172
|
+
details?: {
|
|
4173
|
+
[name: string]: any;
|
|
4174
|
+
};
|
|
4175
|
+
}
|
|
4176
|
+
/**
|
|
4177
|
+
* Machine-readable failure mode of a conditional-pricing operation, allowing clients
|
|
4178
|
+
* to branch on the kind of failure instead of parsing the error message.
|
|
4179
|
+
*
|
|
4180
|
+
* - `NOT_FOUND` (404): the addressed entity, variant or version does not exist
|
|
4181
|
+
* - `AMBIGUOUS_RESOLUTION` (409): several variants match the given context while a single result was requested
|
|
4182
|
+
* - `TUPLE_CONFLICT` (409): the condition tuple is already claimed by another variant
|
|
4183
|
+
* - `VERSION_CONFLICT` (409): a version already exists at the given `valid_from` on that variant
|
|
4184
|
+
* - `SUPERSEDED_VERSION` (409): the addressed version has been superseded
|
|
4185
|
+
* - `CONDITION_UNDEFINED` (400): the context names a condition the entity's schema does not define
|
|
4186
|
+
* - `OPERATOR_UNSUPPORTED` (400): the requested operator is not applicable to the condition's type
|
|
4187
|
+
* - `CONTEXT_FORMAT_INVALID` (400): a context value is malformed for its condition type
|
|
4188
|
+
* - `TOO_MANY_MATCHES` (400): a multi-match resolve exceeded its result cap
|
|
4189
|
+
* - `WRITE_CONFLICT` (409): transient write contention, retryable unlike `TUPLE_CONFLICT`
|
|
4190
|
+
*
|
|
4191
|
+
* Each code is emitted with the HTTP status shown above, and only with that status.
|
|
4192
|
+
*
|
|
4193
|
+
*/
|
|
4194
|
+
export type ConditionalPricingErrorCode = "NOT_FOUND" | "AMBIGUOUS_RESOLUTION" | "TUPLE_CONFLICT" | "VERSION_CONFLICT" | "SUPERSEDED_VERSION" | "CONDITION_UNDEFINED" | "OPERATOR_UNSUPPORTED" | "CONTEXT_FORMAT_INVALID" | "TOO_MANY_MATCHES" | "WRITE_CONFLICT";
|
|
4117
4195
|
export type ConsumptionTypeGetAg = "household" | "heating_pump" | "night_storage_heating" | "night_storage_heating_common_meter";
|
|
4118
4196
|
/**
|
|
4119
4197
|
* The coupon entity
|
|
@@ -9728,7 +9806,23 @@ declare namespace Components {
|
|
|
9728
9806
|
* "_updated_at": "2021-02-09T12:41:43.662Z"
|
|
9729
9807
|
* }
|
|
9730
9808
|
*/
|
|
9731
|
-
Tax
|
|
9809
|
+
Tax | /**
|
|
9810
|
+
* A minimal, ad-hoc tax rate for line items with no backing tax entity
|
|
9811
|
+
* in the catalog (e.g. a fully custom/composite price component built
|
|
9812
|
+
* by a client with no product/price reference to resolve tax from).
|
|
9813
|
+
* Mirrors how PriceItem relates to Price: unlike Tax, this has no
|
|
9814
|
+
* entity identity — it isn't persisted and can't be looked up by _id,
|
|
9815
|
+
* so it can't be shared/reused across price items the way a catalog
|
|
9816
|
+
* Tax can.
|
|
9817
|
+
*
|
|
9818
|
+
* example:
|
|
9819
|
+
* {
|
|
9820
|
+
* "rate": 19,
|
|
9821
|
+
* "type": "VAT",
|
|
9822
|
+
* "description": "Custom 19% VAT"
|
|
9823
|
+
* }
|
|
9824
|
+
*/
|
|
9825
|
+
TaxItem;
|
|
9732
9826
|
}
|
|
9733
9827
|
/**
|
|
9734
9828
|
* A tax amount associated with a specific tax rate.
|
|
@@ -9780,13 +9874,50 @@ declare namespace Components {
|
|
|
9780
9874
|
* "_updated_at": "2021-02-09T12:41:43.662Z"
|
|
9781
9875
|
* }
|
|
9782
9876
|
*/
|
|
9783
|
-
Tax
|
|
9877
|
+
Tax | /**
|
|
9878
|
+
* A minimal, ad-hoc tax rate for line items with no backing tax entity
|
|
9879
|
+
* in the catalog (e.g. a fully custom/composite price component built
|
|
9880
|
+
* by a client with no product/price reference to resolve tax from).
|
|
9881
|
+
* Mirrors how PriceItem relates to Price: unlike Tax, this has no
|
|
9882
|
+
* entity identity — it isn't persisted and can't be looked up by _id,
|
|
9883
|
+
* so it can't be shared/reused across price items the way a catalog
|
|
9884
|
+
* Tax can.
|
|
9885
|
+
*
|
|
9886
|
+
* example:
|
|
9887
|
+
* {
|
|
9888
|
+
* "rate": 19,
|
|
9889
|
+
* "type": "VAT",
|
|
9890
|
+
* "description": "Custom 19% VAT"
|
|
9891
|
+
* }
|
|
9892
|
+
*/
|
|
9893
|
+
TaxItem;
|
|
9784
9894
|
}
|
|
9785
9895
|
export interface TaxBreakdownInfo {
|
|
9786
9896
|
rate?: number | null;
|
|
9787
9897
|
type?: "VAT" | "GST" | "Custom";
|
|
9788
9898
|
_id?: string;
|
|
9789
9899
|
}
|
|
9900
|
+
/**
|
|
9901
|
+
* A minimal, ad-hoc tax rate for line items with no backing tax entity
|
|
9902
|
+
* in the catalog (e.g. a fully custom/composite price component built
|
|
9903
|
+
* by a client with no product/price reference to resolve tax from).
|
|
9904
|
+
* Mirrors how PriceItem relates to Price: unlike Tax, this has no
|
|
9905
|
+
* entity identity — it isn't persisted and can't be looked up by _id,
|
|
9906
|
+
* so it can't be shared/reused across price items the way a catalog
|
|
9907
|
+
* Tax can.
|
|
9908
|
+
*
|
|
9909
|
+
* example:
|
|
9910
|
+
* {
|
|
9911
|
+
* "rate": 19,
|
|
9912
|
+
* "type": "VAT",
|
|
9913
|
+
* "description": "Custom 19% VAT"
|
|
9914
|
+
* }
|
|
9915
|
+
*/
|
|
9916
|
+
export interface TaxItem {
|
|
9917
|
+
type: "VAT" | "GST" | "Custom";
|
|
9918
|
+
rate: number | null;
|
|
9919
|
+
description?: string;
|
|
9920
|
+
}
|
|
9790
9921
|
export interface TierDetails {
|
|
9791
9922
|
quantity: number;
|
|
9792
9923
|
unit_amount: number;
|
|
@@ -12037,6 +12168,8 @@ export type ComputePriceResult = Components.Schemas.ComputePriceResult;
|
|
|
12037
12168
|
export type ComputedBasePrice = Components.Schemas.ComputedBasePrice;
|
|
12038
12169
|
export type ComputedPriceBreakdown = Components.Schemas.ComputedPriceBreakdown;
|
|
12039
12170
|
export type ComputedPriceComponents = Components.Schemas.ComputedPriceComponents;
|
|
12171
|
+
export type ConditionalPricingError = Components.Schemas.ConditionalPricingError;
|
|
12172
|
+
export type ConditionalPricingErrorCode = Components.Schemas.ConditionalPricingErrorCode;
|
|
12040
12173
|
export type ConsumptionTypeGetAg = Components.Schemas.ConsumptionTypeGetAg;
|
|
12041
12174
|
export type Coupon = Components.Schemas.Coupon;
|
|
12042
12175
|
export type CouponItem = Components.Schemas.CouponItem;
|
|
@@ -12141,6 +12274,7 @@ export type TaxAmount = Components.Schemas.TaxAmount;
|
|
|
12141
12274
|
export type TaxAmountBreakdown = Components.Schemas.TaxAmountBreakdown;
|
|
12142
12275
|
export type TaxAmountDto = Components.Schemas.TaxAmountDto;
|
|
12143
12276
|
export type TaxBreakdownInfo = Components.Schemas.TaxBreakdownInfo;
|
|
12277
|
+
export type TaxItem = Components.Schemas.TaxItem;
|
|
12144
12278
|
export type TierDetails = Components.Schemas.TierDetails;
|
|
12145
12279
|
export type TotalDetails = Components.Schemas.TotalDetails;
|
|
12146
12280
|
export type TypeGetAg = Components.Schemas.TypeGetAg;
|
package/dist/openapi.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Pricing API",
|
|
5
5
|
"description": "The `pricing-api` hub sets the foundations for the following Pricing APIs:\n\n### Order API\nThis api enables the management of orders in epilot 360, providing features such as:\n - Automatic calculation of totals and price breakdowns for taxes on the Order entity\n - Product and pricing data validation\n\n### Shopping Cart API\nUsed to interact with a cart during a customer's checkout session, providing:\n - An unified data model to model a Shopping Cart\n - Product and pricing data validation\n - Checkout a cart into an order or quote\n\n### Catalog API\nProvides a way to query the entire catalog of products and prices.\n\n### Availability API\nProvides endpoints for querying products availability by a set of predefined dimensions.\n\n### Spot Market API\nProvides endpoints to fetch (historic) spot market price data.\n\n### External Integrations API\nProvides endpoints for external integrations. E.g. GetAG.\n\n### External Catalog API\nProvides endpoints for external catalog.\n\n### Product Recommendations API\nProvides endpoints for product recommendations.\n",
|
|
6
|
-
"version": "1.1
|
|
6
|
+
"version": "1.2.1",
|
|
7
7
|
"termsOfService": "https://epilot.cloud/agb",
|
|
8
8
|
"contact": {
|
|
9
9
|
"name": "Support",
|
|
@@ -3430,6 +3430,22 @@
|
|
|
3430
3430
|
"external-catalog"
|
|
3431
3431
|
]
|
|
3432
3432
|
},
|
|
3433
|
+
"ConditionalPricingErrorCode": {
|
|
3434
|
+
"type": "string",
|
|
3435
|
+
"description": "Machine-readable failure mode of a conditional-pricing operation, allowing clients\nto branch on the kind of failure instead of parsing the error message.\n\n- `NOT_FOUND` (404): the addressed entity, variant or version does not exist\n- `AMBIGUOUS_RESOLUTION` (409): several variants match the given context while a single result was requested\n- `TUPLE_CONFLICT` (409): the condition tuple is already claimed by another variant\n- `VERSION_CONFLICT` (409): a version already exists at the given `valid_from` on that variant\n- `SUPERSEDED_VERSION` (409): the addressed version has been superseded\n- `CONDITION_UNDEFINED` (400): the context names a condition the entity's schema does not define\n- `OPERATOR_UNSUPPORTED` (400): the requested operator is not applicable to the condition's type\n- `CONTEXT_FORMAT_INVALID` (400): a context value is malformed for its condition type\n- `TOO_MANY_MATCHES` (400): a multi-match resolve exceeded its result cap\n- `WRITE_CONFLICT` (409): transient write contention, retryable unlike `TUPLE_CONFLICT`\n\nEach code is emitted with the HTTP status shown above, and only with that status.\n",
|
|
3436
|
+
"enum": [
|
|
3437
|
+
"NOT_FOUND",
|
|
3438
|
+
"AMBIGUOUS_RESOLUTION",
|
|
3439
|
+
"TUPLE_CONFLICT",
|
|
3440
|
+
"VERSION_CONFLICT",
|
|
3441
|
+
"SUPERSEDED_VERSION",
|
|
3442
|
+
"CONDITION_UNDEFINED",
|
|
3443
|
+
"OPERATOR_UNSUPPORTED",
|
|
3444
|
+
"CONTEXT_FORMAT_INVALID",
|
|
3445
|
+
"TOO_MANY_MATCHES",
|
|
3446
|
+
"WRITE_CONFLICT"
|
|
3447
|
+
]
|
|
3448
|
+
},
|
|
3433
3449
|
"Error": {
|
|
3434
3450
|
"required": [
|
|
3435
3451
|
"message"
|
|
@@ -3449,6 +3465,31 @@
|
|
|
3449
3465
|
}
|
|
3450
3466
|
}
|
|
3451
3467
|
},
|
|
3468
|
+
"ConditionalPricingError": {
|
|
3469
|
+
"description": "An error from a conditional-pricing operation, carrying a machine-readable `code`\nfrom the conditional-pricing vocabulary plus any structured data about the failure,\nso a client can branch on the kind of failure rather than parse the message.\nReferenced only by the operations that emit these codes; every other operation\nkeeps the plain `Error` shape.\n",
|
|
3470
|
+
"allOf": [
|
|
3471
|
+
{
|
|
3472
|
+
"$ref": "#/components/schemas/Error"
|
|
3473
|
+
},
|
|
3474
|
+
{
|
|
3475
|
+
"type": "object",
|
|
3476
|
+
"properties": {
|
|
3477
|
+
"error": {
|
|
3478
|
+
"type": "string",
|
|
3479
|
+
"description": "The error message. Carries the same string as `message`, which the shared `Error`\nschema requires — `error` is the field responses have always used, and every caller\nto date reads. Declared here rather than on the shared `Error` because a request\nvalidation failure puts a list of validation errors in this field instead of a\nstring, and those responses reference `Error` directly.\n"
|
|
3480
|
+
},
|
|
3481
|
+
"code": {
|
|
3482
|
+
"$ref": "#/components/schemas/ConditionalPricingErrorCode"
|
|
3483
|
+
},
|
|
3484
|
+
"details": {
|
|
3485
|
+
"type": "object",
|
|
3486
|
+
"additionalProperties": true,
|
|
3487
|
+
"description": "Structured data about the failure, shaped by the accompanying `code`\n(e.g. the candidate variants of an `ambiguous-resolution`). Only present\nwhen the failure has structured data to report, and never without a `code`.\n"
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
]
|
|
3492
|
+
},
|
|
3452
3493
|
"Product": {
|
|
3453
3494
|
"type": "object",
|
|
3454
3495
|
"description": "The product entity",
|
|
@@ -6967,7 +7008,14 @@
|
|
|
6967
7008
|
"description": "The deprecated tax rate applied.\nThis field has been deprecated in favor of the new Tax Management. You should use the new tax fields pointing to a proper tax entity.\n"
|
|
6968
7009
|
},
|
|
6969
7010
|
"tax": {
|
|
6970
|
-
"
|
|
7011
|
+
"oneOf": [
|
|
7012
|
+
{
|
|
7013
|
+
"$ref": "#/components/schemas/Tax"
|
|
7014
|
+
},
|
|
7015
|
+
{
|
|
7016
|
+
"$ref": "#/components/schemas/TaxItem"
|
|
7017
|
+
}
|
|
7018
|
+
]
|
|
6971
7019
|
}
|
|
6972
7020
|
}
|
|
6973
7021
|
},
|
|
@@ -7701,6 +7749,9 @@
|
|
|
7701
7749
|
"oneOf": [
|
|
7702
7750
|
{
|
|
7703
7751
|
"$ref": "#/components/schemas/Tax"
|
|
7752
|
+
},
|
|
7753
|
+
{
|
|
7754
|
+
"$ref": "#/components/schemas/TaxItem"
|
|
7704
7755
|
}
|
|
7705
7756
|
]
|
|
7706
7757
|
}
|
|
@@ -8443,6 +8494,37 @@
|
|
|
8443
8494
|
"_updated_at": "2021-02-09T12:41:43.662Z"
|
|
8444
8495
|
}
|
|
8445
8496
|
},
|
|
8497
|
+
"TaxItem": {
|
|
8498
|
+
"type": "object",
|
|
8499
|
+
"description": "A minimal, ad-hoc tax rate for line items with no backing tax entity\nin the catalog (e.g. a fully custom/composite price component built\nby a client with no product/price reference to resolve tax from).\nMirrors how PriceItem relates to Price: unlike Tax, this has no\nentity identity — it isn't persisted and can't be looked up by _id,\nso it can't be shared/reused across price items the way a catalog\nTax can.\n",
|
|
8500
|
+
"additionalProperties": false,
|
|
8501
|
+
"required": [
|
|
8502
|
+
"type",
|
|
8503
|
+
"rate"
|
|
8504
|
+
],
|
|
8505
|
+
"properties": {
|
|
8506
|
+
"type": {
|
|
8507
|
+
"type": "string",
|
|
8508
|
+
"enum": [
|
|
8509
|
+
"VAT",
|
|
8510
|
+
"GST",
|
|
8511
|
+
"Custom"
|
|
8512
|
+
]
|
|
8513
|
+
},
|
|
8514
|
+
"rate": {
|
|
8515
|
+
"type": "number",
|
|
8516
|
+
"nullable": true
|
|
8517
|
+
},
|
|
8518
|
+
"description": {
|
|
8519
|
+
"type": "string"
|
|
8520
|
+
}
|
|
8521
|
+
},
|
|
8522
|
+
"example": {
|
|
8523
|
+
"rate": 19,
|
|
8524
|
+
"type": "VAT",
|
|
8525
|
+
"description": "Custom 19% VAT"
|
|
8526
|
+
}
|
|
8527
|
+
},
|
|
8446
8528
|
"TaxBreakdownInfo": {
|
|
8447
8529
|
"type": "object",
|
|
8448
8530
|
"properties": {
|