@epilot/pricing-client 3.37.0 → 3.39.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/openapi.d.ts +333 -0
- package/dist/openapi.json +182 -7
- package/package.json +2 -2
- package/LICENSE +0 -21
package/dist/openapi.d.ts
CHANGED
|
@@ -216,6 +216,110 @@ declare namespace Components {
|
|
|
216
216
|
};
|
|
217
217
|
}[];
|
|
218
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* The coupon configuration
|
|
221
|
+
* example:
|
|
222
|
+
* {
|
|
223
|
+
* "_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
224
|
+
* "_schema": "coupon",
|
|
225
|
+
* "_org": "org_12345",
|
|
226
|
+
* "_created_at": "2024-01-15T10:00:00.000Z",
|
|
227
|
+
* "_updated_at": "2024-01-20T12:00:00.000Z",
|
|
228
|
+
* "_title": "Sample Coupon",
|
|
229
|
+
* "name": "Sample Coupon",
|
|
230
|
+
* "type": "fixed",
|
|
231
|
+
* "fixed_value": 555,
|
|
232
|
+
* "fixed_value_currency": "USD",
|
|
233
|
+
* "fixed_value_decimal": "5.55",
|
|
234
|
+
* "active": true,
|
|
235
|
+
* "prices": {
|
|
236
|
+
* "$relation": [
|
|
237
|
+
* {
|
|
238
|
+
* "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
|
|
239
|
+
* "_tags": [
|
|
240
|
+
* "discount",
|
|
241
|
+
* "special"
|
|
242
|
+
* ],
|
|
243
|
+
* "_schema": "price"
|
|
244
|
+
* }
|
|
245
|
+
* ]
|
|
246
|
+
* }
|
|
247
|
+
* }
|
|
248
|
+
*/
|
|
249
|
+
export interface BaseCoupon {
|
|
250
|
+
[name: string]: any;
|
|
251
|
+
_id: EntityId /* uuid */;
|
|
252
|
+
/**
|
|
253
|
+
* The auto-generated title for the title
|
|
254
|
+
*/
|
|
255
|
+
_title: string;
|
|
256
|
+
/**
|
|
257
|
+
* Organization Id the entity belongs to
|
|
258
|
+
*/
|
|
259
|
+
_org: string;
|
|
260
|
+
/**
|
|
261
|
+
* The schema of the entity, for coupons it is always `coupon`
|
|
262
|
+
*/
|
|
263
|
+
_schema: "coupon";
|
|
264
|
+
_tags?: string[];
|
|
265
|
+
/**
|
|
266
|
+
* The creation date for the opportunity
|
|
267
|
+
*/
|
|
268
|
+
_created_at: string; // date-time
|
|
269
|
+
/**
|
|
270
|
+
* The date the coupon was last updated
|
|
271
|
+
*/
|
|
272
|
+
_updated_at: string; // date-time
|
|
273
|
+
name: string;
|
|
274
|
+
description?: string;
|
|
275
|
+
type?: "fixed" | "percentage";
|
|
276
|
+
category?: "discount" | "cashback";
|
|
277
|
+
/**
|
|
278
|
+
* Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
|
|
279
|
+
*/
|
|
280
|
+
percentage_value?: string;
|
|
281
|
+
/**
|
|
282
|
+
* Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.
|
|
283
|
+
*/
|
|
284
|
+
fixed_value?: number;
|
|
285
|
+
/**
|
|
286
|
+
* 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.
|
|
287
|
+
*/
|
|
288
|
+
fixed_value_decimal?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Use if type is set to fixed. Three-letter ISO currency code, in lowercase.
|
|
291
|
+
*/
|
|
292
|
+
fixed_value_currency?: /* Use if type is set to fixed. Three-letter ISO currency code, in lowercase. */ /**
|
|
293
|
+
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
|
|
294
|
+
* ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
|
|
295
|
+
*
|
|
296
|
+
* example:
|
|
297
|
+
* EUR
|
|
298
|
+
*/
|
|
299
|
+
Currency;
|
|
300
|
+
/**
|
|
301
|
+
* The cashback period, for now it's limited to either 0 months or 12 months
|
|
302
|
+
*/
|
|
303
|
+
cashback_period?: "0" | "12";
|
|
304
|
+
active?: boolean;
|
|
305
|
+
/**
|
|
306
|
+
* Whether the coupon requires a promo code to be applied
|
|
307
|
+
*/
|
|
308
|
+
requires_promo_code?: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.
|
|
311
|
+
*/
|
|
312
|
+
prices?: /* The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise. */ {
|
|
313
|
+
$relation?: EntityRelation[];
|
|
314
|
+
} | /**
|
|
315
|
+
* The price entity schema for simple pricing
|
|
316
|
+
* example:
|
|
317
|
+
* {
|
|
318
|
+
* "$ref": "#/components/examples/price"
|
|
319
|
+
* }
|
|
320
|
+
*/
|
|
321
|
+
Price[];
|
|
322
|
+
}
|
|
219
323
|
/**
|
|
220
324
|
* Represents a price item
|
|
221
325
|
* example:
|
|
@@ -2212,6 +2316,130 @@ declare namespace Components {
|
|
|
2212
2316
|
*/
|
|
2213
2317
|
cashback_period?: "0" | "12";
|
|
2214
2318
|
active?: boolean;
|
|
2319
|
+
/**
|
|
2320
|
+
* Whether the coupon requires a promo code to be applied
|
|
2321
|
+
*/
|
|
2322
|
+
requires_promo_code?: boolean;
|
|
2323
|
+
/**
|
|
2324
|
+
* The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.
|
|
2325
|
+
*/
|
|
2326
|
+
prices?: /* The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise. */ {
|
|
2327
|
+
$relation?: EntityRelation[];
|
|
2328
|
+
} | /**
|
|
2329
|
+
* The price entity schema for simple pricing
|
|
2330
|
+
* example:
|
|
2331
|
+
* {
|
|
2332
|
+
* "$ref": "#/components/examples/price"
|
|
2333
|
+
* }
|
|
2334
|
+
*/
|
|
2335
|
+
Price[];
|
|
2336
|
+
promo_codes?: /**
|
|
2337
|
+
* example:
|
|
2338
|
+
* {
|
|
2339
|
+
* "id": "123e4567-e89b-12d3-a456-426614174000",
|
|
2340
|
+
* "code": "123456",
|
|
2341
|
+
* "has_usage_limit": true,
|
|
2342
|
+
* "usage_limit": 10
|
|
2343
|
+
* }
|
|
2344
|
+
*/
|
|
2345
|
+
PromoCode[];
|
|
2346
|
+
/**
|
|
2347
|
+
* Map of ids of promo codes with their usage count
|
|
2348
|
+
*/
|
|
2349
|
+
promo_code_usage?: {
|
|
2350
|
+
[name: string]: number;
|
|
2351
|
+
};
|
|
2352
|
+
}
|
|
2353
|
+
/**
|
|
2354
|
+
* The coupon configuration
|
|
2355
|
+
* example:
|
|
2356
|
+
* {
|
|
2357
|
+
* "_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
2358
|
+
* "_schema": "coupon",
|
|
2359
|
+
* "_org": "org_12345",
|
|
2360
|
+
* "_created_at": "2024-01-15T10:00:00.000Z",
|
|
2361
|
+
* "_updated_at": "2024-01-20T12:00:00.000Z",
|
|
2362
|
+
* "_title": "Sample Coupon",
|
|
2363
|
+
* "name": "Sample Coupon",
|
|
2364
|
+
* "type": "fixed",
|
|
2365
|
+
* "fixed_value": 555,
|
|
2366
|
+
* "fixed_value_currency": "USD",
|
|
2367
|
+
* "fixed_value_decimal": "5.55",
|
|
2368
|
+
* "active": true,
|
|
2369
|
+
* "prices": {
|
|
2370
|
+
* "$relation": [
|
|
2371
|
+
* {
|
|
2372
|
+
* "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
|
|
2373
|
+
* "_tags": [
|
|
2374
|
+
* "discount",
|
|
2375
|
+
* "special"
|
|
2376
|
+
* ],
|
|
2377
|
+
* "_schema": "price"
|
|
2378
|
+
* }
|
|
2379
|
+
* ]
|
|
2380
|
+
* }
|
|
2381
|
+
* }
|
|
2382
|
+
*/
|
|
2383
|
+
export interface CouponWithoutPromoCodes {
|
|
2384
|
+
[name: string]: any;
|
|
2385
|
+
_id: EntityId /* uuid */;
|
|
2386
|
+
/**
|
|
2387
|
+
* The auto-generated title for the title
|
|
2388
|
+
*/
|
|
2389
|
+
_title: string;
|
|
2390
|
+
/**
|
|
2391
|
+
* Organization Id the entity belongs to
|
|
2392
|
+
*/
|
|
2393
|
+
_org: string;
|
|
2394
|
+
/**
|
|
2395
|
+
* The schema of the entity, for coupons it is always `coupon`
|
|
2396
|
+
*/
|
|
2397
|
+
_schema: "coupon";
|
|
2398
|
+
_tags?: string[];
|
|
2399
|
+
/**
|
|
2400
|
+
* The creation date for the opportunity
|
|
2401
|
+
*/
|
|
2402
|
+
_created_at: string; // date-time
|
|
2403
|
+
/**
|
|
2404
|
+
* The date the coupon was last updated
|
|
2405
|
+
*/
|
|
2406
|
+
_updated_at: string; // date-time
|
|
2407
|
+
name: string;
|
|
2408
|
+
description?: string;
|
|
2409
|
+
type?: "fixed" | "percentage";
|
|
2410
|
+
category?: "discount" | "cashback";
|
|
2411
|
+
/**
|
|
2412
|
+
* Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
|
|
2413
|
+
*/
|
|
2414
|
+
percentage_value?: string;
|
|
2415
|
+
/**
|
|
2416
|
+
* Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.
|
|
2417
|
+
*/
|
|
2418
|
+
fixed_value?: number;
|
|
2419
|
+
/**
|
|
2420
|
+
* 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.
|
|
2421
|
+
*/
|
|
2422
|
+
fixed_value_decimal?: string;
|
|
2423
|
+
/**
|
|
2424
|
+
* Use if type is set to fixed. Three-letter ISO currency code, in lowercase.
|
|
2425
|
+
*/
|
|
2426
|
+
fixed_value_currency?: /* Use if type is set to fixed. Three-letter ISO currency code, in lowercase. */ /**
|
|
2427
|
+
* Three-letter ISO currency code, in lowercase. Must be a supported currency.
|
|
2428
|
+
* ISO 4217 CURRENCY CODES as specified in the documentation: https://www.iso.org/iso-4217-currency-codes.html
|
|
2429
|
+
*
|
|
2430
|
+
* example:
|
|
2431
|
+
* EUR
|
|
2432
|
+
*/
|
|
2433
|
+
Currency;
|
|
2434
|
+
/**
|
|
2435
|
+
* The cashback period, for now it's limited to either 0 months or 12 months
|
|
2436
|
+
*/
|
|
2437
|
+
cashback_period?: "0" | "12";
|
|
2438
|
+
active?: boolean;
|
|
2439
|
+
/**
|
|
2440
|
+
* Whether the coupon requires a promo code to be applied
|
|
2441
|
+
*/
|
|
2442
|
+
requires_promo_code?: boolean;
|
|
2215
2443
|
/**
|
|
2216
2444
|
* The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.
|
|
2217
2445
|
*/
|
|
@@ -4304,6 +4532,69 @@ declare namespace Components {
|
|
|
4304
4532
|
_updated_at?: string;
|
|
4305
4533
|
}
|
|
4306
4534
|
export type ProductCategory = "power" | "gas";
|
|
4535
|
+
/**
|
|
4536
|
+
* example:
|
|
4537
|
+
* {
|
|
4538
|
+
* "id": "123e4567-e89b-12d3-a456-426614174000",
|
|
4539
|
+
* "code": "123456",
|
|
4540
|
+
* "has_usage_limit": true,
|
|
4541
|
+
* "usage_limit": 10
|
|
4542
|
+
* }
|
|
4543
|
+
*/
|
|
4544
|
+
export interface PromoCode {
|
|
4545
|
+
/**
|
|
4546
|
+
* The id of the promo code
|
|
4547
|
+
*/
|
|
4548
|
+
id: string;
|
|
4549
|
+
/**
|
|
4550
|
+
* The code of the promo code
|
|
4551
|
+
*/
|
|
4552
|
+
code: string;
|
|
4553
|
+
/**
|
|
4554
|
+
* Whether the promo code has a usage limit
|
|
4555
|
+
*/
|
|
4556
|
+
has_usage_limit?: boolean;
|
|
4557
|
+
/**
|
|
4558
|
+
* The usage limit of the promo code
|
|
4559
|
+
*/
|
|
4560
|
+
usage_limit?: number | null;
|
|
4561
|
+
}
|
|
4562
|
+
/**
|
|
4563
|
+
* The result from the validation of a set of promo codes.
|
|
4564
|
+
*/
|
|
4565
|
+
export interface PromoCodeValidationResponse {
|
|
4566
|
+
matched_coupons?: /**
|
|
4567
|
+
* The coupon configuration
|
|
4568
|
+
* example:
|
|
4569
|
+
* {
|
|
4570
|
+
* "_id": "123e4567-e89b-12d3-a456-426614174000",
|
|
4571
|
+
* "_schema": "coupon",
|
|
4572
|
+
* "_org": "org_12345",
|
|
4573
|
+
* "_created_at": "2024-01-15T10:00:00.000Z",
|
|
4574
|
+
* "_updated_at": "2024-01-20T12:00:00.000Z",
|
|
4575
|
+
* "_title": "Sample Coupon",
|
|
4576
|
+
* "name": "Sample Coupon",
|
|
4577
|
+
* "type": "fixed",
|
|
4578
|
+
* "fixed_value": 555,
|
|
4579
|
+
* "fixed_value_currency": "USD",
|
|
4580
|
+
* "fixed_value_decimal": "5.55",
|
|
4581
|
+
* "active": true,
|
|
4582
|
+
* "prices": {
|
|
4583
|
+
* "$relation": [
|
|
4584
|
+
* {
|
|
4585
|
+
* "entity_id": "abc12345-def6-7890-gh12-ijklmnopqrst",
|
|
4586
|
+
* "_tags": [
|
|
4587
|
+
* "discount",
|
|
4588
|
+
* "special"
|
|
4589
|
+
* ],
|
|
4590
|
+
* "_schema": "price"
|
|
4591
|
+
* }
|
|
4592
|
+
* ]
|
|
4593
|
+
* }
|
|
4594
|
+
* }
|
|
4595
|
+
*/
|
|
4596
|
+
BaseCoupon[];
|
|
4597
|
+
}
|
|
4307
4598
|
/**
|
|
4308
4599
|
* The provider entity
|
|
4309
4600
|
*/
|
|
@@ -5096,6 +5387,22 @@ declare namespace Paths {
|
|
|
5096
5387
|
export type $400 = Components.Schemas.Error;
|
|
5097
5388
|
}
|
|
5098
5389
|
}
|
|
5390
|
+
namespace $ValidatePromoCodes {
|
|
5391
|
+
export interface RequestBody {
|
|
5392
|
+
/**
|
|
5393
|
+
* The list of coupon ids to unlock with promo codes
|
|
5394
|
+
*/
|
|
5395
|
+
coupon_ids?: string[];
|
|
5396
|
+
/**
|
|
5397
|
+
* The list of promo codes to validate against the coupons
|
|
5398
|
+
*/
|
|
5399
|
+
promo_codes?: string[];
|
|
5400
|
+
}
|
|
5401
|
+
namespace Responses {
|
|
5402
|
+
export type $200 = /* The result from the validation of a set of promo codes. */ Components.Schemas.PromoCodeValidationResponse;
|
|
5403
|
+
export type $400 = Components.Schemas.Error;
|
|
5404
|
+
}
|
|
5405
|
+
}
|
|
5099
5406
|
namespace CreateOrder {
|
|
5100
5407
|
export type RequestBody = /* Order Entity Payload */ Components.Schemas.OrderPayload;
|
|
5101
5408
|
namespace Responses {
|
|
@@ -5204,6 +5511,16 @@ export interface OperationMethods {
|
|
|
5204
5511
|
data?: Paths.$PrivateSearchCatalog.RequestBody,
|
|
5205
5512
|
config?: AxiosRequestConfig
|
|
5206
5513
|
): OperationResponse<Paths.$PrivateSearchCatalog.Responses.$200>
|
|
5514
|
+
/**
|
|
5515
|
+
* $validatePromoCodes - validatePromoCodes
|
|
5516
|
+
*
|
|
5517
|
+
* Validate a list of promo codes against a list of coupons
|
|
5518
|
+
*/
|
|
5519
|
+
'$validatePromoCodes'(
|
|
5520
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
5521
|
+
data?: Paths.$ValidatePromoCodes.RequestBody,
|
|
5522
|
+
config?: AxiosRequestConfig
|
|
5523
|
+
): OperationResponse<Paths.$ValidatePromoCodes.Responses.$200>
|
|
5207
5524
|
/**
|
|
5208
5525
|
* $availabilityCheck - availabilityCheck
|
|
5209
5526
|
*
|
|
@@ -5380,6 +5697,18 @@ export interface PathsDictionary {
|
|
|
5380
5697
|
config?: AxiosRequestConfig
|
|
5381
5698
|
): OperationResponse<Paths.$PrivateSearchCatalog.Responses.$200>
|
|
5382
5699
|
}
|
|
5700
|
+
['/v1/validate-promo-codes']: {
|
|
5701
|
+
/**
|
|
5702
|
+
* $validatePromoCodes - validatePromoCodes
|
|
5703
|
+
*
|
|
5704
|
+
* Validate a list of promo codes against a list of coupons
|
|
5705
|
+
*/
|
|
5706
|
+
'post'(
|
|
5707
|
+
parameters?: Parameters<UnknownParamsObject> | null,
|
|
5708
|
+
data?: Paths.$ValidatePromoCodes.RequestBody,
|
|
5709
|
+
config?: AxiosRequestConfig
|
|
5710
|
+
): OperationResponse<Paths.$ValidatePromoCodes.Responses.$200>
|
|
5711
|
+
}
|
|
5383
5712
|
['/v1/public/availability:check']: {
|
|
5384
5713
|
/**
|
|
5385
5714
|
* $availabilityCheck - availabilityCheck
|
|
@@ -5499,6 +5828,7 @@ export type AvailabilityDate = Components.Schemas.AvailabilityDate;
|
|
|
5499
5828
|
export type AvailabilityFilters = Components.Schemas.AvailabilityFilters;
|
|
5500
5829
|
export type AvailabilityLocation = Components.Schemas.AvailabilityLocation;
|
|
5501
5830
|
export type AvailabilityResult = Components.Schemas.AvailabilityResult;
|
|
5831
|
+
export type BaseCoupon = Components.Schemas.BaseCoupon;
|
|
5502
5832
|
export type BasePriceItem = Components.Schemas.BasePriceItem;
|
|
5503
5833
|
export type BasePriceItemCommon = Components.Schemas.BasePriceItemCommon;
|
|
5504
5834
|
export type BasePriceItemDto = Components.Schemas.BasePriceItemDto;
|
|
@@ -5525,6 +5855,7 @@ export type ComputedPriceBreakdown = Components.Schemas.ComputedPriceBreakdown;
|
|
|
5525
5855
|
export type ComputedPriceComponents = Components.Schemas.ComputedPriceComponents;
|
|
5526
5856
|
export type ConsumptionTypeGetAg = Components.Schemas.ConsumptionTypeGetAg;
|
|
5527
5857
|
export type Coupon = Components.Schemas.Coupon;
|
|
5858
|
+
export type CouponWithoutPromoCodes = Components.Schemas.CouponWithoutPromoCodes;
|
|
5528
5859
|
export type Currency = Components.Schemas.Currency;
|
|
5529
5860
|
export type Customer = Components.Schemas.Customer;
|
|
5530
5861
|
export type DynamicTariffInterval = Components.Schemas.DynamicTariffInterval;
|
|
@@ -5571,6 +5902,8 @@ export type PricingDetailsResponse = Components.Schemas.PricingDetailsResponse;
|
|
|
5571
5902
|
export type PricingModel = Components.Schemas.PricingModel;
|
|
5572
5903
|
export type Product = Components.Schemas.Product;
|
|
5573
5904
|
export type ProductCategory = Components.Schemas.ProductCategory;
|
|
5905
|
+
export type PromoCode = Components.Schemas.PromoCode;
|
|
5906
|
+
export type PromoCodeValidationResponse = Components.Schemas.PromoCodeValidationResponse;
|
|
5574
5907
|
export type Provider = Components.Schemas.Provider;
|
|
5575
5908
|
export type RecurrenceAmount = Components.Schemas.RecurrenceAmount;
|
|
5576
5909
|
export type RecurrenceAmountDto = Components.Schemas.RecurrenceAmountDto;
|
package/dist/openapi.json
CHANGED
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
"name": "Catalog API",
|
|
25
25
|
"description": "Provides a way to query the entire catalog of products and prices.\n"
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
"name": "Promo Codes API",
|
|
29
|
+
"description": "This API enables the validation of promo codes within journeys, their uniqueness and availability\n"
|
|
30
|
+
},
|
|
27
31
|
{
|
|
28
32
|
"name": "Availability API",
|
|
29
33
|
"description": "Provides endpoints for querying products availability by a set of predefined dimensions.\n"
|
|
@@ -112,12 +116,6 @@
|
|
|
112
116
|
}
|
|
113
117
|
],
|
|
114
118
|
"servers": [
|
|
115
|
-
{
|
|
116
|
-
"url": "https://pricing-api.sls.epilot.io"
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"url": "https://pricing-api.sls.epilot.io"
|
|
120
|
-
},
|
|
121
119
|
{
|
|
122
120
|
"url": "https://pricing-api.sls.epilot.io"
|
|
123
121
|
}
|
|
@@ -873,6 +871,105 @@
|
|
|
873
871
|
}
|
|
874
872
|
}
|
|
875
873
|
},
|
|
874
|
+
"/v1/validate-promo-codes": {
|
|
875
|
+
"post": {
|
|
876
|
+
"description": "Validate a list of promo codes against a list of coupons",
|
|
877
|
+
"summary": "validatePromoCodes",
|
|
878
|
+
"operationId": "$validatePromoCodes",
|
|
879
|
+
"tags": [
|
|
880
|
+
"Promo Codes API"
|
|
881
|
+
],
|
|
882
|
+
"requestBody": {
|
|
883
|
+
"required": true,
|
|
884
|
+
"content": {
|
|
885
|
+
"application/json": {
|
|
886
|
+
"schema": {
|
|
887
|
+
"properties": {
|
|
888
|
+
"coupon_ids": {
|
|
889
|
+
"type": "array",
|
|
890
|
+
"description": "The list of coupon ids to unlock with promo codes",
|
|
891
|
+
"items": {
|
|
892
|
+
"type": "string"
|
|
893
|
+
}
|
|
894
|
+
},
|
|
895
|
+
"promo_codes": {
|
|
896
|
+
"type": "array",
|
|
897
|
+
"description": "The list of promo codes to validate against the coupons",
|
|
898
|
+
"items": {
|
|
899
|
+
"type": "string"
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
"examples": {
|
|
905
|
+
"Find coupons matching codes": {
|
|
906
|
+
"value": {
|
|
907
|
+
"coupon_ids": [
|
|
908
|
+
"81b8e841-5926-4a73-ac77-6607c1037b65",
|
|
909
|
+
"45964a30-1a42-4e59-9362-7d954baf4ea1"
|
|
910
|
+
],
|
|
911
|
+
"promo_codes": [
|
|
912
|
+
"ABC",
|
|
913
|
+
"DEF"
|
|
914
|
+
]
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
},
|
|
921
|
+
"responses": {
|
|
922
|
+
"200": {
|
|
923
|
+
"description": "Pricing details result",
|
|
924
|
+
"content": {
|
|
925
|
+
"application/json": {
|
|
926
|
+
"schema": {
|
|
927
|
+
"$ref": "#/components/schemas/PromoCodeValidationResponse"
|
|
928
|
+
},
|
|
929
|
+
"example": {
|
|
930
|
+
"matched_coupons": [
|
|
931
|
+
{
|
|
932
|
+
"name": "Coupon with promo-codes",
|
|
933
|
+
"type": "fixed",
|
|
934
|
+
"percentage_value": null,
|
|
935
|
+
"fixed_value": 10,
|
|
936
|
+
"fixed_value_currency": "EUR",
|
|
937
|
+
"fixed_value_decimal": "10.00",
|
|
938
|
+
"category": "discount",
|
|
939
|
+
"cashback_period": null,
|
|
940
|
+
"active": true,
|
|
941
|
+
"_schema": "coupon",
|
|
942
|
+
"requires_promo_code": true,
|
|
943
|
+
"_id": "81b8e841-5926-4a73-ac77-6607c1037b65",
|
|
944
|
+
"_org": "739224",
|
|
945
|
+
"_owners": [
|
|
946
|
+
{
|
|
947
|
+
"org_id": "739224",
|
|
948
|
+
"user_id": "11000622"
|
|
949
|
+
}
|
|
950
|
+
],
|
|
951
|
+
"_created_at": "2025-01-29T15:46:41.014Z",
|
|
952
|
+
"_updated_at": "2025-01-29T15:46:41.014Z",
|
|
953
|
+
"_title": "Coupon with promo-codes"
|
|
954
|
+
}
|
|
955
|
+
]
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
"400": {
|
|
961
|
+
"description": "Invalid payload",
|
|
962
|
+
"content": {
|
|
963
|
+
"application/json": {
|
|
964
|
+
"schema": {
|
|
965
|
+
"$ref": "#/components/schemas/Error"
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
},
|
|
876
973
|
"/v1/public/availability:check": {
|
|
877
974
|
"post": {
|
|
878
975
|
"description": "The availability check endpoint",
|
|
@@ -4579,6 +4676,18 @@
|
|
|
4579
4676
|
}
|
|
4580
4677
|
}
|
|
4581
4678
|
},
|
|
4679
|
+
"PromoCodeValidationResponse": {
|
|
4680
|
+
"type": "object",
|
|
4681
|
+
"description": "The result from the validation of a set of promo codes.",
|
|
4682
|
+
"properties": {
|
|
4683
|
+
"matched_coupons": {
|
|
4684
|
+
"type": "array",
|
|
4685
|
+
"items": {
|
|
4686
|
+
"$ref": "#/components/schemas/BaseCoupon"
|
|
4687
|
+
}
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4690
|
+
},
|
|
4582
4691
|
"PricingDetailsResponse": {
|
|
4583
4692
|
"type": "object",
|
|
4584
4693
|
"description": "The result from the calculation of a set of price items.",
|
|
@@ -5057,7 +5166,7 @@
|
|
|
5057
5166
|
}
|
|
5058
5167
|
}
|
|
5059
5168
|
},
|
|
5060
|
-
"
|
|
5169
|
+
"BaseCoupon": {
|
|
5061
5170
|
"type": "object",
|
|
5062
5171
|
"description": "The coupon configuration",
|
|
5063
5172
|
"additionalProperties": true,
|
|
@@ -5162,6 +5271,10 @@
|
|
|
5162
5271
|
"active": {
|
|
5163
5272
|
"type": "boolean"
|
|
5164
5273
|
},
|
|
5274
|
+
"requires_promo_code": {
|
|
5275
|
+
"type": "boolean",
|
|
5276
|
+
"description": "Whether the coupon requires a promo code to be applied"
|
|
5277
|
+
},
|
|
5165
5278
|
"prices": {
|
|
5166
5279
|
"description": "The prices associated with the coupon. Will hold price entities if hydrated, relations otherwise.",
|
|
5167
5280
|
"oneOf": [
|
|
@@ -5212,6 +5325,68 @@
|
|
|
5212
5325
|
}
|
|
5213
5326
|
}
|
|
5214
5327
|
},
|
|
5328
|
+
"Coupon": {
|
|
5329
|
+
"allOf": [
|
|
5330
|
+
{
|
|
5331
|
+
"$ref": "#/components/schemas/BaseCoupon"
|
|
5332
|
+
}
|
|
5333
|
+
],
|
|
5334
|
+
"type": "object",
|
|
5335
|
+
"properties": {
|
|
5336
|
+
"promo_codes": {
|
|
5337
|
+
"type": "array",
|
|
5338
|
+
"items": {
|
|
5339
|
+
"$ref": "#/components/schemas/PromoCode"
|
|
5340
|
+
}
|
|
5341
|
+
},
|
|
5342
|
+
"promo_code_usage": {
|
|
5343
|
+
"type": "object",
|
|
5344
|
+
"additionalProperties": {
|
|
5345
|
+
"type": "number"
|
|
5346
|
+
},
|
|
5347
|
+
"description": "Map of ids of promo codes with their usage count"
|
|
5348
|
+
}
|
|
5349
|
+
}
|
|
5350
|
+
},
|
|
5351
|
+
"CouponWithoutPromoCodes": {
|
|
5352
|
+
"allOf": [
|
|
5353
|
+
{
|
|
5354
|
+
"$ref": "#/components/schemas/BaseCoupon"
|
|
5355
|
+
}
|
|
5356
|
+
]
|
|
5357
|
+
},
|
|
5358
|
+
"PromoCode": {
|
|
5359
|
+
"type": "object",
|
|
5360
|
+
"required": [
|
|
5361
|
+
"id",
|
|
5362
|
+
"code"
|
|
5363
|
+
],
|
|
5364
|
+
"properties": {
|
|
5365
|
+
"id": {
|
|
5366
|
+
"type": "string",
|
|
5367
|
+
"description": "The id of the promo code"
|
|
5368
|
+
},
|
|
5369
|
+
"code": {
|
|
5370
|
+
"type": "string",
|
|
5371
|
+
"description": "The code of the promo code"
|
|
5372
|
+
},
|
|
5373
|
+
"has_usage_limit": {
|
|
5374
|
+
"type": "boolean",
|
|
5375
|
+
"description": "Whether the promo code has a usage limit"
|
|
5376
|
+
},
|
|
5377
|
+
"usage_limit": {
|
|
5378
|
+
"type": "number",
|
|
5379
|
+
"nullable": true,
|
|
5380
|
+
"description": "The usage limit of the promo code"
|
|
5381
|
+
}
|
|
5382
|
+
},
|
|
5383
|
+
"example": {
|
|
5384
|
+
"id": "123e4567-e89b-12d3-a456-426614174000",
|
|
5385
|
+
"code": "123456",
|
|
5386
|
+
"has_usage_limit": true,
|
|
5387
|
+
"usage_limit": 10
|
|
5388
|
+
}
|
|
5389
|
+
},
|
|
5215
5390
|
"PriceTier": {
|
|
5216
5391
|
"type": "object",
|
|
5217
5392
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epilot/pricing-client",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.39.0",
|
|
4
4
|
"description": "Client for epilot Pricing APIs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"webpack": "^5.18.0",
|
|
72
72
|
"webpack-cli": "^4.4.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "39426e86cfb320fa3227dc03f60ee6a10848e7c7"
|
|
75
75
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 epilot GmbH
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|