oneentry 1.0.159 → 1.0.161
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/README.md +2 -0
- package/changelog.md +56 -1
- package/dist/admins/adminsApi.d.ts +15 -1
- package/dist/admins/adminsApi.js +29 -0
- package/dist/admins/adminsInterfaces.d.ts +37 -1
- package/dist/base/lazySchema.d.ts +15 -0
- package/dist/base/lazySchema.js +20 -0
- package/dist/discounts/discountsApi.d.ts +14 -1
- package/dist/discounts/discountsApi.js +21 -0
- package/dist/discounts/discountsInterfaces.d.ts +27 -1
- package/dist/filters/filtersInterfaces.d.ts +2 -2
- package/dist/filters/filtersSchemas.d.ts +1 -1
- package/dist/filters/filtersSchemas.js +4 -1
- package/dist/forms-data/formsDataApi.d.ts +14 -1
- package/dist/forms-data/formsDataApi.js +21 -0
- package/dist/forms-data/formsDataInterfaces.d.ts +74 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/orders/ordersApi.d.ts +15 -1
- package/dist/orders/ordersApi.js +22 -0
- package/dist/orders/ordersInterfaces.d.ts +27 -1
- package/dist/pages/pagesApi.d.ts +14 -1
- package/dist/pages/pagesApi.js +21 -0
- package/dist/pages/pagesInterfaces.d.ts +38 -1
- package/dist/payments/paymentsInterfaces.d.ts +2 -2
- package/dist/products/productsInterfaces.d.ts +1 -1
- package/dist/search/searchApi.d.ts +35 -0
- package/dist/search/searchApi.js +86 -0
- package/dist/search/searchInterfaces.d.ts +94 -0
- package/dist/search/searchInterfaces.js +2 -0
- package/dist/search/searchSchemas.d.ts +73 -0
- package/dist/search/searchSchemas.js +44 -0
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +0 -2
- package/dist/templates-preview/templatesPreviewSchemas.d.ts +0 -2
- package/dist/templates-preview/templatesPreviewSchemas.js +0 -1
- package/dist/types.d.ts +35 -0
- package/dist/types.js +2 -0
- package/dist/users/usersApi.d.ts +15 -1
- package/dist/users/usersApi.js +22 -0
- package/dist/users/usersInterfaces.d.ts +39 -1
- package/dist/web-socket/lazySocket.d.ts +18 -0
- package/dist/web-socket/lazySocket.js +70 -0
- package/esm/admins/adminsApi.d.ts +66 -0
- package/esm/admins/adminsApi.js +90 -0
- package/esm/admins/adminsInterfaces.d.ts +137 -0
- package/esm/admins/adminsInterfaces.js +1 -0
- package/esm/admins/adminsSchemas.d.ts +48 -0
- package/esm/admins/adminsSchemas.js +31 -0
- package/esm/attribute-sets/attributeSetsApi.d.ts +67 -0
- package/esm/attribute-sets/attributeSetsApi.js +97 -0
- package/esm/attribute-sets/attributeSetsInterfaces.d.ts +285 -0
- package/esm/attribute-sets/attributeSetsInterfaces.js +1 -0
- package/esm/attribute-sets/attributeSetsSchemas.d.ts +84 -0
- package/esm/attribute-sets/attributeSetsSchemas.js +66 -0
- package/esm/auth-provider/authProviderApi.d.ts +262 -0
- package/esm/auth-provider/authProviderApi.js +362 -0
- package/esm/auth-provider/authProviderSchemas.d.ts +124 -0
- package/esm/auth-provider/authProviderSchemas.js +92 -0
- package/esm/auth-provider/authProvidersInterfaces.d.ts +430 -0
- package/esm/auth-provider/authProvidersInterfaces.js +1 -0
- package/esm/base/asyncModules.d.ts +123 -0
- package/esm/base/asyncModules.js +382 -0
- package/esm/base/lazySchema.d.ts +15 -0
- package/esm/base/lazySchema.js +17 -0
- package/esm/base/stateModule.d.ts +35 -0
- package/esm/base/stateModule.js +51 -0
- package/esm/base/syncModules.d.ts +245 -0
- package/esm/base/syncModules.js +555 -0
- package/esm/base/timeIntervals.d.ts +95 -0
- package/esm/base/timeIntervals.js +317 -0
- package/esm/base/utils.d.ts +354 -0
- package/esm/base/utils.js +1 -0
- package/esm/base/validation.d.ts +98 -0
- package/esm/base/validation.js +118 -0
- package/esm/blocks/blocksApi.d.ts +252 -0
- package/esm/blocks/blocksApi.js +394 -0
- package/esm/blocks/blocksInterfaces.d.ts +361 -0
- package/esm/blocks/blocksInterfaces.js +1 -0
- package/esm/blocks/blocksSchemas.d.ts +213 -0
- package/esm/blocks/blocksSchemas.js +40 -0
- package/esm/discounts/discountsApi.d.ts +94 -0
- package/esm/discounts/discountsApi.js +136 -0
- package/esm/discounts/discountsInterfaces.d.ts +293 -0
- package/esm/discounts/discountsInterfaces.js +1 -0
- package/esm/events/eventsApi.d.ts +108 -0
- package/esm/events/eventsApi.js +141 -0
- package/esm/events/eventsInterfaces.d.ts +176 -0
- package/esm/events/eventsInterfaces.js +1 -0
- package/esm/file-uploading/fileUploadingApi.d.ts +91 -0
- package/esm/file-uploading/fileUploadingApi.js +127 -0
- package/esm/file-uploading/fileUploadingInterfaces.d.ts +116 -0
- package/esm/file-uploading/fileUploadingInterfaces.js +1 -0
- package/esm/file-uploading/fileUploadingSchemas.d.ts +24 -0
- package/esm/file-uploading/fileUploadingSchemas.js +19 -0
- package/esm/filters/filtersApi.d.ts +32 -0
- package/esm/filters/filtersApi.js +36 -0
- package/esm/filters/filtersInterfaces.d.ts +56 -0
- package/esm/filters/filtersInterfaces.js +1 -0
- package/esm/filters/filtersSchemas.d.ts +32 -0
- package/esm/filters/filtersSchemas.js +29 -0
- package/esm/forms/formsApi.d.ts +44 -0
- package/esm/forms/formsApi.js +54 -0
- package/esm/forms/formsInterfaces.d.ts +237 -0
- package/esm/forms/formsInterfaces.js +1 -0
- package/esm/forms/formsSchemas.d.ts +56 -0
- package/esm/forms/formsSchemas.js +32 -0
- package/esm/forms-data/formsDataApi.d.ts +124 -0
- package/esm/forms-data/formsDataApi.js +210 -0
- package/esm/forms-data/formsDataInterfaces.d.ts +670 -0
- package/esm/forms-data/formsDataInterfaces.js +1 -0
- package/esm/forms-data/formsDataSchemas.d.ts +107 -0
- package/esm/forms-data/formsDataSchemas.js +83 -0
- package/esm/general-types/generalTypesApi.d.ts +29 -0
- package/esm/general-types/generalTypesApi.js +34 -0
- package/esm/general-types/generalTypesInterfaces.d.ts +29 -0
- package/esm/general-types/generalTypesInterfaces.js +1 -0
- package/esm/general-types/generalTypesSchemas.d.ts +68 -0
- package/esm/general-types/generalTypesSchemas.js +42 -0
- package/esm/index.d.ts +143 -0
- package/esm/index.js +124 -0
- package/esm/integration-collections/integrationCollectionsApi.d.ts +172 -0
- package/esm/integration-collections/integrationCollectionsApi.js +224 -0
- package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +317 -0
- package/esm/integration-collections/integrationCollectionsInterfaces.js +1 -0
- package/esm/integration-collections/integrationCollectionsSchemas.d.ts +84 -0
- package/esm/integration-collections/integrationCollectionsSchemas.js +60 -0
- package/esm/locales/localesApi.d.ts +28 -0
- package/esm/locales/localesApi.js +33 -0
- package/esm/locales/localesInterfaces.d.ts +40 -0
- package/esm/locales/localesInterfaces.js +1 -0
- package/esm/locales/localesSchemas.d.ts +32 -0
- package/esm/locales/localesSchemas.js +23 -0
- package/esm/menus/menusApi.d.ts +30 -0
- package/esm/menus/menusApi.js +35 -0
- package/esm/menus/menusInterfaces.d.ts +87 -0
- package/esm/menus/menusInterfaces.js +2 -0
- package/esm/menus/menusSchemas.d.ts +16 -0
- package/esm/menus/menusSchemas.js +25 -0
- package/esm/orders/ordersApi.d.ts +213 -0
- package/esm/orders/ordersApi.js +288 -0
- package/esm/orders/ordersInterfaces.d.ts +763 -0
- package/esm/orders/ordersInterfaces.js +1 -0
- package/esm/orders/ordersSchemas.d.ts +312 -0
- package/esm/orders/ordersSchemas.js +171 -0
- package/esm/package.json +4 -0
- package/esm/pages/pagesApi.d.ts +173 -0
- package/esm/pages/pagesApi.js +414 -0
- package/esm/pages/pagesInterfaces.d.ts +344 -0
- package/esm/pages/pagesInterfaces.js +1 -0
- package/esm/pages/pagesSchemas.d.ts +121 -0
- package/esm/pages/pagesSchemas.js +60 -0
- package/esm/payments/paymentsApi.d.ts +88 -0
- package/esm/payments/paymentsApi.js +122 -0
- package/esm/payments/paymentsInterfaces.d.ts +189 -0
- package/esm/payments/paymentsInterfaces.js +1 -0
- package/esm/payments/paymentsSchemas.d.ts +94 -0
- package/esm/payments/paymentsSchemas.js +53 -0
- package/esm/product-statuses/productStatusesApi.d.ts +50 -0
- package/esm/product-statuses/productStatusesApi.js +68 -0
- package/esm/product-statuses/productStatusesInterfaces.d.ts +62 -0
- package/esm/product-statuses/productStatusesInterfaces.js +1 -0
- package/esm/product-statuses/productStatusesSchemas.d.ts +34 -0
- package/esm/product-statuses/productStatusesSchemas.js +27 -0
- package/esm/products/productsApi.d.ts +366 -0
- package/esm/products/productsApi.js +468 -0
- package/esm/products/productsInterfaces.d.ts +723 -0
- package/esm/products/productsInterfaces.js +1 -0
- package/esm/products/productsSchemas.d.ts +234 -0
- package/esm/products/productsSchemas.js +121 -0
- package/esm/search/searchApi.d.ts +35 -0
- package/esm/search/searchApi.js +47 -0
- package/esm/search/searchInterfaces.d.ts +94 -0
- package/esm/search/searchInterfaces.js +1 -0
- package/esm/search/searchSchemas.d.ts +73 -0
- package/esm/search/searchSchemas.js +41 -0
- package/esm/sitemap/sitemapApi.d.ts +37 -0
- package/esm/sitemap/sitemapApi.js +41 -0
- package/esm/sitemap/sitemapInterfaces.d.ts +51 -0
- package/esm/sitemap/sitemapInterfaces.js +1 -0
- package/esm/subscriptions/subscriptionsApi.d.ts +74 -0
- package/esm/subscriptions/subscriptionsApi.js +90 -0
- package/esm/subscriptions/subscriptionsInterfaces.d.ts +111 -0
- package/esm/subscriptions/subscriptionsInterfaces.js +1 -0
- package/esm/subscriptions/subscriptionsSchemas.d.ts +46 -0
- package/esm/subscriptions/subscriptionsSchemas.js +38 -0
- package/esm/system/systemApi.d.ts +46 -0
- package/esm/system/systemApi.js +53 -0
- package/esm/system/systemInterfaces.d.ts +29 -0
- package/esm/system/systemInterfaces.js +1 -0
- package/esm/templates/templatesApi.d.ts +53 -0
- package/esm/templates/templatesApi.js +78 -0
- package/esm/templates/templatesInterfaces.d.ts +68 -0
- package/esm/templates/templatesInterfaces.js +1 -0
- package/esm/templates/templatesSchemas.d.ts +48 -0
- package/esm/templates/templatesSchemas.js +28 -0
- package/esm/templates-preview/templatesPreviewApi.d.ts +40 -0
- package/esm/templates-preview/templatesPreviewApi.js +50 -0
- package/esm/templates-preview/templatesPreviewInterfaces.d.ts +129 -0
- package/esm/templates-preview/templatesPreviewInterfaces.js +1 -0
- package/esm/templates-preview/templatesPreviewSchemas.d.ts +79 -0
- package/esm/templates-preview/templatesPreviewSchemas.js +43 -0
- package/esm/types.d.ts +35 -0
- package/esm/types.js +1 -0
- package/esm/user-activity/userActivityApi.d.ts +31 -0
- package/esm/user-activity/userActivityApi.js +37 -0
- package/esm/user-activity/userActivityInterfaces.d.ts +42 -0
- package/esm/user-activity/userActivityInterfaces.js +1 -0
- package/esm/users/usersApi.d.ts +249 -0
- package/esm/users/usersApi.js +312 -0
- package/esm/users/usersInterfaces.d.ts +419 -0
- package/esm/users/usersInterfaces.js +1 -0
- package/esm/users/usersSchemas.d.ts +72 -0
- package/esm/users/usersSchemas.js +55 -0
- package/esm/web-socket/lazySocket.d.ts +18 -0
- package/esm/web-socket/lazySocket.js +67 -0
- package/esm/web-socket/wsApi.d.ts +27 -0
- package/esm/web-socket/wsApi.js +43 -0
- package/esm/web-socket/wsInterfaces.d.ts +16 -0
- package/esm/web-socket/wsInterfaces.js +1 -0
- package/package.json +47 -2
- package/types.d.ts +1 -0
- package/types.js +1 -0
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
import type { IError, ILocalizeInfo } from '../base/utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* @interface IOrdersApi
|
|
4
|
+
* @description Represents the API for managing orders in the order storage.
|
|
5
|
+
*/
|
|
6
|
+
interface IOrdersApi {
|
|
7
|
+
/**
|
|
8
|
+
* Getting all the order storage objects.
|
|
9
|
+
* @handleName getAllOrdersStorage
|
|
10
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
11
|
+
* @param {number} [offset] - Optional parameter for pagination. Default: 0.
|
|
12
|
+
* @param {number} [limit] - Optional parameter for pagination. Default: 30.
|
|
13
|
+
* @returns {Promise<IOrdersEntity[] | IError>} Returns an array of order storage objects.
|
|
14
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
15
|
+
* @description This method gets all the order storage objects. This method requires user authorization.
|
|
16
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
17
|
+
*/
|
|
18
|
+
getAllOrdersStorage(langCode?: string, offset?: number, limit?: number): Promise<IOrdersEntity[] | IError>;
|
|
19
|
+
/**
|
|
20
|
+
* Getting all orders from the orders storage object created by the user.
|
|
21
|
+
* @handleName getAllOrdersByMarker
|
|
22
|
+
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
23
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
24
|
+
* @param {number} [offset] - Offset parameter. Default: 0.
|
|
25
|
+
* @param {number} [limit] - Limit parameter. Default: 30.
|
|
26
|
+
* @returns {Promise<IOrdersByMarkerEntity | IError>} Returns an object with the orders.
|
|
27
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
28
|
+
* @description This method gets all orders from the orders storage object created by the user. This method requires user authorization.
|
|
29
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
30
|
+
*/
|
|
31
|
+
getAllOrdersByMarker(marker: string, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve one order storage object by marker.
|
|
34
|
+
* @handleName getOrdersStorageByMarker
|
|
35
|
+
* @param {string} marker - Marker of the order object. Example: "order_storage_1".
|
|
36
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
37
|
+
* @returns {Promise<IOrdersEntity | IError>} Return object of order information.
|
|
38
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
39
|
+
* @description This method retrieves one order storage object by marker. This method requires user authorization.
|
|
40
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
41
|
+
*/
|
|
42
|
+
getOrdersStorageByMarker(marker: string, langCode?: string): Promise<IOrdersEntity | IError>;
|
|
43
|
+
/**
|
|
44
|
+
* Getting a single order from the order storage object created by the user.
|
|
45
|
+
* @handleName getOrderByMarkerAndId
|
|
46
|
+
* @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
|
|
47
|
+
* @param {number} id - ID of the order object. Example: 12345.
|
|
48
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
49
|
+
* @returns {Promise<IOrderByMarkerEntity | IError>} Returns an object with the order.
|
|
50
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
51
|
+
* @description This method gets a single order from the order storage object created by the user. This method requires user authorization.
|
|
52
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
53
|
+
*/
|
|
54
|
+
getOrderByMarkerAndId(marker: string, id: number, langCode?: string): Promise<IOrderByMarkerEntity | IError>;
|
|
55
|
+
/**
|
|
56
|
+
* Creation of an order in the order storage.
|
|
57
|
+
* @handleName createOrder
|
|
58
|
+
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
59
|
+
* @param {IOrderData} body - Object for creating an order.
|
|
60
|
+
* @example
|
|
61
|
+
{
|
|
62
|
+
"formIdentifier": "bar-orders-form",
|
|
63
|
+
"paymentAccountIdentifier": "usd-payment",
|
|
64
|
+
"formData": {
|
|
65
|
+
"marker": "name_1",
|
|
66
|
+
"value": "Name",
|
|
67
|
+
"type": "string"
|
|
68
|
+
},
|
|
69
|
+
"products": [
|
|
70
|
+
{
|
|
71
|
+
"productId": 1,
|
|
72
|
+
"quantity": 2
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
77
|
+
* @returns {Promise<IBaseOrdersEntity | IError>} Returns an object with the created order.
|
|
78
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
79
|
+
* @description This method requires user authorization.
|
|
80
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
81
|
+
*/
|
|
82
|
+
createOrder(marker: string, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
|
|
83
|
+
/**
|
|
84
|
+
* Changing an order in the orders storage
|
|
85
|
+
* @handleName updateOrderByMarkerAndId
|
|
86
|
+
* @param {string} marker - The text identifier of the order storage object. Example: "order_storage_1".
|
|
87
|
+
* @param {number} id - ID of the order object. Example: 12345.
|
|
88
|
+
* @param {IOrderData} body - Object for updating an order.
|
|
89
|
+
* @example
|
|
90
|
+
{
|
|
91
|
+
"formIdentifier": "bar-orders-form",
|
|
92
|
+
"paymentAccountIdentifier": "usd-payment",
|
|
93
|
+
"formData": {
|
|
94
|
+
"marker": "name_1",
|
|
95
|
+
"value": "Name",
|
|
96
|
+
"type": "string"
|
|
97
|
+
},
|
|
98
|
+
"products": [
|
|
99
|
+
{
|
|
100
|
+
"productId": 1,
|
|
101
|
+
"quantity": 2
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"currency": "USD"
|
|
105
|
+
}
|
|
106
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
107
|
+
* @returns {Promise<IBaseOrdersEntity | IError>} Returns an object with the updated order.
|
|
108
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
109
|
+
* @description This method requires user authorization.
|
|
110
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
111
|
+
*/
|
|
112
|
+
updateOrderByMarkerAndId(marker: string, id: number, body: IOrderData, langCode?: string): Promise<IBaseOrdersEntity | IError>;
|
|
113
|
+
/**
|
|
114
|
+
* Preview order calculation with discounts and coupons (without saving).
|
|
115
|
+
* @handleName previewOrder
|
|
116
|
+
* @param {ICreateOrderPreview} body - Order preview body.
|
|
117
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
118
|
+
* @returns {Promise<IOrderPreviewResponse | IError>} Returns an object with the order preview.
|
|
119
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
120
|
+
* @description This method requires user authorization ???.
|
|
121
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
122
|
+
*/
|
|
123
|
+
previewOrder(body: ICreateOrderPreview, langCode?: string): Promise<IOrderPreviewResponse | IError>;
|
|
124
|
+
/**
|
|
125
|
+
* Get all orders statuses by Storage marker
|
|
126
|
+
* @handleName getAllStatusesByStorageMarker
|
|
127
|
+
* @param {string} marker - Textual identifier of the order storage object. Example: "order_storage_1".
|
|
128
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
129
|
+
* @param {number} [offset] - Offset parameter. Default: 0.
|
|
130
|
+
* @param {number} [limit] - Limit parameter. Default: 30.
|
|
131
|
+
* @returns {Promise<IOrderStatus[] | IError>} Returns an object with the orders statuses.
|
|
132
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
133
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
134
|
+
*/
|
|
135
|
+
getAllStatusesByStorageMarker(marker: string, langCode: string, offset?: number, limit?: number): Promise<IOrderStatus[] | IError>;
|
|
136
|
+
/**
|
|
137
|
+
* Get all refund requests for an order.
|
|
138
|
+
* @handleName getOrderRefunds
|
|
139
|
+
* @param {number} id - Order id.
|
|
140
|
+
* @returns {Promise<IRefundRequest[] | IError>} Returns array of refund requests.
|
|
141
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
142
|
+
*/
|
|
143
|
+
getRefunds(id: number): Promise<IRefundRequest[] | IError>;
|
|
144
|
+
/**
|
|
145
|
+
* Create a refund request for an order.
|
|
146
|
+
* @handleName createRefundRequest
|
|
147
|
+
* @param {number} id - Order id.
|
|
148
|
+
* @param {ICreateRefundRequest} body - Refund request body.
|
|
149
|
+
* @returns {Promise<boolean | IError>} Returns true if the refund request was created successfully.
|
|
150
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
151
|
+
*/
|
|
152
|
+
createRefundRequest(id: number, body: ICreateRefundRequest): Promise<boolean | IError>;
|
|
153
|
+
/**
|
|
154
|
+
* Cancel a refund request for an order.
|
|
155
|
+
* @handleName cancelRefundRequest
|
|
156
|
+
* @param {number} id - Order id.
|
|
157
|
+
* @returns {Promise<boolean | IError>} Returns order entity.
|
|
158
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
159
|
+
*/
|
|
160
|
+
cancelRefundRequest(id: number): Promise<boolean | IError>;
|
|
161
|
+
/**
|
|
162
|
+
* Semantic (vector) search for the current user's orders.
|
|
163
|
+
* @handleName getOrdersByVectorSearch
|
|
164
|
+
* @param {IOrdersVectorSearch} body - Vector search body. Example: `{ queryText: "winter jacket" }`.
|
|
165
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
166
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
167
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
168
|
+
* @returns {Promise<IOrdersByMarkerEntity | IError>} Returns an object with an array of found orders and total count.
|
|
169
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
170
|
+
*/
|
|
171
|
+
getOrdersByVectorSearch(body: IOrdersVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Body for semantic (vector) order search.
|
|
175
|
+
* @interface IOrdersVectorSearch
|
|
176
|
+
* @property {string} queryText - Natural-language search query. Example: "winter jacket".
|
|
177
|
+
* @property {number} [vectorDistanceThreshold] - Override of the cosine distance threshold (0..2). Example: 0.3.
|
|
178
|
+
* @property {number} [maxHits] - Top-K candidates fetched before pagination. Default: 100. Max: 500. Example: 10.
|
|
179
|
+
* @property {boolean} [debug] - When true, each returned item gets a `distance` field. Example: false.
|
|
180
|
+
* @description Body for the orders vector/search endpoint.
|
|
181
|
+
*/
|
|
182
|
+
interface IOrdersVectorSearch {
|
|
183
|
+
queryText: string;
|
|
184
|
+
vectorDistanceThreshold?: number;
|
|
185
|
+
maxHits?: number;
|
|
186
|
+
debug?: boolean;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Interface for the orders storage object.
|
|
190
|
+
* @interface IOrdersByMarkerEntity
|
|
191
|
+
* @property {IOrderByMarkerEntity[]} items - Array of order storage objects.
|
|
192
|
+
* @example
|
|
193
|
+
[
|
|
194
|
+
{
|
|
195
|
+
"id": 55,
|
|
196
|
+
"storageId": 1,
|
|
197
|
+
"createdDate": "2025-03-22T21:12:42.371Z",
|
|
198
|
+
"statusIdentifier": "inProgress",
|
|
199
|
+
"formIdentifier": "orderForm",
|
|
200
|
+
"formData": [
|
|
201
|
+
{
|
|
202
|
+
"marker": "order_name",
|
|
203
|
+
"value": "Ivan",
|
|
204
|
+
"type": "string"
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"attributeSetIdentifier": "order_form",
|
|
208
|
+
"totalSum": "300.00",
|
|
209
|
+
"currency": "",
|
|
210
|
+
"paymentAccountIdentifier": "cash",
|
|
211
|
+
"paymentAccountLocalizeInfos": {
|
|
212
|
+
"title": "Cash"
|
|
213
|
+
},
|
|
214
|
+
"products": [
|
|
215
|
+
{
|
|
216
|
+
"id": 2957,
|
|
217
|
+
"title": "Cosmo",
|
|
218
|
+
"sku": null,
|
|
219
|
+
"previewImage": null,
|
|
220
|
+
"price": 150,
|
|
221
|
+
"quantity": 2
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"isCompleted": false
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
* @property {number} total - Total number of found records. Example: 100.
|
|
228
|
+
* @description Represents a response from the order storage by marker.
|
|
229
|
+
*/
|
|
230
|
+
interface IOrdersByMarkerEntity {
|
|
231
|
+
total: number;
|
|
232
|
+
items: IOrderByMarkerEntity[];
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Interface representing a picture entity.
|
|
236
|
+
* @interface IPicture
|
|
237
|
+
* @property {string} filename - The name of the file. Example: "image.jpg".
|
|
238
|
+
* @property {string} downloadLink - The URL link to download the picture. Example: "https://example.com/image.jpg".
|
|
239
|
+
* @property {number} size - The size of the picture in bytes. Example: 102400.
|
|
240
|
+
* @property {string} previewLink - The URL link to preview the picture. Example: "https://example.com/image-preview.jpg".
|
|
241
|
+
* @description This interface defines the structure for a picture entity, including its filename, download link, size, and preview link.
|
|
242
|
+
*/
|
|
243
|
+
interface IPicture {
|
|
244
|
+
filename: string;
|
|
245
|
+
downloadLink: string;
|
|
246
|
+
size: number;
|
|
247
|
+
previewLink: string;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Interface representing a product in an order.
|
|
251
|
+
* @interface IOrderProducts
|
|
252
|
+
* @property {number} id - Product id. Example: 2957.
|
|
253
|
+
* @property {number} quantity - Product quantity. Example: 1.
|
|
254
|
+
* @property {string} title - Product title. Example: "Cosmo".
|
|
255
|
+
* @property {string | null} sku - Product sku. Example: "SKU".
|
|
256
|
+
* @property {IPicture | null} previewImage - Product previewImage.
|
|
257
|
+
* @example
|
|
258
|
+
{
|
|
259
|
+
"filename": "image.jpg",
|
|
260
|
+
"downloadLink": "https://example.com/image.jpg",
|
|
261
|
+
"size": 102400,
|
|
262
|
+
"previewLink": "https://example.com/image-preview.jpg"
|
|
263
|
+
}
|
|
264
|
+
* @property {number} price - Product price. Example: 150.
|
|
265
|
+
* @property {boolean} isGift - Whether the product is a gift. Example: false.
|
|
266
|
+
* @description Represents a product in an order.
|
|
267
|
+
*/
|
|
268
|
+
interface IOrderProducts {
|
|
269
|
+
id: number;
|
|
270
|
+
quantity: number;
|
|
271
|
+
title: string;
|
|
272
|
+
sku: string | null;
|
|
273
|
+
previewImage: IPicture | null;
|
|
274
|
+
price: number;
|
|
275
|
+
isGift: boolean;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Interface representing form data for orders.
|
|
279
|
+
* @interface IOrdersFormData
|
|
280
|
+
* @property {string} marker - Marker of form field. Example: "name_1".
|
|
281
|
+
* @property {string} type - Type of value. Example: "string".
|
|
282
|
+
* @property {string} value - Value. Example: "Name".
|
|
283
|
+
* @description Represents a form data for orders.
|
|
284
|
+
*/
|
|
285
|
+
interface IOrdersFormData {
|
|
286
|
+
marker: string;
|
|
287
|
+
type: string;
|
|
288
|
+
value: unknown;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Interface representing product data in an order.
|
|
292
|
+
* @interface IOrderProductData
|
|
293
|
+
* @property {number} productId - Product identifier. Example: 1.
|
|
294
|
+
* @property {number} quantity - Quantity of the product. Example: 2.
|
|
295
|
+
* @property {string} [signedPrice] - The signed price of the product is obtained along with the product data when `signPrice` is set. Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...".
|
|
296
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/orders/#Fixed-product-price-signedPrice Fixed product price} documentation.
|
|
297
|
+
* @description Represents a product data in an order.
|
|
298
|
+
*/
|
|
299
|
+
interface IOrderProductData {
|
|
300
|
+
productId: number;
|
|
301
|
+
quantity: number;
|
|
302
|
+
signedPrice?: string;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Interface representing product data in an order.
|
|
306
|
+
* @interface IOrderProductsData
|
|
307
|
+
* @property {number} productId - Product identifier. Example: 1.
|
|
308
|
+
* @property {number} quantity - Quantity of the product. Example: 2.
|
|
309
|
+
* @description Represents a product data in an order.
|
|
310
|
+
*/
|
|
311
|
+
interface IOrderProductsData {
|
|
312
|
+
productId: number;
|
|
313
|
+
quantity: number;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Interface representing an order storage object.
|
|
317
|
+
* @interface IBaseOrdersEntity
|
|
318
|
+
* @property {number} id - Object identifier. Example: 1.
|
|
319
|
+
* @property {string} formIdentifier - Text identifier of the form. Example: "bar-orders-form".
|
|
320
|
+
* @property {string} paymentAccountIdentifier - Text identifier of the order payment. Example: "payment-1".
|
|
321
|
+
* @property {IOrdersFormData[]} formData - Data submitted by the form linked to the order store.
|
|
322
|
+
* @example
|
|
323
|
+
[
|
|
324
|
+
{
|
|
325
|
+
"marker": "name_1",
|
|
326
|
+
"value": "Name",
|
|
327
|
+
"type": "string"
|
|
328
|
+
}
|
|
329
|
+
]
|
|
330
|
+
* @property {IOrderProductsData[]} products - Array of products added to order.
|
|
331
|
+
* @example
|
|
332
|
+
[
|
|
333
|
+
{
|
|
334
|
+
"id": 2957,
|
|
335
|
+
"title": "Cosmo",
|
|
336
|
+
"sku": null,
|
|
337
|
+
"previewImage": null,
|
|
338
|
+
"price": 150,
|
|
339
|
+
"quantity": 2
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
* @property {string} currency - Currency used to pay for the order. Example: "USD".
|
|
343
|
+
* @property {number} totalSum - Total order amount. Example: 150.
|
|
344
|
+
* @property {string} [createdDate] - Order creation date. Example: "2023-10-01T12:00:00Z".
|
|
345
|
+
* @property {string} [statusIdentifier] - Text identifier of order status object (if not set, default status will be assigned). Example: "status-1".
|
|
346
|
+
* @property {ILocalizeInfo} [statusLocalizeInfos] - Localized status name assigned to the created/updated order.
|
|
347
|
+
* @property {string} [couponCode] -
|
|
348
|
+
* @property {string[]} [additionalDiscountsMarkers] -
|
|
349
|
+
* @property {IOrderDiscountConfig} [discountConfig] - Resolved discount configuration applied to the order.
|
|
350
|
+
* @property {number} [bonusAmount] - Bonus amount applied to the order.
|
|
351
|
+
* @property {number} [bonusApplied] - Bonus applied to the order.
|
|
352
|
+
* @property {number} [totalDue] - Total due after bonuses.
|
|
353
|
+
*/
|
|
354
|
+
interface IBaseOrdersEntity {
|
|
355
|
+
id: number;
|
|
356
|
+
formIdentifier: string;
|
|
357
|
+
paymentAccountIdentifier: string;
|
|
358
|
+
formData: IOrdersFormData[];
|
|
359
|
+
products: IOrderProductsData[];
|
|
360
|
+
currency: string;
|
|
361
|
+
totalSum: number;
|
|
362
|
+
createdDate?: string;
|
|
363
|
+
statusIdentifier?: string;
|
|
364
|
+
statusLocalizeInfos?: ILocalizeInfo;
|
|
365
|
+
couponCode?: string;
|
|
366
|
+
additionalDiscountsMarkers?: string[];
|
|
367
|
+
discountConfig?: IOrderDiscountConfig;
|
|
368
|
+
bonusAmount?: number;
|
|
369
|
+
bonusApplied?: number;
|
|
370
|
+
totalDue?: number;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* @interface IOrderDiscountBonus
|
|
374
|
+
* @property {number} availableBalance - User bonus balance available at the moment of calculation. Example: 0.
|
|
375
|
+
* @property {number} bonusApplied - Bonus amount actually applied to this order. Example: 0.
|
|
376
|
+
* @property {number} maxBonusDiscount - Maximum bonus amount allowed to be spent on this order. Example: 0.
|
|
377
|
+
* @property {number | null} minBonusAmount - Minimum bonus balance required to use bonuses, or null if no threshold. Example: null.
|
|
378
|
+
* @property {number | null} minOrderAmountForBonus - Minimum order total required to apply bonuses, or null if no threshold. Example: null.
|
|
379
|
+
* @description Bonus subsection of the order discount configuration.
|
|
380
|
+
*/
|
|
381
|
+
interface IOrderDiscountBonus {
|
|
382
|
+
availableBalance: number;
|
|
383
|
+
bonusApplied: number;
|
|
384
|
+
maxBonusDiscount: number;
|
|
385
|
+
minBonusAmount: number | null;
|
|
386
|
+
minOrderAmountForBonus: number | null;
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* @interface IOrderDiscountSettings
|
|
390
|
+
* @property {boolean} allowGiftStacking - Whether multiple gift discounts can be combined. Example: false.
|
|
391
|
+
* @property {boolean} allowStacking - Whether multiple non-gift discounts can be combined. Example: false.
|
|
392
|
+
* @property {number | null} maxDiscountValue - Hard cap on total discount value, or null if uncapped. Example: null.
|
|
393
|
+
* @property {string} [giftRefundPolicy] - Refund policy applied to gift products (present on newer orders). Example: "refund".
|
|
394
|
+
* @property {number | null} [maxBonusPaymentPercent] - Maximum share of the order payable with bonuses, or null if uncapped (present on newer orders).
|
|
395
|
+
* @property {number | null} [minBonusAmount] - Minimum bonus amount required to apply bonuses, or null when not configured (present on newer orders).
|
|
396
|
+
* @property {number | null} [minOrderAmountForBonus] - Minimum order amount required to earn/spend bonuses, or null when not configured (present on newer orders).
|
|
397
|
+
* @description Stacking and cap settings for the order discount engine.
|
|
398
|
+
*/
|
|
399
|
+
interface IOrderDiscountSettings {
|
|
400
|
+
allowGiftStacking: boolean;
|
|
401
|
+
allowStacking: boolean;
|
|
402
|
+
maxDiscountValue: number | null;
|
|
403
|
+
giftRefundPolicy?: string;
|
|
404
|
+
maxBonusPaymentPercent?: number | null;
|
|
405
|
+
minBonusAmount?: number | null;
|
|
406
|
+
minOrderAmountForBonus?: number | null;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* @interface IOrderDiscountConfig
|
|
410
|
+
* @property {IOrderDiscountBonus | null} [bonus] - Bonus calculation result, null when bonuses are not used, or omitted entirely when the order has no bonus context.
|
|
411
|
+
* @property {unknown | null} coupon - Resolved coupon, or null when no coupon is applied.
|
|
412
|
+
* @property {unknown[]} orderDiscounts - Order-level discounts that were matched and applied.
|
|
413
|
+
* @property {unknown[]} productDiscounts - Product-level discounts that were matched and applied.
|
|
414
|
+
* @property {IOrderDiscountSettings} settings - Stacking and cap settings used during calculation.
|
|
415
|
+
* @property {string[]} [additionalDiscountsMarkers] - Markers of extra discounts requested by the client (omitted in preview responses).
|
|
416
|
+
* @property {number} [bonusApplied] - Bonus amount applied to the order (omitted in preview responses). Example: 0.
|
|
417
|
+
* @property {string[]} [excludedGiftProductIds] - Product ids excluded from gift selection (omitted in preview responses).
|
|
418
|
+
* @property {number} [totalDue] - Total amount due after discounts and bonuses (omitted in preview responses). Example: 300.
|
|
419
|
+
* @property {number} [totalRaw] - Total amount before discounts (omitted in preview responses). Example: 300.
|
|
420
|
+
* @property {number} [totalSumWithDiscount] - Total amount after discounts but before bonuses (omitted in preview responses). Example: 300.
|
|
421
|
+
* @description Resolved discount configuration returned alongside an order or order preview. Preview responses include only the calculation inputs (bonus, coupon, orderDiscounts, productDiscounts, settings); created/updated orders also carry the totals and applied markers.
|
|
422
|
+
*/
|
|
423
|
+
interface IOrderDiscountConfig {
|
|
424
|
+
bonus?: IOrderDiscountBonus | null;
|
|
425
|
+
coupon: unknown | null;
|
|
426
|
+
orderDiscounts: unknown[];
|
|
427
|
+
productDiscounts: unknown[];
|
|
428
|
+
settings: IOrderDiscountSettings;
|
|
429
|
+
additionalDiscountsMarkers?: string[];
|
|
430
|
+
bonusApplied?: number;
|
|
431
|
+
excludedGiftProductIds?: string[];
|
|
432
|
+
totalDue?: number;
|
|
433
|
+
totalRaw?: number;
|
|
434
|
+
totalSumWithDiscount?: number;
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Interface representing a response from the order storage.
|
|
438
|
+
* @interface IBaseOrdersEntityResponse
|
|
439
|
+
* @property {IBaseOrdersEntity[]} items - Array of order storage objects.
|
|
440
|
+
* @example
|
|
441
|
+
[
|
|
442
|
+
{
|
|
443
|
+
"id": 2957,
|
|
444
|
+
"title": "Cosmo",
|
|
445
|
+
"sku": null,
|
|
446
|
+
"previewImage": null,
|
|
447
|
+
"price": 150,
|
|
448
|
+
"quantity": 2
|
|
449
|
+
}
|
|
450
|
+
]
|
|
451
|
+
* @property {string | number} total - Total number of found records. Example: 100.
|
|
452
|
+
* @description Represents a response from the order storage.
|
|
453
|
+
*/
|
|
454
|
+
interface IBaseOrdersEntityResponse {
|
|
455
|
+
items: IBaseOrdersEntity[];
|
|
456
|
+
total: string | number;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Interface representing an order storage object.
|
|
460
|
+
* @interface IOrdersEntity
|
|
461
|
+
* @property {number} id - Object identifier. Example: 1.
|
|
462
|
+
* @property {ILocalizeInfo} localizeInfos - Name considering localization.
|
|
463
|
+
* @example
|
|
464
|
+
{
|
|
465
|
+
"title": "Cash"
|
|
466
|
+
}
|
|
467
|
+
* @property {number | null} position - Position in orders storage. Example: 1.
|
|
468
|
+
* @property {string} identifier - Textual identifier for the record field. Example: "order_storage_1".
|
|
469
|
+
* @property {string} formIdentifier - Textual identifier for the form used by the order storage. Example: "bar-orders-form".
|
|
470
|
+
* @property {number | null} generalTypeId - Type identifier. Example: 1.
|
|
471
|
+
* @property {IPaymentAccountIdentifiers[]} paymentAccountIdentifiers - Array of textual identifiers of payment accounts used by the order storage.
|
|
472
|
+
* @example
|
|
473
|
+
[
|
|
474
|
+
{
|
|
475
|
+
"identifier": "payment-1"
|
|
476
|
+
}
|
|
477
|
+
]
|
|
478
|
+
* @description Represents an order storage object.
|
|
479
|
+
*/
|
|
480
|
+
interface IOrdersEntity {
|
|
481
|
+
id: number;
|
|
482
|
+
localizeInfos: ILocalizeInfo;
|
|
483
|
+
position: number | null;
|
|
484
|
+
identifier: string | null;
|
|
485
|
+
formIdentifier: string | null;
|
|
486
|
+
generalTypeId: number | null;
|
|
487
|
+
paymentAccountIdentifiers: IPaymentAccountIdentifiers[];
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Interface representing an identifier for a payment account used in an order.
|
|
491
|
+
* @interface IPaymentAccountIdentifiers
|
|
492
|
+
* @property {string} identifier - Textual identifier of the payment account. Example: "payment-1".
|
|
493
|
+
* @description Represents an identifier for a payment account used in an order.
|
|
494
|
+
*/
|
|
495
|
+
interface IPaymentAccountIdentifiers {
|
|
496
|
+
identifier: string;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Interface representing the data required to create or update an order in the order storage.
|
|
500
|
+
* @interface IOrderData
|
|
501
|
+
* @property {string} formIdentifier - Text identifier of the form object linked to the order repository. Example: "bar-orders-form".
|
|
502
|
+
* @property {string} paymentAccountIdentifier - Text identifier of the payment object linked to the order repository. Example: "payment-1".
|
|
503
|
+
* @property {IOrdersFormData | IOrdersFormData[]} formData - Form data linked to the order repository.
|
|
504
|
+
* @example
|
|
505
|
+
[
|
|
506
|
+
{
|
|
507
|
+
"marker": "name_1",
|
|
508
|
+
"value": "Name",
|
|
509
|
+
"type": "string"
|
|
510
|
+
}
|
|
511
|
+
]
|
|
512
|
+
* @property {IOrderProductData[]} products - An array of ordered products. Example: [].
|
|
513
|
+
* @property {string} [couponCode] - Coupon code.
|
|
514
|
+
* @property {string[]} [additionalDiscountsMarkers] - Array of additional discount markers.
|
|
515
|
+
* @property {number} [bonusAmount] - Bonus amount to apply.
|
|
516
|
+
* @description Represents the data required to create or update an order in the order storage.
|
|
517
|
+
*/
|
|
518
|
+
interface IOrderData {
|
|
519
|
+
formIdentifier: string;
|
|
520
|
+
paymentAccountIdentifier: string;
|
|
521
|
+
formData: IOrdersFormData | IOrdersFormData[];
|
|
522
|
+
products: IOrderProductData[];
|
|
523
|
+
couponCode?: string;
|
|
524
|
+
additionalDiscountsMarkers?: string[];
|
|
525
|
+
bonusAmount?: number;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* @interface IOrderSplitStage
|
|
529
|
+
* @property {string} marker - Stage marker. Example: "stage-1".
|
|
530
|
+
* @property {string | null} sessionId - Payment session identifier for the stage, or null when not yet started. Example: null.
|
|
531
|
+
* @property {number} productId - Identifier of the product covered by the stage. Example: 1.
|
|
532
|
+
* @property {string} title - Stage title. Example: "Deposit".
|
|
533
|
+
* @property {number} value - Stage amount. Example: 100.
|
|
534
|
+
* @property {string} status - Stage status. Example: "pending".
|
|
535
|
+
* @description A single stage of a split (staged) order payment.
|
|
536
|
+
*/
|
|
537
|
+
interface IOrderSplitStage {
|
|
538
|
+
marker: string;
|
|
539
|
+
sessionId: string | null;
|
|
540
|
+
productId: number;
|
|
541
|
+
title: string;
|
|
542
|
+
value: number;
|
|
543
|
+
status: string;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* @interface IOrderSplit
|
|
547
|
+
* @property {boolean} completed - Whether all split stages are completed. Example: false.
|
|
548
|
+
* @property {boolean} partial - Whether the split is partially paid. Example: false.
|
|
549
|
+
* @property {IOrderSplitStage[]} stages - Ordered list of split payment stages.
|
|
550
|
+
* @description Split (staged) payment configuration of an order; returned by the by-id order endpoint.
|
|
551
|
+
*/
|
|
552
|
+
interface IOrderSplit {
|
|
553
|
+
completed: boolean;
|
|
554
|
+
partial: boolean;
|
|
555
|
+
stages: IOrderSplitStage[];
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Interface representing an order product data.
|
|
559
|
+
* @interface IOrderByMarkerEntity
|
|
560
|
+
* @property {number} id - Object identifier. Example: 125.
|
|
561
|
+
* @property {number} storageId - Identifier of the order storage object. Example: 1.
|
|
562
|
+
* @property {string} createdDate - Date when the order was created. Example: "2023-10-01T12:00:00Z".
|
|
563
|
+
* @property {string} [statusIdentifier] - Text identifier of the order status. Example: "order-status-1".
|
|
564
|
+
* @property {string} [formIdentifier] - Text identifier of the form. Example: "bar-orders-form".
|
|
565
|
+
* @property {IOrdersFormData[]} formData - Data submitted by the form linked to the order store.
|
|
566
|
+
* @example
|
|
567
|
+
[
|
|
568
|
+
{
|
|
569
|
+
"marker": "order_name",
|
|
570
|
+
"value": "Ivan",
|
|
571
|
+
"type": "string"
|
|
572
|
+
}
|
|
573
|
+
]
|
|
574
|
+
* @property {string | null} [attributeSetIdentifier] - Text identifier of the attribute set. Example: "attribute-set-1".
|
|
575
|
+
* @property {string} totalSum - Total order amount. Example: "100.00".
|
|
576
|
+
* @property {string} [totalSumRaw] - Raw total order amount with full precision. Example: "100.00".
|
|
577
|
+
* @property {string} currency - Currency used to pay for the order. Example: "USD".
|
|
578
|
+
* @property {string | null} [paymentAccountIdentifier] - Textual identifier for the order payment. Example: "payment-1".
|
|
579
|
+
* @property {ILocalizeInfo} [paymentAccountLocalizeInfos] - Payment account name considering localization.
|
|
580
|
+
* @example
|
|
581
|
+
{
|
|
582
|
+
"title": "Cash"
|
|
583
|
+
}
|
|
584
|
+
* @property {IOrderProducts[]} products - Array of products added to order.
|
|
585
|
+
* @example
|
|
586
|
+
[
|
|
587
|
+
{
|
|
588
|
+
"id": 1,
|
|
589
|
+
"name": "Product 1",
|
|
590
|
+
"quantity": 2
|
|
591
|
+
}
|
|
592
|
+
]
|
|
593
|
+
* @property {string | null} paymentUrl - Payment link. Example: "https://example.com/pay/123".
|
|
594
|
+
* @property {boolean | null} isCompleted - Indicates that the order has been completed. Example: true.
|
|
595
|
+
* @property {boolean | null} [isPartial] - Indicates that the order is partially paid; null on older orders where it was not tracked. Example: false.
|
|
596
|
+
* @property {string} [paymentStrategy] - Payment strategy of the order. Example: "once".
|
|
597
|
+
* @property {ILocalizeInfo} [statusLocalizeInfos] - Localized status name.
|
|
598
|
+
* @property {string | null} [fulfillmentStatusIdentifier] - Text identifier of the fulfillment (delivery) status; null while no fulfillment status is assigned. Example: "shipped".
|
|
599
|
+
* @property {ILocalizeInfo | null} [fulfillmentStatusLocalizeInfos] - Localized fulfillment status name; null while no fulfillment status is assigned.
|
|
600
|
+
* @property {string | null} [paymentStatusIdentifier] - Text identifier of the payment status; null while no payment status is assigned. Example: "inProgress-payment".
|
|
601
|
+
* @property {ILocalizeInfo | null} [paymentStatusLocalizeInfos] - Localized payment status name; null while no payment status is assigned.
|
|
602
|
+
* @property {IOrderDiscountConfig | null} [discountConfig] - Resolved discount configuration applied to the order (orderDiscounts, productDiscounts, coupon, settings, bonus, totals); null on older orders without a resolved discount config.
|
|
603
|
+
* @property {IOrderSplit} [split] - Split (staged) payment configuration; present on the by-id order endpoint.
|
|
604
|
+
* @description Represents an order storage object created by the user.
|
|
605
|
+
*/
|
|
606
|
+
interface IOrderByMarkerEntity {
|
|
607
|
+
id: number;
|
|
608
|
+
storageId: number;
|
|
609
|
+
createdDate: string;
|
|
610
|
+
statusIdentifier?: string;
|
|
611
|
+
formIdentifier?: string;
|
|
612
|
+
formData: IOrdersFormData[];
|
|
613
|
+
attributeSetIdentifier?: string;
|
|
614
|
+
totalSum: string;
|
|
615
|
+
totalSumRaw?: string;
|
|
616
|
+
currency: string;
|
|
617
|
+
paymentAccountIdentifier?: string;
|
|
618
|
+
paymentAccountLocalizeInfos?: ILocalizeInfo;
|
|
619
|
+
paymentUrl: string | null;
|
|
620
|
+
products: IOrderProducts[];
|
|
621
|
+
isCompleted: boolean | null;
|
|
622
|
+
isPartial?: boolean | null;
|
|
623
|
+
paymentStrategy?: string;
|
|
624
|
+
statusLocalizeInfos?: ILocalizeInfo;
|
|
625
|
+
fulfillmentStatusIdentifier?: string | null;
|
|
626
|
+
fulfillmentStatusLocalizeInfos?: ILocalizeInfo | null;
|
|
627
|
+
paymentStatusIdentifier?: string | null;
|
|
628
|
+
paymentStatusLocalizeInfos?: ILocalizeInfo | null;
|
|
629
|
+
discountConfig?: IOrderDiscountConfig | null;
|
|
630
|
+
split?: IOrderSplit;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Interface representing an order status object.
|
|
634
|
+
* @interface IOrderStatus
|
|
635
|
+
* @property {number} [id] - Status identifier. Example: 1.
|
|
636
|
+
* @property {ILocalizeInfo} [localizeInfos] - Localized information for the status.
|
|
637
|
+
* @property {string} [identifier] - Text identifier of the status. Example: "inProgress-payment".
|
|
638
|
+
* @property {number} [position] - Position of the status. Example: 1.
|
|
639
|
+
* @property {boolean} [isUsed] - Whether the status is in use. Example: true.
|
|
640
|
+
* @property {boolean} [isDefault] - Whether the status is the default status. Example: true.
|
|
641
|
+
* @property {string} [axis] - Status axis (pipeline) the status belongs to. Example: "payment".
|
|
642
|
+
* @property {boolean} [isCancelFinal] - Whether the status is a final cancellation status. Example: false.
|
|
643
|
+
* @property {boolean} [isFinalSuccess] - Whether the status is a final successful status. Example: true.
|
|
644
|
+
* @property {boolean} [isMapped] - Whether the status is mapped to its axis. Example: true.
|
|
645
|
+
*/
|
|
646
|
+
interface IOrderStatus {
|
|
647
|
+
id?: number;
|
|
648
|
+
localizeInfos?: ILocalizeInfo;
|
|
649
|
+
identifier?: string;
|
|
650
|
+
position?: number;
|
|
651
|
+
isUsed?: boolean;
|
|
652
|
+
isDefault?: boolean;
|
|
653
|
+
axis?: string;
|
|
654
|
+
isCancelFinal?: boolean;
|
|
655
|
+
isFinalSuccess?: boolean;
|
|
656
|
+
isMapped?: boolean;
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Interface representing a product in an order preview.
|
|
660
|
+
* @interface IPreviewOrderProduct
|
|
661
|
+
* @property {number} [productId] - Product identifier. Example: 1.
|
|
662
|
+
* @property {number} [quantity] - Quantity of the product. Example: 2.
|
|
663
|
+
*/
|
|
664
|
+
interface IPreviewOrderProduct {
|
|
665
|
+
productId?: number;
|
|
666
|
+
quantity?: number;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Interface representing the body for order preview calculation.
|
|
670
|
+
* @interface ICreateOrderPreview
|
|
671
|
+
* @property {IPreviewOrderProduct[]} [products] - Array of products to preview.
|
|
672
|
+
* @property {string} [couponCode] - Coupon code to apply.
|
|
673
|
+
* @property {string[]} [additionalDiscountsMarkers] - Array of additional discount markers.
|
|
674
|
+
* @property {number} [bonusAmount] - Bonus amount to apply.
|
|
675
|
+
*/
|
|
676
|
+
interface ICreateOrderPreview {
|
|
677
|
+
products?: IPreviewOrderProduct[];
|
|
678
|
+
couponCode?: string;
|
|
679
|
+
additionalDiscountsMarkers?: string[];
|
|
680
|
+
bonusAmount?: number;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* @interface IOrderPreviewItem
|
|
684
|
+
* @property {number} id - Product identifier. Example: 2954.
|
|
685
|
+
* @property {number} price - Product unit price before discounts. Example: 51.
|
|
686
|
+
* @property {number} quantity - Quantity of the product. Example: 1.
|
|
687
|
+
* @property {number | null} discountPrice - Unit price after discounts, or null when no discount applies. Example: null.
|
|
688
|
+
* @property {boolean} isGift - Whether the product is delivered as a gift. Example: false.
|
|
689
|
+
* @description A single line item in the order preview response.
|
|
690
|
+
*/
|
|
691
|
+
interface IOrderPreviewItem {
|
|
692
|
+
id: number;
|
|
693
|
+
price: number;
|
|
694
|
+
quantity: number;
|
|
695
|
+
discountPrice: number | null;
|
|
696
|
+
isGift: boolean;
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Interface representing the response from an order preview calculation.
|
|
700
|
+
* @interface IOrderPreviewResponse
|
|
701
|
+
* @property {number} totalSum - Total order amount before discounts. Example: 300.
|
|
702
|
+
* @property {number} totalSumWithDiscount - Total order amount after discounts. Example: 250.
|
|
703
|
+
* @property {IOrderDiscountConfig} discountConfig - Discount configuration applied to the order.
|
|
704
|
+
* @property {string} currency - Currency of the order. Example: "USD".
|
|
705
|
+
* @property {IOrderPreviewItem[]} orderPreview - Array of order preview items.
|
|
706
|
+
* @property {number} bonusApplied - Bonus applied to the order.
|
|
707
|
+
* @property {number} totalDue - Total due after bonuses.
|
|
708
|
+
*/
|
|
709
|
+
interface IOrderPreviewResponse {
|
|
710
|
+
totalSum: number;
|
|
711
|
+
totalSumWithDiscount: number;
|
|
712
|
+
discountConfig: IOrderDiscountConfig;
|
|
713
|
+
currency: string;
|
|
714
|
+
orderPreview: IOrderPreviewItem[];
|
|
715
|
+
bonusApplied: number;
|
|
716
|
+
totalDue: number;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* @interface IRefundRequest
|
|
720
|
+
* @property {number} id - Refund request id.
|
|
721
|
+
* @property {string} createdDate - Creation date.
|
|
722
|
+
* @property {string} status - Refund status.
|
|
723
|
+
* @property {number} amount - Refund amount.
|
|
724
|
+
* @property {string} note - Refund note.
|
|
725
|
+
* @property {Record<string, IRefundProduct>} products - Map of product id to refund details.
|
|
726
|
+
* @property {number} orderId - Order id.
|
|
727
|
+
* @property {number} orderStorageId - Order storage id.
|
|
728
|
+
* @property {number} userId - User id.
|
|
729
|
+
* @property {unknown} orderStorage - Order storage data.
|
|
730
|
+
* @property {unknown} user - User data.
|
|
731
|
+
*/
|
|
732
|
+
interface IRefundRequest {
|
|
733
|
+
id: number;
|
|
734
|
+
createdDate: string;
|
|
735
|
+
status: string;
|
|
736
|
+
amount: number;
|
|
737
|
+
note: string;
|
|
738
|
+
products: Record<string, IRefundProduct>;
|
|
739
|
+
orderId: number;
|
|
740
|
+
orderStorageId: number;
|
|
741
|
+
userId: number;
|
|
742
|
+
orderStorage: unknown;
|
|
743
|
+
user: unknown;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* @interface IRefundProduct
|
|
747
|
+
* @description Refund details for a single product.
|
|
748
|
+
* @property {number} quantity - Quantity of the product to refund. Example: 1.
|
|
749
|
+
*/
|
|
750
|
+
interface IRefundProduct {
|
|
751
|
+
quantity: number;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* @interface ICreateRefundRequest
|
|
755
|
+
* @description Body for creating a refund request.
|
|
756
|
+
* @property {Record<string, IRefundProduct>} products - Map of product id to refund details. Example: `{ "146": { "quantity": 1 } }`.
|
|
757
|
+
* @property {string} [note] - Optional note for the refund request. Example: "test".
|
|
758
|
+
*/
|
|
759
|
+
interface ICreateRefundRequest {
|
|
760
|
+
products: Record<string, IRefundProduct>;
|
|
761
|
+
note?: string;
|
|
762
|
+
}
|
|
763
|
+
export type { IBaseOrdersEntity, IBaseOrdersEntityResponse, ICreateOrderPreview, ICreateRefundRequest, IOrderByMarkerEntity, IOrderData, IOrderDiscountBonus, IOrderDiscountConfig, IOrderDiscountSettings, IOrderPreviewItem, IOrderPreviewResponse, IOrderProductData, IOrderProducts, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrdersFormData, IOrderSplit, IOrderSplitStage, IOrderStatus, IOrdersVectorSearch, IPaymentAccountIdentifiers, IPicture, IPreviewOrderProduct, IRefundProduct, IRefundRequest, };
|