@viu/emporix-sdk 2.21.0 → 2.23.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/CHANGELOG.md +146 -0
- package/dist/availability.cjs +118 -0
- package/dist/availability.cjs.map +1 -1
- package/dist/availability.d.cts +178 -2
- package/dist/availability.d.ts +178 -2
- package/dist/availability.js +1 -1
- package/dist/cart.cjs +215 -9
- package/dist/cart.cjs.map +1 -1
- package/dist/cart.d.cts +281 -3
- package/dist/cart.d.ts +281 -3
- package/dist/cart.js +1 -1
- package/dist/category.cjs +220 -2
- package/dist/category.cjs.map +1 -1
- package/dist/category.d.cts +408 -1
- package/dist/category.d.ts +408 -1
- package/dist/category.js +1 -1
- package/dist/{chunk-HD5RBCM6.js → chunk-27NLS646.js} +10 -2
- package/dist/chunk-27NLS646.js.map +1 -0
- package/dist/{chunk-PYLWZZC4.js → chunk-6PJFOX3A.js} +126 -2
- package/dist/chunk-6PJFOX3A.js.map +1 -0
- package/dist/chunk-HWVFF6B2.js +378 -0
- package/dist/chunk-HWVFF6B2.js.map +1 -0
- package/dist/chunk-LQFRJSVT.js +224 -0
- package/dist/chunk-LQFRJSVT.js.map +1 -0
- package/dist/chunk-P7G4LOOV.js +264 -0
- package/dist/chunk-P7G4LOOV.js.map +1 -0
- package/dist/{chunk-HBEQEIT6.js → chunk-PRN3T6TY.js} +63 -3
- package/dist/chunk-PRN3T6TY.js.map +1 -0
- package/dist/{chunk-44F52KRE.js → chunk-QQMLN76U.js} +27 -2
- package/dist/chunk-QQMLN76U.js.map +1 -0
- package/dist/chunk-UNW6SFSB.js +363 -0
- package/dist/chunk-UNW6SFSB.js.map +1 -0
- package/dist/chunk-V3275BA7.js +181 -0
- package/dist/chunk-V3275BA7.js.map +1 -0
- package/dist/chunk-W2KBVWJ2.js +323 -0
- package/dist/chunk-W2KBVWJ2.js.map +1 -0
- package/dist/chunk-YVZ6GOLE.js +399 -0
- package/dist/chunk-YVZ6GOLE.js.map +1 -0
- package/dist/chunk-ZOFGDNSX.js +305 -0
- package/dist/chunk-ZOFGDNSX.js.map +1 -0
- package/dist/companies.cjs +25 -0
- package/dist/companies.cjs.map +1 -1
- package/dist/companies.d.cts +14 -0
- package/dist/companies.d.ts +14 -0
- package/dist/companies.js +1 -1
- package/dist/contacts.cjs +8 -0
- package/dist/contacts.cjs.map +1 -1
- package/dist/contacts.d.cts +2 -0
- package/dist/contacts.d.ts +2 -0
- package/dist/contacts.js +1 -1
- package/dist/customer-groups-BxSNFHq1.d.cts +706 -0
- package/dist/customer-groups-GlzWhDsi.d.ts +706 -0
- package/dist/customer-groups.cjs +200 -17
- package/dist/customer-groups.cjs.map +1 -1
- package/dist/customer-groups.d.cts +2 -110
- package/dist/customer-groups.d.ts +2 -110
- package/dist/customer-groups.js +1 -1
- package/dist/customer.cjs +61 -1
- package/dist/customer.cjs.map +1 -1
- package/dist/customer.d.cts +48 -1
- package/dist/customer.d.ts +48 -1
- package/dist/customer.js +1 -1
- package/dist/index.cjs +2566 -554
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +455 -12
- package/dist/index.d.ts +455 -12
- package/dist/index.js +687 -342
- package/dist/index.js.map +1 -1
- package/dist/orders.cjs +160 -2
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.d.cts +221 -1
- package/dist/orders.d.ts +221 -1
- package/dist/orders.js +1 -1
- package/dist/payment.cjs +124 -0
- package/dist/payment.cjs.map +1 -1
- package/dist/payment.d.cts +335 -1
- package/dist/payment.d.ts +335 -1
- package/dist/payment.js +1 -1
- package/dist/price.cjs +197 -0
- package/dist/price.cjs.map +1 -1
- package/dist/price.d.cts +577 -1
- package/dist/price.d.ts +577 -1
- package/dist/price.js +1 -1
- package/dist/product.cjs +190 -0
- package/dist/product.cjs.map +1 -1
- package/dist/product.d.cts +503 -1
- package/dist/product.d.ts +503 -1
- package/dist/product.js +1 -1
- package/dist/segment.cjs +179 -0
- package/dist/segment.cjs.map +1 -1
- package/dist/segment.d.cts +181 -1
- package/dist/segment.d.ts +181 -1
- package/dist/segment.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-36T4YPQJ.js +0 -106
- package/dist/chunk-36T4YPQJ.js.map +0 -1
- package/dist/chunk-3BTPX7IJ.js +0 -41
- package/dist/chunk-3BTPX7IJ.js.map +0 -1
- package/dist/chunk-44F52KRE.js.map +0 -1
- package/dist/chunk-A3LYJUD4.js +0 -108
- package/dist/chunk-A3LYJUD4.js.map +0 -1
- package/dist/chunk-FZMP5NQZ.js +0 -173
- package/dist/chunk-FZMP5NQZ.js.map +0 -1
- package/dist/chunk-HBEQEIT6.js.map +0 -1
- package/dist/chunk-HD5RBCM6.js.map +0 -1
- package/dist/chunk-HUEMYP2L.js +0 -193
- package/dist/chunk-HUEMYP2L.js.map +0 -1
- package/dist/chunk-IVCCGJN5.js +0 -63
- package/dist/chunk-IVCCGJN5.js.map +0 -1
- package/dist/chunk-NE7MIZPR.js +0 -144
- package/dist/chunk-NE7MIZPR.js.map +0 -1
- package/dist/chunk-PYLWZZC4.js.map +0 -1
- package/dist/chunk-ZNLHLFQM.js +0 -160
- package/dist/chunk-ZNLHLFQM.js.map +0 -1
package/dist/price.d.ts
CHANGED
|
@@ -1,5 +1,142 @@
|
|
|
1
1
|
import { C as ClientContext, b as AuthContext } from './context-CfXJcYKP.js';
|
|
2
2
|
|
|
3
|
+
type CreatePrice = {
|
|
4
|
+
/**
|
|
5
|
+
* Custom price identifier. If not provided, it is automatically generated.
|
|
6
|
+
*/
|
|
7
|
+
id?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Item for which the price is defined.
|
|
10
|
+
*/
|
|
11
|
+
itemId: {
|
|
12
|
+
/**
|
|
13
|
+
* Type of the referenced item. Possible values:
|
|
14
|
+
* * `PRODUCT`
|
|
15
|
+
* * `SKU`
|
|
16
|
+
*
|
|
17
|
+
* **The `SKU` value is in preview mode** - the system does not fully operate on the SKU concept yet.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
itemType: string;
|
|
21
|
+
/**
|
|
22
|
+
* Product's unique identifier - ID or SKU.
|
|
23
|
+
*
|
|
24
|
+
* **The `SKU` value is in preview mode** - the system does not fully operate on the SKU concept yet.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
id: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Product's uniform resource name.
|
|
31
|
+
*/
|
|
32
|
+
itemYrn?: string;
|
|
33
|
+
currency: Currency;
|
|
34
|
+
location: Location;
|
|
35
|
+
salePrice?: SalePrice;
|
|
36
|
+
restrictions?: Restrictions;
|
|
37
|
+
/**
|
|
38
|
+
* ID of the price model to which the price should assigned. If the ID is not provided, the default price model is used.
|
|
39
|
+
*/
|
|
40
|
+
priceModelId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Prices for tiers specified in the price model. The prices will be assigned to tiers based on the entered order (the first value will be assigned to the first tier, the second value to second tier).
|
|
43
|
+
*
|
|
44
|
+
* **Note**: If this field does not contain values for all tiers defined in the price model, the endpoint responds with an error.
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
tierValues: Array<TierValueCreation>;
|
|
48
|
+
/**
|
|
49
|
+
* Map of custom price attributes.
|
|
50
|
+
*/
|
|
51
|
+
mixins?: {
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
};
|
|
54
|
+
metadata?: {
|
|
55
|
+
/**
|
|
56
|
+
* Schemas for custom price attributes.
|
|
57
|
+
*/
|
|
58
|
+
mixins?: {
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
type GetPrice = {
|
|
64
|
+
/**
|
|
65
|
+
* A price identifier.
|
|
66
|
+
*/
|
|
67
|
+
id?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Item for which the price is defined.
|
|
70
|
+
*/
|
|
71
|
+
itemId?: {
|
|
72
|
+
/**
|
|
73
|
+
* Type of the referenced item. Possible values:
|
|
74
|
+
* * `PRODUCT`
|
|
75
|
+
* * `SKU`
|
|
76
|
+
*
|
|
77
|
+
* **The `SKU` value is in preview mode** - the system does not fully operate on the SKU concept yet.
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
itemType?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Product's unique identifier, generated when the product is created through the Product Service.
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
id?: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Product's uniform resource name.
|
|
89
|
+
*/
|
|
90
|
+
itemYrn?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Currency code, as defined in the Currency Service.
|
|
93
|
+
*/
|
|
94
|
+
currency?: string;
|
|
95
|
+
location?: Location;
|
|
96
|
+
salePrice?: SalePrice;
|
|
97
|
+
/**
|
|
98
|
+
* ID of the price model to which the price is assigned. If the ID is not provided, the default price model is used.
|
|
99
|
+
*/
|
|
100
|
+
priceModelId?: string;
|
|
101
|
+
restrictions?: Restrictions;
|
|
102
|
+
tierValues?: Array<TierValueRetrieval>;
|
|
103
|
+
/**
|
|
104
|
+
* Id of a vendor to which the price belongs.
|
|
105
|
+
*/
|
|
106
|
+
vendorId?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Custom price attributes.
|
|
109
|
+
*/
|
|
110
|
+
mixins?: {
|
|
111
|
+
[key: string]: unknown;
|
|
112
|
+
};
|
|
113
|
+
metadata?: PriceMetadata;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Schema for API-specific errors.
|
|
117
|
+
*/
|
|
118
|
+
type ErrorMessage = {
|
|
119
|
+
/**
|
|
120
|
+
* Original HTTP error code, should be consistent with the response HTTP code.
|
|
121
|
+
*/
|
|
122
|
+
code?: number;
|
|
123
|
+
/**
|
|
124
|
+
* Original HTTP error reason.
|
|
125
|
+
*/
|
|
126
|
+
status?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Descriptive error message for debugging
|
|
129
|
+
*/
|
|
130
|
+
message?: string;
|
|
131
|
+
/**
|
|
132
|
+
* List of problems causing this error.
|
|
133
|
+
*/
|
|
134
|
+
details?: Array<string>;
|
|
135
|
+
/**
|
|
136
|
+
* Additional error code.
|
|
137
|
+
*/
|
|
138
|
+
errorCode?: string;
|
|
139
|
+
};
|
|
3
140
|
type Metadata = {
|
|
4
141
|
/**
|
|
5
142
|
* Date and time when the price was created.
|
|
@@ -54,6 +191,10 @@ type SalePrice = {
|
|
|
54
191
|
*/
|
|
55
192
|
description?: string;
|
|
56
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* Currency code, compliant with the ISO 4217 standard.
|
|
196
|
+
*/
|
|
197
|
+
type Currency = string;
|
|
57
198
|
type MatchByContext = {
|
|
58
199
|
/**
|
|
59
200
|
* List of items (products or prices) for which the prices should be matched.
|
|
@@ -164,6 +305,19 @@ type Match = {
|
|
|
164
305
|
*/
|
|
165
306
|
legalEntityId?: string;
|
|
166
307
|
};
|
|
308
|
+
/**
|
|
309
|
+
* Date range in which the object is valid.
|
|
310
|
+
*/
|
|
311
|
+
type DateValidity = {
|
|
312
|
+
/**
|
|
313
|
+
* Date from which the object is valid, compliant with the ISO 8601 standard.
|
|
314
|
+
*/
|
|
315
|
+
from?: string;
|
|
316
|
+
/**
|
|
317
|
+
* Date to which the object is valid, compliant with the ISO 8601 standard.
|
|
318
|
+
*/
|
|
319
|
+
to?: string;
|
|
320
|
+
};
|
|
167
321
|
/**
|
|
168
322
|
* Price model holds additional attributes that are extending price. For example it's possible to define a price which will be specific for a given customer or customer group.
|
|
169
323
|
*
|
|
@@ -232,6 +386,181 @@ type PriceModelRetrieval = {
|
|
|
232
386
|
isDefault?: boolean;
|
|
233
387
|
metadata?: Metadata;
|
|
234
388
|
};
|
|
389
|
+
/**
|
|
390
|
+
* Customers or customer groups for whom the price is valid.
|
|
391
|
+
*/
|
|
392
|
+
type Principal = {
|
|
393
|
+
/**
|
|
394
|
+
* Customer or customer group for whom the price is valid. Possible values:
|
|
395
|
+
* * `CUSTOMER`
|
|
396
|
+
* * `GROUP`
|
|
397
|
+
*
|
|
398
|
+
* **The `GROUP` value is in preview mode** - the system does not fully operate on the customer groups concept yet.
|
|
399
|
+
*/
|
|
400
|
+
type: string;
|
|
401
|
+
/**
|
|
402
|
+
* Unique identifier of the customer or customer group.
|
|
403
|
+
*/
|
|
404
|
+
id: string;
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* Restrictions that limit the validity of the price model and prices assigned to it.
|
|
408
|
+
*
|
|
409
|
+
*/
|
|
410
|
+
type Restrictions = {
|
|
411
|
+
/**
|
|
412
|
+
* List of customers and customer groups for whom the price is valid.
|
|
413
|
+
*
|
|
414
|
+
* **The `GROUP` principals are in preview mode** - the system does not fully operate on the customer groups concept yet.
|
|
415
|
+
*/
|
|
416
|
+
principals?: Array<Principal>;
|
|
417
|
+
validity?: DateValidity;
|
|
418
|
+
/**
|
|
419
|
+
* Codes of sites to which the price applies.
|
|
420
|
+
*/
|
|
421
|
+
siteCodes: Array<string>;
|
|
422
|
+
/**
|
|
423
|
+
* Unique identifier of the price list to which the price should be assigned.
|
|
424
|
+
*
|
|
425
|
+
* **The `priceListId` field is in preview mode** - some of the features may not be fully operational yet.
|
|
426
|
+
*/
|
|
427
|
+
priceListId?: string;
|
|
428
|
+
};
|
|
429
|
+
type TierValueCreation = {
|
|
430
|
+
/**
|
|
431
|
+
* An identifier of a tier. The ID is required only if the priceModelId is provided. If the price model is the default, the tier value is automatically assigned according to the default price model.
|
|
432
|
+
*/
|
|
433
|
+
id?: string;
|
|
434
|
+
/**
|
|
435
|
+
* Gross price (if the `includesTax` field is set to `true`) or net price (if the `includesTax` field is set to `false`).
|
|
436
|
+
*
|
|
437
|
+
* This field should contain by a number where the cent part is separated by a dot sign - such as `12.99`.
|
|
438
|
+
*
|
|
439
|
+
* **Note**: The cent part of the price is not limited to two digits. You can specify the price with any precision.
|
|
440
|
+
*/
|
|
441
|
+
priceValue: number;
|
|
442
|
+
};
|
|
443
|
+
type TierValueRetrieval = {
|
|
444
|
+
/**
|
|
445
|
+
* An identifier of a tier. The ID is required only if the `priceModelId` is provided. If the price model is the default, the tier value is automatically assigned according to the default price model.
|
|
446
|
+
*/
|
|
447
|
+
id?: string;
|
|
448
|
+
/**
|
|
449
|
+
* Gross price (if the `includesTax` field is set to `true`) or net price (if the `includesTax` field is set to `false`).
|
|
450
|
+
*/
|
|
451
|
+
priceValue: number;
|
|
452
|
+
};
|
|
453
|
+
/**
|
|
454
|
+
* A price model can be defined as a repeatable way to sell products in a market with the intention of making a profit. Price models define basic structures for prices.
|
|
455
|
+
*/
|
|
456
|
+
type PriceModelDefinitionCreation = {
|
|
457
|
+
/**
|
|
458
|
+
* Custom price model identifier. If not provided, it is automatically generated.
|
|
459
|
+
*/
|
|
460
|
+
id?: string;
|
|
461
|
+
/**
|
|
462
|
+
* Flag indicating whether prices assigned to the price model will be expressed as net or gross.
|
|
463
|
+
*
|
|
464
|
+
* | Value | Description |
|
|
465
|
+
* | --- | --- |
|
|
466
|
+
* | `true` | Prices will be expressed as gross values. |
|
|
467
|
+
* | `false` | Prices will be expressed as net values. |
|
|
468
|
+
*
|
|
469
|
+
*/
|
|
470
|
+
includesTax: boolean;
|
|
471
|
+
/**
|
|
472
|
+
* Flag indicating whether prices assigned to the price model include markup.
|
|
473
|
+
*
|
|
474
|
+
* **The `includesMarkup` field is in preview mode** - some of the features may not be fully operational yet.
|
|
475
|
+
*/
|
|
476
|
+
includesMarkup?: boolean;
|
|
477
|
+
/**
|
|
478
|
+
* Indicates whether the price model is default one or not.
|
|
479
|
+
*/
|
|
480
|
+
default?: boolean;
|
|
481
|
+
/**
|
|
482
|
+
* Price model name. It should be a brief, human-readable name that describes purposes of the model.
|
|
483
|
+
*
|
|
484
|
+
* * If the `Content-Language` header is set to `*`, then the name should be provided as a map of translations, where each key is a language code and the value is the name in its respective language.
|
|
485
|
+
* * If the `Content-Language` header is set to a specific language, the name should be provided as a string.
|
|
486
|
+
* * If the `Content-Language` header is empty, the endpoint will asume that the name is provided in the default language defined in the Configuration Service.
|
|
487
|
+
*
|
|
488
|
+
* **Note**: You can provide the names only in languages defined in the Configuration Service. In case the name is provided in a language that is not defined in the Configuration Service, the request will be rejected.
|
|
489
|
+
*/
|
|
490
|
+
name: {
|
|
491
|
+
[key: string]: unknown;
|
|
492
|
+
} | string;
|
|
493
|
+
/**
|
|
494
|
+
* Price model description. It can contain details about the price model.
|
|
495
|
+
*
|
|
496
|
+
* * If the `Content-Language` header is set to `*`, then the description should be provided as a map of translations, where each key is a language code and the value is the description in its respective language.
|
|
497
|
+
* * If the `Content-Language` header is set to a specific language, the description should be provided as a string.
|
|
498
|
+
* * If the `Content-Language` header is empty, the endpoint will asume that the description is provided in the default language defined in the Configuration Service.
|
|
499
|
+
*
|
|
500
|
+
* **Note**: You can provide the descriptions only in languages defined in the Configuration Service. In case the description is provided in a language that is not defined in the Configuration Service, the request will be rejected.
|
|
501
|
+
*/
|
|
502
|
+
description?: {
|
|
503
|
+
[key: string]: unknown;
|
|
504
|
+
} | string;
|
|
505
|
+
tierDefinition: TierDefinitionCreation & {
|
|
506
|
+
[key: string]: unknown;
|
|
507
|
+
};
|
|
508
|
+
measurementUnit: MeasurementUnit & {
|
|
509
|
+
[key: string]: unknown;
|
|
510
|
+
};
|
|
511
|
+
};
|
|
512
|
+
type TierDefinitionCreation = {
|
|
513
|
+
/**
|
|
514
|
+
* Possible values:
|
|
515
|
+
* * `BASIC`
|
|
516
|
+
* * `VOLUME`
|
|
517
|
+
* * `TIERED`
|
|
518
|
+
*
|
|
519
|
+
* `BASIC`: Used to offer the same price per unit, regardless of the ordered quantity.
|
|
520
|
+
*
|
|
521
|
+
* **Note**: When using basic pricing, you need to define a single tier and set its `minQuantity` field to `0`.
|
|
522
|
+
*
|
|
523
|
+
* `VOLUME`: Used to offer a lower price per unit depending on the total ordered quantity.
|
|
524
|
+
*
|
|
525
|
+
* `TIERED`: Used to offer a lower price per unit based on the tiers that the total ordered quantity falls into.
|
|
526
|
+
*
|
|
527
|
+
* **Example**: You defined three tiers, starting at 5, 10, and 15 pieces respectively. A customer orders 16 pieces. In this pricing model, the first 5 pieces will be priced according to the first tier, the next 5 according to the second tier, and the 16th piece will be priced according to the third tier.
|
|
528
|
+
*/
|
|
529
|
+
tierType: string;
|
|
530
|
+
/**
|
|
531
|
+
* Tier quantities.
|
|
532
|
+
*
|
|
533
|
+
* Each tier contains information about the minimum quantity from which it (and its price) is valid.
|
|
534
|
+
*
|
|
535
|
+
* **Example**: For two tiers with the following `minQuantity` values: 0 pieces and 10 pieces, the effective ranges will be `<0, 9)` and `<10, infinity)`.
|
|
536
|
+
*
|
|
537
|
+
* **Note**: When defining tiers, be aware of the following restrictions to the `PriceModel` object:
|
|
538
|
+
* * For `BASIC` tier type:
|
|
539
|
+
* * Only one tier should be defined. If the tier is not defined, it will be automatically generated.
|
|
540
|
+
* * The tier's `minQuantity.quantity` should be set to `0`.
|
|
541
|
+
* * For `VOLUME` and `TIERED` type:
|
|
542
|
+
* * Each `minQuantity.quantity` field must contain a unique value.
|
|
543
|
+
* * The tiers must be defined in an ascending order based on their `quantity` value.
|
|
544
|
+
* * The `quantity` field in the first tier must be set to `0`.
|
|
545
|
+
* * All `unitCode` fields must contain the same value.
|
|
546
|
+
*/
|
|
547
|
+
tiers?: Array<TierDetailsDefinitionCreation>;
|
|
548
|
+
};
|
|
549
|
+
/**
|
|
550
|
+
* Quantity that indicates the tier's range:
|
|
551
|
+
* * The `minQuantity` of the tier defines the left side of the range (inclusive).
|
|
552
|
+
* * The `minQuantity` of the next tier defines the right side of the range (exclusive).
|
|
553
|
+
*
|
|
554
|
+
*/
|
|
555
|
+
type TierDetailsDefinitionCreation = {
|
|
556
|
+
/**
|
|
557
|
+
* An identifier of the tier. If the value is not provided then it is automatically generated. The id is used during an update operation for recognizing whether a particular tier has been changed, removed or added.
|
|
558
|
+
*/
|
|
559
|
+
id?: string;
|
|
560
|
+
minQuantity: MeasurementUnit & {
|
|
561
|
+
[key: string]: unknown;
|
|
562
|
+
};
|
|
563
|
+
};
|
|
235
564
|
type MatchResponse = {
|
|
236
565
|
/**
|
|
237
566
|
* Price's unique identifier, generated when the price is created.
|
|
@@ -401,6 +730,189 @@ type MatchResponse = {
|
|
|
401
730
|
priceValue?: number;
|
|
402
731
|
}>;
|
|
403
732
|
};
|
|
733
|
+
type Location = {
|
|
734
|
+
/**
|
|
735
|
+
* Code of the country to which the price applies, as defined in the Country Service.
|
|
736
|
+
*/
|
|
737
|
+
countryCode: string;
|
|
738
|
+
};
|
|
739
|
+
type PriceListCore = {
|
|
740
|
+
currency?: Currency;
|
|
741
|
+
/**
|
|
742
|
+
* Codes of countries to which the price list applies, as defined in the Country Service.
|
|
743
|
+
*
|
|
744
|
+
* **Note** If not specified, the price list will be applicable to users from all locations.
|
|
745
|
+
*/
|
|
746
|
+
countries?: Array<string>;
|
|
747
|
+
/**
|
|
748
|
+
* List of the regions to which the price list applies.
|
|
749
|
+
*
|
|
750
|
+
* **Note** If not specified, the price list will be applicable to users from all locations.
|
|
751
|
+
*/
|
|
752
|
+
regions?: Array<string>;
|
|
753
|
+
/**
|
|
754
|
+
* List of customer groups IDs for which the price list is valid. If not specified, the price list is applicable to all customer groups.
|
|
755
|
+
*
|
|
756
|
+
* **Note**: Customer groups cannot be provided if there is a legal entity specified for the price list.
|
|
757
|
+
*
|
|
758
|
+
* **The `customerGroups` field is in preview mode** - the system does not fully operate on the customer groups concept yet.
|
|
759
|
+
*/
|
|
760
|
+
customerGroups?: Array<unknown>;
|
|
761
|
+
/**
|
|
762
|
+
* ID of the legal entity to which the price list applies.
|
|
763
|
+
* **Note**: Price list assigned to legal entity is also applicable for all the subsidiaries.
|
|
764
|
+
*/
|
|
765
|
+
legalEntityId?: string;
|
|
766
|
+
/**
|
|
767
|
+
* Code of the site to which the price list applies.
|
|
768
|
+
*/
|
|
769
|
+
siteCode?: string;
|
|
770
|
+
validity?: DateValidity;
|
|
771
|
+
/**
|
|
772
|
+
* Map of custom price lists attributes.
|
|
773
|
+
*
|
|
774
|
+
*/
|
|
775
|
+
mixins?: {
|
|
776
|
+
[key: string]: unknown;
|
|
777
|
+
};
|
|
778
|
+
};
|
|
779
|
+
type PriceListCreation = {
|
|
780
|
+
/**
|
|
781
|
+
* Custom price list identifier. If not provided, it is automatically generated.
|
|
782
|
+
*/
|
|
783
|
+
id?: string;
|
|
784
|
+
/**
|
|
785
|
+
* Price list name. It should be a brief, human-readable name that describes the purpose of the price list, specified in a form of a map of translations.
|
|
786
|
+
*
|
|
787
|
+
* * If the `Content-Language` header is set to `*`, then the name should be provided as a map of translations, where each key is a language code and the value is the name in its respective language.
|
|
788
|
+
* * If the `Content-Language` header is set to a specific language, then the name should be provided as a map of single translation, where the key is a language code and the value is the name in its respective language.
|
|
789
|
+
* * If the `Content-Language` header is empty, then the name should be provided as a map of single translation, where the key is a language code and the value is the name in its respective language. The endpoint will asume that the name is provided in the default language defined in the Configuration Service.
|
|
790
|
+
*
|
|
791
|
+
* **Note**: You can provide the names only in languages defined in the Configuration Service. In case the name is provided in a language that is not defined in the Configuration Service, the request will be rejected.
|
|
792
|
+
*/
|
|
793
|
+
name: {
|
|
794
|
+
[key: string]: unknown;
|
|
795
|
+
};
|
|
796
|
+
} & PriceListCore & {
|
|
797
|
+
metadata?: {
|
|
798
|
+
/**
|
|
799
|
+
* Mixins schemas
|
|
800
|
+
*/
|
|
801
|
+
mixins?: {
|
|
802
|
+
[key: string]: string;
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
type PriceListUpdate = PriceListCreation & {
|
|
807
|
+
metadata?: {
|
|
808
|
+
/**
|
|
809
|
+
* Current version of the object.
|
|
810
|
+
*/
|
|
811
|
+
version?: number;
|
|
812
|
+
/**
|
|
813
|
+
* Mixins schemas.
|
|
814
|
+
*/
|
|
815
|
+
mixins?: {
|
|
816
|
+
[key: string]: string;
|
|
817
|
+
};
|
|
818
|
+
};
|
|
819
|
+
};
|
|
820
|
+
type PriceList$1 = {
|
|
821
|
+
/**
|
|
822
|
+
* Unique identifier of the price that belongs to a price list, generated when the price is created and added to the price list.
|
|
823
|
+
*/
|
|
824
|
+
id?: string;
|
|
825
|
+
/**
|
|
826
|
+
* Price list's name, expressed as a map of translations.
|
|
827
|
+
*/
|
|
828
|
+
name?: {
|
|
829
|
+
[key: string]: unknown;
|
|
830
|
+
};
|
|
831
|
+
} & PriceListCore & {
|
|
832
|
+
metadata?: Metadata & {
|
|
833
|
+
/**
|
|
834
|
+
* Mixins schemas
|
|
835
|
+
*/
|
|
836
|
+
mixins?: {
|
|
837
|
+
[key: string]: string;
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
};
|
|
841
|
+
type PriceListPriceCore = {
|
|
842
|
+
/**
|
|
843
|
+
* Item for which the price is defined.
|
|
844
|
+
*/
|
|
845
|
+
itemId?: {
|
|
846
|
+
/**
|
|
847
|
+
* Type of the referenced item. Possible values:
|
|
848
|
+
* * `PRODUCT`
|
|
849
|
+
* * `SKU`
|
|
850
|
+
*
|
|
851
|
+
* **The `SKU` value is in preview mode** - the system does not fully operate on the SKU concept yet.
|
|
852
|
+
*
|
|
853
|
+
*/
|
|
854
|
+
itemType?: string;
|
|
855
|
+
/**
|
|
856
|
+
* Product's unique identifier, generated when the product is created through the Product Service.
|
|
857
|
+
*
|
|
858
|
+
*/
|
|
859
|
+
id?: string;
|
|
860
|
+
};
|
|
861
|
+
/**
|
|
862
|
+
* ID of the price model to which the price is assigned. If the ID is not provided, the default price model is used.
|
|
863
|
+
*/
|
|
864
|
+
priceModelId?: string;
|
|
865
|
+
tierValues?: Array<TierValueCreation & {
|
|
866
|
+
/**
|
|
867
|
+
* This field should contain a net price given by a number where the cent part is separated by a dot sign - such as `12.99`.
|
|
868
|
+
*
|
|
869
|
+
* **Note**: The cent part of the price is not limited to two digits. You can specify the price with any precision.
|
|
870
|
+
*/
|
|
871
|
+
priceValue?: number;
|
|
872
|
+
}>;
|
|
873
|
+
};
|
|
874
|
+
type PriceListPriceCreation = PriceListPriceCore & {
|
|
875
|
+
/**
|
|
876
|
+
* Custom price identifier. If not provided, it is automatically generated.
|
|
877
|
+
*/
|
|
878
|
+
id?: string;
|
|
879
|
+
itemId: {
|
|
880
|
+
[key: string]: unknown;
|
|
881
|
+
};
|
|
882
|
+
};
|
|
883
|
+
type PriceListPriceUpdate = {
|
|
884
|
+
/**
|
|
885
|
+
* Unique identifier of the price that belongs to a price list, generated when the price is created and added to the price list.
|
|
886
|
+
*/
|
|
887
|
+
id: string;
|
|
888
|
+
} & PriceListPriceCore & {
|
|
889
|
+
metadata: {
|
|
890
|
+
/**
|
|
891
|
+
* Current version of the object.
|
|
892
|
+
*/
|
|
893
|
+
version: number;
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
type PriceListPrice$1 = {
|
|
897
|
+
/**
|
|
898
|
+
* Unique identifier of the price that belongs to a price list, generated when the price is created and added to the price list.
|
|
899
|
+
*/
|
|
900
|
+
id?: string;
|
|
901
|
+
} & PriceListPriceCore & {
|
|
902
|
+
metadata?: Metadata;
|
|
903
|
+
};
|
|
904
|
+
type PriceBulkResponseEntry = {
|
|
905
|
+
index?: number;
|
|
906
|
+
id?: string;
|
|
907
|
+
} & ErrorMessage;
|
|
908
|
+
type PriceMetadata = Metadata & {
|
|
909
|
+
/**
|
|
910
|
+
* Mixins schemas
|
|
911
|
+
*/
|
|
912
|
+
mixins?: {
|
|
913
|
+
[key: string]: unknown;
|
|
914
|
+
};
|
|
915
|
+
};
|
|
404
916
|
|
|
405
917
|
/** Session-context match request body (generated). */
|
|
406
918
|
type PriceMatchByContextInput = MatchByContext;
|
|
@@ -438,6 +950,28 @@ interface MatchByContextChunkedOptions {
|
|
|
438
950
|
/** When true, the first failing chunk rejects the whole call. Default false. */
|
|
439
951
|
throwOnAnyChunkError?: boolean;
|
|
440
952
|
}
|
|
953
|
+
/** A resolved/stored price (generated read shape). */
|
|
954
|
+
type Price = GetPrice;
|
|
955
|
+
/** Create/upsert body for a flat price (generated). */
|
|
956
|
+
type PriceCreateInput = CreatePrice;
|
|
957
|
+
/** A price model (read). */
|
|
958
|
+
type PriceModel = PriceModelRetrieval;
|
|
959
|
+
/** Create/upsert body for a price model (generated). */
|
|
960
|
+
type PriceModelInput = PriceModelDefinitionCreation;
|
|
961
|
+
/** A price list (read). */
|
|
962
|
+
type PriceList = PriceList$1;
|
|
963
|
+
/** Create body for a price list (generated). */
|
|
964
|
+
type PriceListInput = PriceListCreation;
|
|
965
|
+
/** Upsert body for a price list (generated). */
|
|
966
|
+
type PriceListUpdateInput = PriceListUpdate;
|
|
967
|
+
/** A price inside a price list (read). */
|
|
968
|
+
type PriceListPrice = PriceListPrice$1;
|
|
969
|
+
/** Add body for a price-list price (generated). */
|
|
970
|
+
type PriceListPriceInput = PriceListPriceCreation;
|
|
971
|
+
/** Upsert body for a price-list price (generated). */
|
|
972
|
+
type PriceListPriceUpdateInput = PriceListPriceUpdate;
|
|
973
|
+
/** Per-entry result of a bulk price operation (generated). */
|
|
974
|
+
type PriceBulkResult = PriceBulkResponseEntry;
|
|
441
975
|
/**
|
|
442
976
|
* Price matching. The Cart service does not resolve prices — call this
|
|
443
977
|
* explicitly before rendering money and again right before placing an order.
|
|
@@ -472,6 +1006,48 @@ declare class PriceService {
|
|
|
472
1006
|
* `priceId` / `itemId.id`.
|
|
473
1007
|
*/
|
|
474
1008
|
matchByContextChunked(input: PriceMatchByContextInput, opts?: MatchByContextChunkedOptions, auth?: AuthContext): Promise<PriceMatch[]>;
|
|
1009
|
+
/** Creates a flat price. Default auth: service. */
|
|
1010
|
+
create(input: PriceCreateInput, authCtx?: AuthContext): Promise<Price>;
|
|
1011
|
+
/** Lists flat prices. Default auth: service. */
|
|
1012
|
+
list(query?: Record<string, string | number>, authCtx?: AuthContext): Promise<Price[]>;
|
|
1013
|
+
/** Retrieves one flat price by id. Default auth: service. */
|
|
1014
|
+
get(priceId: string, authCtx?: AuthContext): Promise<Price>;
|
|
1015
|
+
/** Upserts a flat price by id (PUT). Default auth: service. */
|
|
1016
|
+
upsert(priceId: string, input: PriceCreateInput, authCtx?: AuthContext): Promise<Price>;
|
|
1017
|
+
/** Deletes a flat price by id. Default auth: service. */
|
|
1018
|
+
delete(priceId: string, authCtx?: AuthContext): Promise<void>;
|
|
1019
|
+
/** Searches flat prices (POST body query). Default auth: service. */
|
|
1020
|
+
search(query: Record<string, unknown>, authCtx?: AuthContext): Promise<Price[]>;
|
|
1021
|
+
/** Creates multiple flat prices in one request. Default auth: service. */
|
|
1022
|
+
bulkCreate(inputs: PriceCreateInput[], authCtx?: AuthContext): Promise<PriceBulkResult[]>;
|
|
1023
|
+
/** Upserts multiple flat prices in one request (PUT). Default auth: service. */
|
|
1024
|
+
bulkUpsert(inputs: PriceCreateInput[], authCtx?: AuthContext): Promise<PriceBulkResult[]>;
|
|
1025
|
+
/** Price-model admin CRUD (`/priceModels`). Default auth: service. */
|
|
1026
|
+
readonly models: {
|
|
1027
|
+
list: (query?: Record<string, string | number>, authCtx?: AuthContext) => Promise<PriceModel[]>;
|
|
1028
|
+
create: (input: PriceModelInput, authCtx?: AuthContext) => Promise<PriceModel>;
|
|
1029
|
+
get: (modelId: string, authCtx?: AuthContext) => Promise<PriceModel>;
|
|
1030
|
+
upsert: (modelId: string, input: PriceModelInput, authCtx?: AuthContext) => Promise<PriceModel>;
|
|
1031
|
+
delete: (modelId: string, authCtx?: AuthContext) => Promise<void>;
|
|
1032
|
+
};
|
|
1033
|
+
/** Price-list admin CRUD (`/price-lists`) + nested price management. Default auth: service. */
|
|
1034
|
+
readonly lists: {
|
|
1035
|
+
list: (query?: Record<string, string | number>, authCtx?: AuthContext) => Promise<PriceList[]>;
|
|
1036
|
+
create: (input: PriceListInput, authCtx?: AuthContext) => Promise<PriceList>;
|
|
1037
|
+
search: (query: Record<string, unknown>, authCtx?: AuthContext) => Promise<PriceList[]>;
|
|
1038
|
+
get: (listId: string, authCtx?: AuthContext) => Promise<PriceList>;
|
|
1039
|
+
upsert: (listId: string, input: PriceListUpdateInput, authCtx?: AuthContext) => Promise<PriceList>;
|
|
1040
|
+
delete: (listId: string, authCtx?: AuthContext) => Promise<void>;
|
|
1041
|
+
listPrices: (listId: string, query?: Record<string, string | number>, authCtx?: AuthContext) => Promise<PriceListPrice[]>;
|
|
1042
|
+
addPrice: (listId: string, input: PriceListPriceInput, authCtx?: AuthContext) => Promise<PriceListPrice>;
|
|
1043
|
+
getPrice: (listId: string, priceId: string, authCtx?: AuthContext) => Promise<PriceListPrice>;
|
|
1044
|
+
upsertPrice: (listId: string, priceId: string, input: PriceListPriceUpdateInput, authCtx?: AuthContext) => Promise<PriceListPrice>;
|
|
1045
|
+
deletePrice: (listId: string, priceId: string, authCtx?: AuthContext) => Promise<void>;
|
|
1046
|
+
searchPrices: (listId: string, query: Record<string, unknown>, authCtx?: AuthContext) => Promise<PriceListPrice[]>;
|
|
1047
|
+
bulkCreatePrices: (listId: string, inputs: PriceListPriceInput[], authCtx?: AuthContext) => Promise<PriceBulkResult[]>;
|
|
1048
|
+
bulkUpsertPrices: (listId: string, inputs: PriceListPriceInput[], authCtx?: AuthContext) => Promise<PriceBulkResult[]>;
|
|
1049
|
+
bulkDeletePrices: (listId: string, body: Record<string, unknown>, authCtx?: AuthContext) => Promise<PriceBulkResult[]>;
|
|
1050
|
+
};
|
|
475
1051
|
}
|
|
476
1052
|
|
|
477
|
-
export { type MatchByContextChunkedOptions, type PriceMatch, type PriceMatchByContextInput, type PriceMatchInput, type PriceMatchItemRef, PriceService };
|
|
1053
|
+
export { type MatchByContextChunkedOptions, type Price, type PriceBulkResult, type PriceCreateInput, type PriceList, type PriceListInput, type PriceListPrice, type PriceListPriceInput, type PriceListPriceUpdateInput, type PriceListUpdateInput, type PriceMatch, type PriceMatchByContextInput, type PriceMatchInput, type PriceMatchItemRef, type PriceModel, type PriceModelInput, PriceService };
|
package/dist/price.js
CHANGED