@zenky/storefront-api 0.0.14 → 0.0.15
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/package.json +1 -1
- package/dist/index.d.ts +0 -1300
package/package.json
CHANGED
package/dist/index.d.ts
DELETED
|
@@ -1,1300 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export interface ClientConfig {
|
|
3
|
-
baseUrl?: string;
|
|
4
|
-
token?: string;
|
|
5
|
-
client?: string;
|
|
6
|
-
timezone?: string;
|
|
7
|
-
fetchOptions?: any;
|
|
8
|
-
}
|
|
9
|
-
export interface InclusionRequest {
|
|
10
|
-
with?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface PaginationRequest {
|
|
13
|
-
count?: number;
|
|
14
|
-
page?: number;
|
|
15
|
-
}
|
|
16
|
-
export interface SearchRequest {
|
|
17
|
-
search?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface OrderingRequest {
|
|
20
|
-
order_by?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ListRequest extends PaginationRequest, InclusionRequest, SearchRequest, OrderingRequest {
|
|
23
|
-
}
|
|
24
|
-
export interface Pagination {
|
|
25
|
-
total: number;
|
|
26
|
-
count: number;
|
|
27
|
-
per_page: number;
|
|
28
|
-
current_page: number;
|
|
29
|
-
total_pages: number;
|
|
30
|
-
links: {
|
|
31
|
-
previous?: string | null;
|
|
32
|
-
next?: string | null;
|
|
33
|
-
};
|
|
34
|
-
has_previous_page: boolean;
|
|
35
|
-
has_next_page: boolean;
|
|
36
|
-
elements: {
|
|
37
|
-
type: 'page' | 'placeholder';
|
|
38
|
-
page: number | null;
|
|
39
|
-
active: boolean;
|
|
40
|
-
}[];
|
|
41
|
-
}
|
|
42
|
-
export interface PaginatedResponse<T> {
|
|
43
|
-
items: T[];
|
|
44
|
-
pagination: Pagination;
|
|
45
|
-
}
|
|
46
|
-
export declare class Client {
|
|
47
|
-
private readonly baseUrl;
|
|
48
|
-
private token;
|
|
49
|
-
private readonly client;
|
|
50
|
-
private readonly timezone;
|
|
51
|
-
private readonly fetchFunction;
|
|
52
|
-
private readonly fetchOptions;
|
|
53
|
-
static build(config?: ClientConfig | null | undefined, fetcher?: any): Client;
|
|
54
|
-
private constructor();
|
|
55
|
-
setToken(token: string | null): Client;
|
|
56
|
-
request(method: string, path: string, body?: any, apiToken?: string | null): Promise<any>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export declare abstract class AbstractResource {
|
|
60
|
-
protected client: Client;
|
|
61
|
-
constructor(client: Client);
|
|
62
|
-
protected getStoreUrl(storeId: string, path: string, query?: any): string;
|
|
63
|
-
protected getUrl(path: string, query?: any): string;
|
|
64
|
-
protected getPaginatedResponse<T>(response: any): PaginatedResponse<T>;
|
|
65
|
-
protected getResponse<T>(response: any): T;
|
|
66
|
-
}
|
|
67
|
-
export declare class ZenkyError extends Error {
|
|
68
|
-
readonly err: ApiError | null;
|
|
69
|
-
constructor(message: string, error: ApiError | null);
|
|
70
|
-
}
|
|
71
|
-
export declare class ZenkyStorefront {
|
|
72
|
-
protected readonly client: Client;
|
|
73
|
-
readonly store: StoreResource;
|
|
74
|
-
readonly auth: AuthenticationResource;
|
|
75
|
-
readonly customer: CustomersResource;
|
|
76
|
-
readonly categories: CategoriesResource;
|
|
77
|
-
readonly products: ProductsResource;
|
|
78
|
-
readonly addresses: AddressesResource;
|
|
79
|
-
readonly orders: OrdersResource;
|
|
80
|
-
readonly collections: CollectionsResource;
|
|
81
|
-
readonly offers: OffersResource;
|
|
82
|
-
readonly articles: ArticlesResource;
|
|
83
|
-
readonly feedback: FeedbackResource;
|
|
84
|
-
constructor(config?: ClientConfig, fetcher?: any);
|
|
85
|
-
setApiToken(token: string | null): ZenkyStorefront;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export interface Phone {
|
|
89
|
-
number: string;
|
|
90
|
-
country: string;
|
|
91
|
-
national: string;
|
|
92
|
-
}
|
|
93
|
-
export interface GeoLocation {
|
|
94
|
-
latitude: number;
|
|
95
|
-
longitude: number;
|
|
96
|
-
}
|
|
97
|
-
export interface Discount {
|
|
98
|
-
difference: number;
|
|
99
|
-
percentage: number;
|
|
100
|
-
}
|
|
101
|
-
export declare enum DiscountType {
|
|
102
|
-
Amount = "amount",
|
|
103
|
-
Percentage = "percentage"
|
|
104
|
-
}
|
|
105
|
-
export declare enum ContactType {
|
|
106
|
-
Email = "email",
|
|
107
|
-
Website = "website",
|
|
108
|
-
Vk = "vk",
|
|
109
|
-
Facebook = "facebook",
|
|
110
|
-
Instagram = "instagram",
|
|
111
|
-
Twitter = "twitter",
|
|
112
|
-
Ok = "ok",
|
|
113
|
-
Tiktok = "tiktok"
|
|
114
|
-
}
|
|
115
|
-
export interface Contact {
|
|
116
|
-
type: ContactType;
|
|
117
|
-
value: string;
|
|
118
|
-
}
|
|
119
|
-
export interface ScheduleDay {
|
|
120
|
-
hours: string;
|
|
121
|
-
}
|
|
122
|
-
export declare enum TernaryFilter {
|
|
123
|
-
Yes = "yes",
|
|
124
|
-
No = "no",
|
|
125
|
-
Both = "both"
|
|
126
|
-
}
|
|
127
|
-
export interface Schedule {
|
|
128
|
-
is_open_now: boolean;
|
|
129
|
-
opening_at: string | null;
|
|
130
|
-
closing_at: string | null;
|
|
131
|
-
days: {
|
|
132
|
-
monday: ScheduleDay | null;
|
|
133
|
-
tuesday: ScheduleDay | null;
|
|
134
|
-
wednesday: ScheduleDay | null;
|
|
135
|
-
thursday: ScheduleDay | null;
|
|
136
|
-
friday: ScheduleDay | null;
|
|
137
|
-
saturday: ScheduleDay | null;
|
|
138
|
-
sunday: ScheduleDay | null;
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
export interface ApiError {
|
|
142
|
-
message: string;
|
|
143
|
-
original_message: string;
|
|
144
|
-
http_code: number;
|
|
145
|
-
error_code: string;
|
|
146
|
-
meta: any;
|
|
147
|
-
}
|
|
148
|
-
export declare enum OrderAuthenticationMethod {
|
|
149
|
-
Disabled = "disabled",
|
|
150
|
-
Preauth = "preauth",
|
|
151
|
-
Confirmation = "confirmation"
|
|
152
|
-
}
|
|
153
|
-
export declare enum AddressesProvider {
|
|
154
|
-
Dadata = "dadata",
|
|
155
|
-
Manual = "manual"
|
|
156
|
-
}
|
|
157
|
-
export declare enum RecaptchaAction {
|
|
158
|
-
Registration = "registration",
|
|
159
|
-
ResendRegistrationCode = "resend_registration_code",
|
|
160
|
-
ResetPassword = "reset_password",
|
|
161
|
-
OrderSubmission = "order_submission",
|
|
162
|
-
FeedbackRequest = "feedback_request",
|
|
163
|
-
CallbackRequest = "callback_request"
|
|
164
|
-
}
|
|
165
|
-
export interface PhoneRequest {
|
|
166
|
-
number: string;
|
|
167
|
-
country: string;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export interface DeliveryAddress {
|
|
171
|
-
id: string;
|
|
172
|
-
resolver: AddressesProvider;
|
|
173
|
-
name: string | null;
|
|
174
|
-
address: string;
|
|
175
|
-
coordinates: GeoLocation | null;
|
|
176
|
-
country: string | null;
|
|
177
|
-
city: string | null;
|
|
178
|
-
settlement: string | null;
|
|
179
|
-
street: string | null;
|
|
180
|
-
house: string | null;
|
|
181
|
-
block: string | null;
|
|
182
|
-
apartment: string | null;
|
|
183
|
-
entrance: string | null;
|
|
184
|
-
floor: string | null;
|
|
185
|
-
has_intercom: boolean;
|
|
186
|
-
}
|
|
187
|
-
export interface ExistedDeliveryAddressRequest {
|
|
188
|
-
id: string;
|
|
189
|
-
}
|
|
190
|
-
export interface DadataDeliveryAddressRequest {
|
|
191
|
-
name?: string;
|
|
192
|
-
address: string;
|
|
193
|
-
house?: string;
|
|
194
|
-
block?: string;
|
|
195
|
-
apartment?: string;
|
|
196
|
-
entrance?: string;
|
|
197
|
-
floor?: string;
|
|
198
|
-
has_intercom?: boolean;
|
|
199
|
-
}
|
|
200
|
-
export interface ManualDeliveryAddressRequest {
|
|
201
|
-
name?: string;
|
|
202
|
-
city?: string;
|
|
203
|
-
street?: string;
|
|
204
|
-
house?: string;
|
|
205
|
-
block?: string;
|
|
206
|
-
apartment?: string;
|
|
207
|
-
entrance?: string;
|
|
208
|
-
floor?: string;
|
|
209
|
-
has_intercom?: boolean;
|
|
210
|
-
}
|
|
211
|
-
export interface ArticleCategory {
|
|
212
|
-
id: string;
|
|
213
|
-
short_id: string;
|
|
214
|
-
slug: string | null;
|
|
215
|
-
name: string | null;
|
|
216
|
-
}
|
|
217
|
-
export interface Article {
|
|
218
|
-
id: string;
|
|
219
|
-
short_id: string;
|
|
220
|
-
slug: string | null;
|
|
221
|
-
title: string | null;
|
|
222
|
-
intro: string | null;
|
|
223
|
-
body: string | null;
|
|
224
|
-
updated_at: string;
|
|
225
|
-
cover: Media | null;
|
|
226
|
-
category?: ArticleCategory | null;
|
|
227
|
-
}
|
|
228
|
-
export interface ListArticlesRequest extends ListRequest {
|
|
229
|
-
category_id?: string;
|
|
230
|
-
}
|
|
231
|
-
export declare class ArticlesResource extends AbstractResource {
|
|
232
|
-
getArticleCategories(storeId: string): Promise<PaginatedResponse<ArticleCategory>>;
|
|
233
|
-
getArticleCategory(storeId: string, categoryId: string): Promise<ArticleCategory>;
|
|
234
|
-
getArticles(storeId: string, request?: ListArticlesRequest): Promise<PaginatedResponse<ArticleCategory>>;
|
|
235
|
-
getArticle(storeId: string, articleId: string, request?: InclusionRequest): Promise<ArticleCategory>;
|
|
236
|
-
}
|
|
237
|
-
export interface FeatureValue {
|
|
238
|
-
id: string;
|
|
239
|
-
alias: string;
|
|
240
|
-
name: string | null;
|
|
241
|
-
range: number | null;
|
|
242
|
-
}
|
|
243
|
-
export declare enum FeatureType {
|
|
244
|
-
Select = "select",
|
|
245
|
-
MutipleSelect = "mutiple_select",
|
|
246
|
-
Checkboxes = "checkboxes",
|
|
247
|
-
Radios = "radios",
|
|
248
|
-
Range = "range",
|
|
249
|
-
Text = "text"
|
|
250
|
-
}
|
|
251
|
-
export declare enum FeatureRange {
|
|
252
|
-
Integer = "integer",
|
|
253
|
-
Float = "float"
|
|
254
|
-
}
|
|
255
|
-
export interface Feature {
|
|
256
|
-
id: string;
|
|
257
|
-
alias: string;
|
|
258
|
-
name: string | null;
|
|
259
|
-
filterable: boolean;
|
|
260
|
-
type: FeatureType;
|
|
261
|
-
range: FeatureRange | null;
|
|
262
|
-
values: FeatureValue[];
|
|
263
|
-
}
|
|
264
|
-
export interface FeaturesGroup {
|
|
265
|
-
id: string;
|
|
266
|
-
name: string | null;
|
|
267
|
-
description: string | null;
|
|
268
|
-
features: Feature[];
|
|
269
|
-
}
|
|
270
|
-
export declare class CategoriesResource extends AbstractResource {
|
|
271
|
-
getCategories(storeId: string, request?: CategoriesListRequest): Promise<PaginatedResponse<Category>>;
|
|
272
|
-
getCategoriesTree(storeId: string, request?: InclusionRequest): Promise<NestedCategory[]>;
|
|
273
|
-
getCategory(storeId: string, categoryId: string, request?: InclusionRequest): Promise<Category>;
|
|
274
|
-
getFeaturesGroups(storeId: string, categoryId: string): Promise<FeaturesGroup[]>;
|
|
275
|
-
getFeatures(storeId: string, categoryId: string): Promise<Feature[]>;
|
|
276
|
-
}
|
|
277
|
-
export interface Category {
|
|
278
|
-
id: string;
|
|
279
|
-
short_id: string;
|
|
280
|
-
is_featured: boolean;
|
|
281
|
-
slug: string | null;
|
|
282
|
-
name: string | null;
|
|
283
|
-
description: string | null;
|
|
284
|
-
cover?: Media | null;
|
|
285
|
-
seo?: Seo | null;
|
|
286
|
-
}
|
|
287
|
-
export interface NestedCategory extends Category {
|
|
288
|
-
children: NestedCategory[];
|
|
289
|
-
}
|
|
290
|
-
export interface CategoriesListRequest extends ListRequest {
|
|
291
|
-
featured?: boolean;
|
|
292
|
-
}export interface SeoMetaTagAttribute {
|
|
293
|
-
attribute: string;
|
|
294
|
-
value: string;
|
|
295
|
-
}
|
|
296
|
-
export interface SeoMetaTag {
|
|
297
|
-
name: SeoMetaTagAttribute;
|
|
298
|
-
value: SeoMetaTagAttribute;
|
|
299
|
-
additional: SeoMetaTagAttribute[];
|
|
300
|
-
}
|
|
301
|
-
export interface Seo {
|
|
302
|
-
title: string | null;
|
|
303
|
-
description: string | null;
|
|
304
|
-
meta: SeoMetaTag[];
|
|
305
|
-
}
|
|
306
|
-
export interface Image {
|
|
307
|
-
url: string;
|
|
308
|
-
width: number;
|
|
309
|
-
height: number;
|
|
310
|
-
}
|
|
311
|
-
export interface Media {
|
|
312
|
-
placeholder: Image | null;
|
|
313
|
-
medium: Image | null;
|
|
314
|
-
large: Image | null;
|
|
315
|
-
xlarge: Image | null;
|
|
316
|
-
hd: Image | null;
|
|
317
|
-
}
|
|
318
|
-
export interface ProductsCollection {
|
|
319
|
-
id: string;
|
|
320
|
-
name: string | null;
|
|
321
|
-
description: string | null;
|
|
322
|
-
cover: Media | null;
|
|
323
|
-
}
|
|
324
|
-
export interface CollectionsListRequest extends PaginationRequest, SearchRequest, OrderingRequest {
|
|
325
|
-
}
|
|
326
|
-
export declare class CollectionsResource extends AbstractResource {
|
|
327
|
-
getCollections(storeId: string, request?: CollectionsListRequest): Promise<PaginatedResponse<ProductsCollection>>;
|
|
328
|
-
getCollection(storeId: string, id: string): Promise<ProductsCollection>;
|
|
329
|
-
}
|
|
330
|
-
export interface BonusesLevel {
|
|
331
|
-
id: string;
|
|
332
|
-
name: string;
|
|
333
|
-
expenses: number;
|
|
334
|
-
cashback_rate: number | null;
|
|
335
|
-
payment_rate: number | null;
|
|
336
|
-
}
|
|
337
|
-
export interface LoyaltyRates {
|
|
338
|
-
cashback: number | null;
|
|
339
|
-
payment: number | null;
|
|
340
|
-
}
|
|
341
|
-
export declare enum BonusesTransactionType {
|
|
342
|
-
Increase = "increase",
|
|
343
|
-
Decrease = "decrease"
|
|
344
|
-
}
|
|
345
|
-
export declare enum BonusesTransactionStatus {
|
|
346
|
-
Pending = "pending",
|
|
347
|
-
Confirmed = "confirmed",
|
|
348
|
-
Cancelled = "cancelled",
|
|
349
|
-
Rejected = "rejected",
|
|
350
|
-
Refunded = "refunded",
|
|
351
|
-
PartiallyRefunded = "partially_refunded"
|
|
352
|
-
}
|
|
353
|
-
export declare enum BonusesTransactionReason {
|
|
354
|
-
Manual = "manual",
|
|
355
|
-
Cashback = "cashback",
|
|
356
|
-
ReferralReward = "referral_reward",
|
|
357
|
-
RecruitReward = "recruit_reward",
|
|
358
|
-
Payment = "payment",
|
|
359
|
-
Cancellation = "cancellation",
|
|
360
|
-
Refund = "refund",
|
|
361
|
-
Adjustment = "adjustment",
|
|
362
|
-
WelcomeBonuses = "welcome_bonuses",
|
|
363
|
-
PromotionReward = "promotion_reward",
|
|
364
|
-
External = "external"
|
|
365
|
-
}
|
|
366
|
-
export interface BonusesTransaction {
|
|
367
|
-
id: string;
|
|
368
|
-
order_id: string | null;
|
|
369
|
-
type: BonusesTransactionType;
|
|
370
|
-
status: BonusesTransactionStatus;
|
|
371
|
-
reason: BonusesTransactionReason;
|
|
372
|
-
amount: number;
|
|
373
|
-
source_amount: number | null;
|
|
374
|
-
created_at: string;
|
|
375
|
-
confirmed_at: string | null;
|
|
376
|
-
cancelled_at: string | null;
|
|
377
|
-
}
|
|
378
|
-
export interface ListBonusesTransactionsRequest extends PaginationRequest {
|
|
379
|
-
type?: BonusesTransactionType;
|
|
380
|
-
status?: BonusesTransactionStatus;
|
|
381
|
-
reason?: BonusesTransactionReason;
|
|
382
|
-
}
|
|
383
|
-
export interface ListCustomerBonusesTransactionsRequest extends ListBonusesTransactionsRequest {
|
|
384
|
-
order_id?: string;
|
|
385
|
-
}
|
|
386
|
-
export declare enum Gender {
|
|
387
|
-
Female = "female",
|
|
388
|
-
Male = "male",
|
|
389
|
-
Other = "other"
|
|
390
|
-
}
|
|
391
|
-
export interface CustomerSettings {
|
|
392
|
-
onesignal_id: string | null;
|
|
393
|
-
device_id: string | null;
|
|
394
|
-
device_token: string | null;
|
|
395
|
-
device_os: string | null;
|
|
396
|
-
barcode: string | null;
|
|
397
|
-
qrcode: string | null;
|
|
398
|
-
}
|
|
399
|
-
export interface CustomerLoyaltyProfile {
|
|
400
|
-
referral_program: {
|
|
401
|
-
code: string;
|
|
402
|
-
join_url: string;
|
|
403
|
-
invite_url: string;
|
|
404
|
-
};
|
|
405
|
-
balance: number;
|
|
406
|
-
bonuses_level: BonusesLevel | null;
|
|
407
|
-
rates: LoyaltyRates | null;
|
|
408
|
-
settings?: CustomerSettings;
|
|
409
|
-
avatar?: Media | null;
|
|
410
|
-
}
|
|
411
|
-
export interface Customer {
|
|
412
|
-
id: string;
|
|
413
|
-
store_profile_id: string;
|
|
414
|
-
first_name: string | null;
|
|
415
|
-
last_name: string | null;
|
|
416
|
-
phone: Phone;
|
|
417
|
-
gender: Gender;
|
|
418
|
-
birth_date: string | null;
|
|
419
|
-
registered_at: string;
|
|
420
|
-
loyalty: CustomerLoyaltyProfile | null;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
export interface UpdateCustomerProfileRequest {
|
|
424
|
-
first_name?: string;
|
|
425
|
-
last_name?: string;
|
|
426
|
-
gender?: Gender;
|
|
427
|
-
birth_date?: string;
|
|
428
|
-
password?: string;
|
|
429
|
-
current_password?: string;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export interface RemoveCustomerProfileRequest {
|
|
433
|
-
password: string;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
export interface UpdateCustomerSettingsRequest {
|
|
437
|
-
onesignal_id?: string;
|
|
438
|
-
device_id?: string;
|
|
439
|
-
device_token?: string;
|
|
440
|
-
device_os?: string;
|
|
441
|
-
barcode?: string;
|
|
442
|
-
qrcode?: string;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
export interface DeliveryAddressRequest {
|
|
446
|
-
delivery_address: DadataDeliveryAddressRequest | ManualDeliveryAddressRequest;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
export enum AcquiringType {
|
|
450
|
-
CloudPayments = 'cloudpayments',
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
export enum PaymentSystemType {
|
|
454
|
-
Visa = 'visa',
|
|
455
|
-
MasterCard = 'master-card',
|
|
456
|
-
MIR = 'mir',
|
|
457
|
-
Maestro = 'maestro',
|
|
458
|
-
AmericanExpress = 'american-express',
|
|
459
|
-
DinersClub = 'diners-club',
|
|
460
|
-
Discover = 'discover',
|
|
461
|
-
JCB = 'jcb',
|
|
462
|
-
UnionPay = 'union-pay',
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
export interface PaymentSystem {
|
|
466
|
-
id: PaymentSystemType;
|
|
467
|
-
name: string;
|
|
468
|
-
logos: {
|
|
469
|
-
black: string | null;
|
|
470
|
-
white: string | null;
|
|
471
|
-
colored: string | null;
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
export interface BankInfo {
|
|
476
|
-
id: string;
|
|
477
|
-
name: string;
|
|
478
|
-
url: string;
|
|
479
|
-
background_colors: string[];
|
|
480
|
-
primary_background_color: string;
|
|
481
|
-
background_style: 'dark' | 'white';
|
|
482
|
-
logo_style: 'dark' | 'white';
|
|
483
|
-
text_color: string;
|
|
484
|
-
logos: {
|
|
485
|
-
png: string | null;
|
|
486
|
-
svg: string | null;
|
|
487
|
-
};
|
|
488
|
-
payment_system: PaymentSystem;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
export interface CustomerPaymentMethod {
|
|
492
|
-
id: string;
|
|
493
|
-
acquiring_type: AcquiringType;
|
|
494
|
-
card_type: PaymentSystemType;
|
|
495
|
-
card_first_six: string;
|
|
496
|
-
card_last_four: string;
|
|
497
|
-
name: string;
|
|
498
|
-
bank: BankInfo | null;
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
export declare class CustomersResource extends AbstractResource {
|
|
502
|
-
getProfile(storeId: string, request?: InclusionRequest, apiToken?: string): Promise<Customer>;
|
|
503
|
-
updateProfile(storeId: string, request: UpdateCustomerProfileRequest, apiToken?: string): Promise<Customer>;
|
|
504
|
-
removeProfile(storeId: string, request: RemoveCustomerProfileRequest, apiToken?: string): Promise<boolean>;
|
|
505
|
-
getSettings(storeId: string, apiToken?: string): Promise<CustomerSettings>;
|
|
506
|
-
updateSettings(storeId: string, request: UpdateCustomerSettingsRequest, apiToken?: string): Promise<CustomerSettings>;
|
|
507
|
-
getAddresses(storeId: string, request?: ListRequest, apiToken?: string): Promise<PaginatedResponse<DeliveryAddress>>;
|
|
508
|
-
createAddress(storeId: string, request: DeliveryAddressRequest, apiToken?: string): Promise<DeliveryAddress>;
|
|
509
|
-
updateAddress(storeId: string, addressId: string, request: DeliveryAddressRequest, apiToken?: string): Promise<DeliveryAddress>;
|
|
510
|
-
deleteAddress(storeId: string, addressId: string, apiToken?: string): Promise<boolean>;
|
|
511
|
-
getPaymentMethods(storeId: string, request?: PaginationRequest, apiToken?: string): Promise<PaginatedResponse<CustomerPaymentMethod>>;
|
|
512
|
-
deletePaymentMethod(storeId: string, paymentMethodId: string, apiToken?: string): Promise<boolean>;
|
|
513
|
-
getBonusesTransactions(storeId: string, request?: ListCustomerBonusesTransactionsRequest, apiToken?: string): Promise<PaginatedResponse<BonusesTransaction>>;
|
|
514
|
-
}
|
|
515
|
-
export interface Feedback {
|
|
516
|
-
id: string;
|
|
517
|
-
name: string | null;
|
|
518
|
-
email: string | null;
|
|
519
|
-
phone: Phone | null;
|
|
520
|
-
comment: string | null;
|
|
521
|
-
created_at: string;
|
|
522
|
-
}
|
|
523
|
-
export interface FeedbackRequest {
|
|
524
|
-
name?: string;
|
|
525
|
-
email?: string;
|
|
526
|
-
phone?: PhoneRequest;
|
|
527
|
-
comment?: string;
|
|
528
|
-
}
|
|
529
|
-
export interface CallbackRequest {
|
|
530
|
-
phone: PhoneRequest;
|
|
531
|
-
}
|
|
532
|
-
export declare class FeedbackResource extends AbstractResource {
|
|
533
|
-
createFeedback(storeId: string, request: FeedbackRequest): Promise<Feedback>;
|
|
534
|
-
createCallback(storeId: string, request: CallbackRequest): Promise<boolean>;
|
|
535
|
-
}
|
|
536
|
-
export interface Modifier {
|
|
537
|
-
id: string;
|
|
538
|
-
sku: string | null;
|
|
539
|
-
name: string | null;
|
|
540
|
-
price: number | null;
|
|
541
|
-
}
|
|
542
|
-
export interface BasicModifiersGroup {
|
|
543
|
-
id: string;
|
|
544
|
-
name: string | null;
|
|
545
|
-
}
|
|
546
|
-
export interface ModifiersGroup extends BasicModifiersGroup {
|
|
547
|
-
modifiers: Modifier[];
|
|
548
|
-
}
|
|
549
|
-
export interface ProductModifier {
|
|
550
|
-
modifier: Modifier;
|
|
551
|
-
is_required: boolean;
|
|
552
|
-
min_quantity: number | null;
|
|
553
|
-
max_quantity: number | null;
|
|
554
|
-
}
|
|
555
|
-
export interface ProductModifiersGroup {
|
|
556
|
-
group: ModifiersGroup;
|
|
557
|
-
is_required: boolean;
|
|
558
|
-
min_quantity: number | null;
|
|
559
|
-
max_quantity: number | null;
|
|
560
|
-
}
|
|
561
|
-
export interface OfferBanner {
|
|
562
|
-
title: string | null;
|
|
563
|
-
description: string | null;
|
|
564
|
-
image: Media | null;
|
|
565
|
-
}
|
|
566
|
-
export interface OfferArticle {
|
|
567
|
-
title: string | null;
|
|
568
|
-
intro: string | null;
|
|
569
|
-
body: string | null;
|
|
570
|
-
cover: Media | null;
|
|
571
|
-
}
|
|
572
|
-
export interface Offer {
|
|
573
|
-
id: string;
|
|
574
|
-
short_id: string;
|
|
575
|
-
slug: string | null;
|
|
576
|
-
banners: {
|
|
577
|
-
desktop: OfferBanner | null;
|
|
578
|
-
mobile: OfferBanner | null;
|
|
579
|
-
};
|
|
580
|
-
article?: OfferArticle | null;
|
|
581
|
-
}
|
|
582
|
-
export declare class OffersResource extends AbstractResource {
|
|
583
|
-
getOffers(storeId: string, request?: ListRequest): Promise<PaginatedResponse<Offer>>;
|
|
584
|
-
getOffer(storeId: string, offerId: string, request?: InclusionRequest): Promise<Offer>;
|
|
585
|
-
}
|
|
586
|
-
export declare enum UnitType {
|
|
587
|
-
Piece = "piece",
|
|
588
|
-
Gram = "gram",
|
|
589
|
-
Kilogram = "kilogram",
|
|
590
|
-
Meter = "meter"
|
|
591
|
-
}
|
|
592
|
-
export declare enum Dimension {
|
|
593
|
-
Weight = "weight",
|
|
594
|
-
Width = "width",
|
|
595
|
-
Height = "height",
|
|
596
|
-
Length = "length"
|
|
597
|
-
}
|
|
598
|
-
export declare enum DimensionType {
|
|
599
|
-
Netto = "netto",
|
|
600
|
-
Brutto = "brutto"
|
|
601
|
-
}
|
|
602
|
-
export declare enum VariantOptionType {
|
|
603
|
-
Color = "color"
|
|
604
|
-
}
|
|
605
|
-
export declare enum ProductContextType {
|
|
606
|
-
Category = "category",
|
|
607
|
-
Group = "group",
|
|
608
|
-
VariantOption = "variant_option",
|
|
609
|
-
VariantOptionValue = "variant_option_value"
|
|
610
|
-
}
|
|
611
|
-
export interface ProductVariantPrice {
|
|
612
|
-
stock_id: string | null;
|
|
613
|
-
price: number;
|
|
614
|
-
original_price: number | null;
|
|
615
|
-
discount: Discount | null;
|
|
616
|
-
}
|
|
617
|
-
export interface ProductVariantDimension {
|
|
618
|
-
dimension: Dimension;
|
|
619
|
-
type: DimensionType;
|
|
620
|
-
value: number;
|
|
621
|
-
}
|
|
622
|
-
export interface ProductVariantRemainder {
|
|
623
|
-
stock_id: string;
|
|
624
|
-
quantity: number;
|
|
625
|
-
label: string | null;
|
|
626
|
-
}
|
|
627
|
-
export interface ProductVariantOptionValue {
|
|
628
|
-
id: string;
|
|
629
|
-
name: string | null;
|
|
630
|
-
color: string | null;
|
|
631
|
-
}
|
|
632
|
-
export interface ProductVariantOption {
|
|
633
|
-
id: string;
|
|
634
|
-
name: string | null;
|
|
635
|
-
type: VariantOptionType | null;
|
|
636
|
-
value: ProductVariantOptionValue;
|
|
637
|
-
}
|
|
638
|
-
export interface ProductVariant {
|
|
639
|
-
id: string;
|
|
640
|
-
sku: string | null;
|
|
641
|
-
barcode: string | null;
|
|
642
|
-
name: string | null;
|
|
643
|
-
price: number;
|
|
644
|
-
original_price: number | null;
|
|
645
|
-
discount: Discount | null;
|
|
646
|
-
default_modifiers?: {
|
|
647
|
-
modifiers: {
|
|
648
|
-
modifier_id: string;
|
|
649
|
-
modifiers_group_id: string | null;
|
|
650
|
-
quantity: number;
|
|
651
|
-
}[];
|
|
652
|
-
hash: string | null;
|
|
653
|
-
} | null;
|
|
654
|
-
prices?: ProductVariantPrice[];
|
|
655
|
-
dimensions?: ProductVariantDimension[];
|
|
656
|
-
remainders?: ProductVariantRemainder[];
|
|
657
|
-
options?: ProductVariantOption[];
|
|
658
|
-
}
|
|
659
|
-
export interface Product {
|
|
660
|
-
id: string;
|
|
661
|
-
short_id: string;
|
|
662
|
-
slug: string | null;
|
|
663
|
-
name: string | null;
|
|
664
|
-
description: string | null;
|
|
665
|
-
unit_type: UnitType;
|
|
666
|
-
weight: number | null;
|
|
667
|
-
quantity_step: number | null;
|
|
668
|
-
is_promotion_reward: boolean;
|
|
669
|
-
categories: Category[];
|
|
670
|
-
images: Media[];
|
|
671
|
-
variants?: ProductVariant[];
|
|
672
|
-
features?: Feature[];
|
|
673
|
-
features_groups: FeaturesGroup[];
|
|
674
|
-
modifiers?: ProductModifier[];
|
|
675
|
-
modifiers_groups?: ProductModifiersGroup[];
|
|
676
|
-
seo?: Seo;
|
|
677
|
-
}
|
|
678
|
-
export interface ListProductsRequest extends ListRequest {
|
|
679
|
-
category_id?: string;
|
|
680
|
-
features?: {
|
|
681
|
-
[key: string]: string;
|
|
682
|
-
};
|
|
683
|
-
f?: {
|
|
684
|
-
[key: string]: string;
|
|
685
|
-
};
|
|
686
|
-
city_id?: string;
|
|
687
|
-
stock_id?: string;
|
|
688
|
-
collection_id?: string;
|
|
689
|
-
min_price?: number | string;
|
|
690
|
-
max_price?: number | string;
|
|
691
|
-
featured_categories?: boolean;
|
|
692
|
-
promotion_reward?: TernaryFilter;
|
|
693
|
-
context_type?: ProductContextType;
|
|
694
|
-
context_id?: string;
|
|
695
|
-
}
|
|
696
|
-
export interface ViewProductRequest extends InclusionRequest {
|
|
697
|
-
stock_id?: string;
|
|
698
|
-
}
|
|
699
|
-
export interface ProductVariantPriceCalculation {
|
|
700
|
-
price: number;
|
|
701
|
-
original_price: number | null;
|
|
702
|
-
discount: Discount | null;
|
|
703
|
-
modifiers_hash: string | null;
|
|
704
|
-
}
|
|
705
|
-
export interface ProductModifiersRequest {
|
|
706
|
-
modifier_id: string;
|
|
707
|
-
modifiers_group_id?: string | null;
|
|
708
|
-
quantity: number;
|
|
709
|
-
}
|
|
710
|
-
export interface ProductVariantPriceCalculationRequest {
|
|
711
|
-
city_id?: string;
|
|
712
|
-
stock_id?: string;
|
|
713
|
-
modifiers?: ProductModifiersRequest[];
|
|
714
|
-
}
|
|
715
|
-
export declare class ProductsResource extends AbstractResource {
|
|
716
|
-
getProducts(storeId: string, request?: ListProductsRequest): Promise<PaginatedResponse<Product>>;
|
|
717
|
-
getProduct(storeId: string, productId: string, request?: ViewProductRequest): Promise<Product>;
|
|
718
|
-
getProductVariantPrice(storeId: string, productId: string, variantId: string, request: ProductVariantPriceCalculationRequest): Promise<ProductVariantPriceCalculation>;
|
|
719
|
-
}
|
|
720
|
-
export interface Stock {
|
|
721
|
-
id: string;
|
|
722
|
-
name: string | null;
|
|
723
|
-
description: string | null;
|
|
724
|
-
address: string | null;
|
|
725
|
-
coordinates: GeoLocation | null;
|
|
726
|
-
links: Contact[];
|
|
727
|
-
phones: Phone[];
|
|
728
|
-
schedule: Schedule | null;
|
|
729
|
-
}
|
|
730
|
-
export interface DeliveryZone {
|
|
731
|
-
id: string;
|
|
732
|
-
name: string | null;
|
|
733
|
-
coordinates: GeoLocation[];
|
|
734
|
-
description: string | null;
|
|
735
|
-
color: string | null;
|
|
736
|
-
min_price: number | null;
|
|
737
|
-
free_delivery_price: number | null;
|
|
738
|
-
delivery_price: number | null;
|
|
739
|
-
delivery_time: string | null;
|
|
740
|
-
}
|
|
741
|
-
export interface City {
|
|
742
|
-
id: string;
|
|
743
|
-
is_default: boolean;
|
|
744
|
-
name: string | null;
|
|
745
|
-
timezone: string;
|
|
746
|
-
coordinates: GeoLocation | null;
|
|
747
|
-
stocks: Stock[];
|
|
748
|
-
delivery_zones: DeliveryZone[];
|
|
749
|
-
}
|
|
750
|
-
export interface StoreSettings {
|
|
751
|
-
country: string;
|
|
752
|
-
currency: string;
|
|
753
|
-
orders: {
|
|
754
|
-
authentication_method: OrderAuthenticationMethod;
|
|
755
|
-
use_early_delivery: boolean;
|
|
756
|
-
addresses_provider: AddressesProvider;
|
|
757
|
-
};
|
|
758
|
-
products: {
|
|
759
|
-
use_stock_filter: boolean;
|
|
760
|
-
};
|
|
761
|
-
loyalty: {
|
|
762
|
-
enabled: boolean;
|
|
763
|
-
};
|
|
764
|
-
recaptcha: {
|
|
765
|
-
actions: RecaptchaAction[];
|
|
766
|
-
key: string;
|
|
767
|
-
} | null;
|
|
768
|
-
websockets: {
|
|
769
|
-
app_id: string;
|
|
770
|
-
app_key: string;
|
|
771
|
-
options: {
|
|
772
|
-
host: string;
|
|
773
|
-
port: number;
|
|
774
|
-
};
|
|
775
|
-
} | null;
|
|
776
|
-
}
|
|
777
|
-
export interface Store {
|
|
778
|
-
id: string;
|
|
779
|
-
name: string;
|
|
780
|
-
domain: string | null;
|
|
781
|
-
app_store_url: string | null;
|
|
782
|
-
google_play_url: string | null;
|
|
783
|
-
logo: Media | null;
|
|
784
|
-
square_logo: Media | null;
|
|
785
|
-
links: Contact[];
|
|
786
|
-
phones: Phone[];
|
|
787
|
-
cities: City[];
|
|
788
|
-
settings: StoreSettings;
|
|
789
|
-
}
|
|
790
|
-
export declare class StoreResource extends AbstractResource {
|
|
791
|
-
getStore(storeId: string): Promise<Store>;
|
|
792
|
-
getStoreByBundleId(bundleId: string): Promise<Store>;
|
|
793
|
-
}
|
|
794
|
-
export type OrderCredentials = string | {
|
|
795
|
-
id: string;
|
|
796
|
-
token: string;
|
|
797
|
-
api_token?: string;
|
|
798
|
-
};
|
|
799
|
-
export declare enum DeliveryMethod {
|
|
800
|
-
Delivery = "delivery",
|
|
801
|
-
Pickup = "pickup",
|
|
802
|
-
OnPremise = "on_premise"
|
|
803
|
-
}
|
|
804
|
-
export interface OrderStatusKind {
|
|
805
|
-
Pending: 'pending';
|
|
806
|
-
AwaitingPayment: 'awaiting_payment';
|
|
807
|
-
Submitted: 'submitted';
|
|
808
|
-
Exported: 'exported';
|
|
809
|
-
Packing: 'packing';
|
|
810
|
-
Ready: 'ready';
|
|
811
|
-
AwaitingDelivery: 'awaiting_delivery';
|
|
812
|
-
Delivering: 'delivering';
|
|
813
|
-
Delivered: 'delivered';
|
|
814
|
-
Rejected: 'rejected';
|
|
815
|
-
Cancelled: 'cancelled';
|
|
816
|
-
Completed: 'completed';
|
|
817
|
-
Custom: 'custom';
|
|
818
|
-
}
|
|
819
|
-
export declare enum OrderPaymentTransactionType {
|
|
820
|
-
Payment = "payment",
|
|
821
|
-
Refund = "refund"
|
|
822
|
-
}
|
|
823
|
-
export declare enum PaymentMethod {
|
|
824
|
-
Cash = "cash",
|
|
825
|
-
CreditCard = "credit-card",
|
|
826
|
-
CloudPayments = "cloudpayments",
|
|
827
|
-
CardToken = "card_token",
|
|
828
|
-
Bonuses = "bonuses"
|
|
829
|
-
}
|
|
830
|
-
export declare enum OrderPaymentTransactionStatus {
|
|
831
|
-
Pending = "pending",
|
|
832
|
-
Confirmed = "confirmed",
|
|
833
|
-
Cancelled = "cancelled",
|
|
834
|
-
PendingRefund = "pending_refund",
|
|
835
|
-
Refunding = "refunding",
|
|
836
|
-
Refunded = "refunded"
|
|
837
|
-
}
|
|
838
|
-
export interface OrderStatus {
|
|
839
|
-
id: string;
|
|
840
|
-
kind: OrderStatusKind;
|
|
841
|
-
name: string | null;
|
|
842
|
-
}
|
|
843
|
-
export interface OrderStatusChange extends OrderStatus {
|
|
844
|
-
transitioned_at: string;
|
|
845
|
-
}
|
|
846
|
-
export interface OrderStatusProgress extends OrderStatus {
|
|
847
|
-
transitioned_at: string | null;
|
|
848
|
-
}
|
|
849
|
-
export interface CashPaymentMeta {
|
|
850
|
-
change?: number | null;
|
|
851
|
-
bill?: number | null;
|
|
852
|
-
}
|
|
853
|
-
export declare enum CloudpaymentsChargeType {
|
|
854
|
-
Auth = "auth",
|
|
855
|
-
Charge = "charge"
|
|
856
|
-
}
|
|
857
|
-
export interface CloudpaymentsPaymentMeta {
|
|
858
|
-
widget: {
|
|
859
|
-
publicId: string;
|
|
860
|
-
description: string;
|
|
861
|
-
amount: number;
|
|
862
|
-
currency: string;
|
|
863
|
-
invoiceId: string;
|
|
864
|
-
accountId?: string;
|
|
865
|
-
skin: string;
|
|
866
|
-
};
|
|
867
|
-
payment_page_url: string;
|
|
868
|
-
charge_type: CloudpaymentsChargeType;
|
|
869
|
-
charged_as: CloudpaymentsChargeType | null;
|
|
870
|
-
}
|
|
871
|
-
export interface OrderPaymentTransaction {
|
|
872
|
-
id: string;
|
|
873
|
-
type: OrderPaymentTransactionType;
|
|
874
|
-
status: OrderPaymentTransactionStatus;
|
|
875
|
-
method: PaymentMethod;
|
|
876
|
-
amount: number;
|
|
877
|
-
created_at: string;
|
|
878
|
-
confirmed_at: string | null;
|
|
879
|
-
authorization_confirmed_at: string | null;
|
|
880
|
-
cancelled_at: string | null;
|
|
881
|
-
refunded_at: string | null;
|
|
882
|
-
refund_failed_at: string | null;
|
|
883
|
-
transaction_meta: CashPaymentMeta | CloudpaymentsPaymentMeta | null;
|
|
884
|
-
}
|
|
885
|
-
export interface OrderProductVariantModifier {
|
|
886
|
-
id: string;
|
|
887
|
-
modifiers_group_id: string | null;
|
|
888
|
-
quantity: number;
|
|
889
|
-
total_price: number | null;
|
|
890
|
-
unit_price: number | null;
|
|
891
|
-
original_price: number | null;
|
|
892
|
-
original_unit_price: number | null;
|
|
893
|
-
modifier?: Modifier | null;
|
|
894
|
-
modifiers_group?: BasicModifiersGroup | null;
|
|
895
|
-
}
|
|
896
|
-
export interface OrderProductVariant {
|
|
897
|
-
id: string;
|
|
898
|
-
product_id: string;
|
|
899
|
-
product_variant_id: string;
|
|
900
|
-
stock_id: string | null;
|
|
901
|
-
promotion: {
|
|
902
|
-
id: string;
|
|
903
|
-
reward_id: string;
|
|
904
|
-
} | null;
|
|
905
|
-
quantity: number;
|
|
906
|
-
has_measured_quantity: boolean;
|
|
907
|
-
measured_quantity: number | null;
|
|
908
|
-
total_price: number;
|
|
909
|
-
original_total_price: number | null;
|
|
910
|
-
unit_price: number;
|
|
911
|
-
original_unit_price: number | null;
|
|
912
|
-
discount: Discount | null;
|
|
913
|
-
modifiers_hash: string | null;
|
|
914
|
-
product?: Product;
|
|
915
|
-
variant?: ProductVariant;
|
|
916
|
-
modifiers?: OrderProductVariantModifier[];
|
|
917
|
-
}
|
|
918
|
-
export interface Order {
|
|
919
|
-
id: string;
|
|
920
|
-
token: string;
|
|
921
|
-
number: string | null;
|
|
922
|
-
delivery_method: DeliveryMethod | null;
|
|
923
|
-
total_price: number;
|
|
924
|
-
original_total_price: number | null;
|
|
925
|
-
discount: Discount | null;
|
|
926
|
-
notes: string | null;
|
|
927
|
-
created_at: string;
|
|
928
|
-
submitted_at: string | null;
|
|
929
|
-
deliver_at: string | null;
|
|
930
|
-
meta_data: {
|
|
931
|
-
deliver_at?: string | null;
|
|
932
|
-
on_premise?: {
|
|
933
|
-
table: string | null;
|
|
934
|
-
} | null;
|
|
935
|
-
} | null;
|
|
936
|
-
status: OrderStatusChange | null;
|
|
937
|
-
variants: OrderProductVariant[];
|
|
938
|
-
city: City | null;
|
|
939
|
-
stock: Stock | null;
|
|
940
|
-
customer?: Customer | null;
|
|
941
|
-
delivery_address?: DeliveryAddress | null;
|
|
942
|
-
delivery_zone?: DeliveryZone;
|
|
943
|
-
statuses?: OrderStatus[];
|
|
944
|
-
progress?: OrderStatusProgress[];
|
|
945
|
-
payments?: OrderPaymentTransaction[];
|
|
946
|
-
}
|
|
947
|
-
export interface OrderPaymentMethod {
|
|
948
|
-
id: PaymentMethod;
|
|
949
|
-
name: string;
|
|
950
|
-
meta?: {
|
|
951
|
-
payment_page_url?: string;
|
|
952
|
-
};
|
|
953
|
-
token?: {
|
|
954
|
-
id: string;
|
|
955
|
-
type: string;
|
|
956
|
-
first_six: string;
|
|
957
|
-
last_four: string;
|
|
958
|
-
};
|
|
959
|
-
}
|
|
960
|
-
export interface OrderDeliveryMethod {
|
|
961
|
-
id: DeliveryMethod;
|
|
962
|
-
name: string;
|
|
963
|
-
min_price: number | null;
|
|
964
|
-
delivery_price: number | null;
|
|
965
|
-
discount: {
|
|
966
|
-
type: DiscountType;
|
|
967
|
-
value: number;
|
|
968
|
-
} | null;
|
|
969
|
-
}
|
|
970
|
-
export declare enum OrderOptionKind {
|
|
971
|
-
PersonsCount = "persons_count",
|
|
972
|
-
DeliveryTime = "delivery_time"
|
|
973
|
-
}
|
|
974
|
-
export interface OrderOption {
|
|
975
|
-
id: string;
|
|
976
|
-
kind: OrderOptionKind;
|
|
977
|
-
meta: any;
|
|
978
|
-
}
|
|
979
|
-
export interface OrderSettings {
|
|
980
|
-
payment_methods: OrderPaymentMethod[];
|
|
981
|
-
delivery_methods: OrderDeliveryMethod[];
|
|
982
|
-
options: OrderOption[];
|
|
983
|
-
}
|
|
984
|
-
export declare enum OrderCartCheckerResultReason {
|
|
985
|
-
PriceMismatch = "price_mismatch",
|
|
986
|
-
OutOfStock = "out_of_stock",
|
|
987
|
-
Unavailable = "unavailable"
|
|
988
|
-
}
|
|
989
|
-
export declare enum OrderCartCheckerResultAction {
|
|
990
|
-
None = "none",
|
|
991
|
-
Cleanup = "cleanup"
|
|
992
|
-
}
|
|
993
|
-
export interface OrderCartCheckerResult {
|
|
994
|
-
order_variants: {
|
|
995
|
-
id: string;
|
|
996
|
-
product_variant_id: string;
|
|
997
|
-
quantity: number;
|
|
998
|
-
reasons: OrderCartCheckerResultReason[];
|
|
999
|
-
}[];
|
|
1000
|
-
action: OrderCartCheckerResultAction;
|
|
1001
|
-
}
|
|
1002
|
-
export interface ListOrdersRequest extends ListRequest {
|
|
1003
|
-
submitted_from?: string;
|
|
1004
|
-
submitted_till?: string;
|
|
1005
|
-
order_status_id?: string;
|
|
1006
|
-
city_id?: string;
|
|
1007
|
-
submission_period?: string;
|
|
1008
|
-
}
|
|
1009
|
-
export interface CreateOrderRequest {
|
|
1010
|
-
city_id: string;
|
|
1011
|
-
}
|
|
1012
|
-
export interface OrderProductVariantRequest {
|
|
1013
|
-
product_variant_id: string;
|
|
1014
|
-
quantity: number;
|
|
1015
|
-
promotion_id?: string;
|
|
1016
|
-
promotion_reward_id?: string;
|
|
1017
|
-
modifiers?: ProductModifiersRequest[];
|
|
1018
|
-
}
|
|
1019
|
-
export interface SetOrderCustomerRequest {
|
|
1020
|
-
phone?: PhoneRequest;
|
|
1021
|
-
first_name?: string;
|
|
1022
|
-
last_name?: string;
|
|
1023
|
-
gender?: Gender;
|
|
1024
|
-
birth_date?: string;
|
|
1025
|
-
}
|
|
1026
|
-
export interface SetOrderDeliveryRequest {
|
|
1027
|
-
delivery_method: DeliveryMethod;
|
|
1028
|
-
delivery_address?: ExistedDeliveryAddressRequest | DadataDeliveryAddressRequest | ManualDeliveryAddressRequest;
|
|
1029
|
-
stock_id?: string;
|
|
1030
|
-
on_premise?: {
|
|
1031
|
-
table: string;
|
|
1032
|
-
};
|
|
1033
|
-
deliver_at?: string;
|
|
1034
|
-
}
|
|
1035
|
-
export interface OrderPaymentMethodRequest {
|
|
1036
|
-
method: PaymentMethod;
|
|
1037
|
-
amount?: number | string;
|
|
1038
|
-
bill?: number | string;
|
|
1039
|
-
save_card?: boolean;
|
|
1040
|
-
card_token_id?: string;
|
|
1041
|
-
}
|
|
1042
|
-
export interface SetOrderPaymentsRequest {
|
|
1043
|
-
payments: OrderPaymentMethodRequest[];
|
|
1044
|
-
}
|
|
1045
|
-
export interface OrderCheckoutBonusesPreview {
|
|
1046
|
-
bonuses: number;
|
|
1047
|
-
unpaid: number;
|
|
1048
|
-
}
|
|
1049
|
-
export interface OrderCheckoutTotalPayment {
|
|
1050
|
-
id: string;
|
|
1051
|
-
method: PaymentMethod;
|
|
1052
|
-
amount: number;
|
|
1053
|
-
bill?: number;
|
|
1054
|
-
change?: number;
|
|
1055
|
-
save_card?: boolean;
|
|
1056
|
-
card_token_id?: string;
|
|
1057
|
-
}
|
|
1058
|
-
export interface OrderCheckoutTotal {
|
|
1059
|
-
min_price: number | null;
|
|
1060
|
-
subtotal: number;
|
|
1061
|
-
original_subtotal: number | null;
|
|
1062
|
-
delivery_price: number | null;
|
|
1063
|
-
delivery_discount: number | null;
|
|
1064
|
-
discount: Discount | null;
|
|
1065
|
-
total: number;
|
|
1066
|
-
original_total: number | null;
|
|
1067
|
-
max_bonuses_payment: number | null;
|
|
1068
|
-
cashback: number | null;
|
|
1069
|
-
payments: OrderCheckoutTotalPayment[];
|
|
1070
|
-
}
|
|
1071
|
-
export interface OrderCheckoutRequest {
|
|
1072
|
-
notes?: string;
|
|
1073
|
-
persons_count?: string | number;
|
|
1074
|
-
}
|
|
1075
|
-
export declare enum ConfirmationMethod {
|
|
1076
|
-
Sms = "sms",
|
|
1077
|
-
Call = "call"
|
|
1078
|
-
}
|
|
1079
|
-
export interface OrderCheckoutResult {
|
|
1080
|
-
confirmation: {
|
|
1081
|
-
required: boolean;
|
|
1082
|
-
method: ConfirmationMethod | null;
|
|
1083
|
-
phone: Phone | null;
|
|
1084
|
-
};
|
|
1085
|
-
online_payment: {
|
|
1086
|
-
required: boolean;
|
|
1087
|
-
payment_page_url: string | null;
|
|
1088
|
-
};
|
|
1089
|
-
order: Order;
|
|
1090
|
-
}
|
|
1091
|
-
export interface ConfirmOrderRequest {
|
|
1092
|
-
code: string | number;
|
|
1093
|
-
}
|
|
1094
|
-
export interface OrderPromotionReward {
|
|
1095
|
-
id: string;
|
|
1096
|
-
promotion_id: string;
|
|
1097
|
-
promotion_reward_id: string;
|
|
1098
|
-
item_id: string | null;
|
|
1099
|
-
amount: number | null;
|
|
1100
|
-
total_amount: number | null;
|
|
1101
|
-
count: number;
|
|
1102
|
-
}
|
|
1103
|
-
export declare class OrdersResource extends AbstractResource {
|
|
1104
|
-
protected getOrderUrl(storeId: string, credentials: OrderCredentials, path: string, request?: any): string;
|
|
1105
|
-
protected getApiToken(credentials: OrderCredentials): undefined | string;
|
|
1106
|
-
getOrders(storeId: string, request?: ListOrdersRequest, apiToken?: string | null): Promise<PaginatedResponse<Order>>;
|
|
1107
|
-
createOrder(storeId: string, request: CreateOrderRequest, apiToken?: string | null): Promise<Order>;
|
|
1108
|
-
getOrder(storeId: string, credentials: OrderCredentials, request?: InclusionRequest): Promise<Order>;
|
|
1109
|
-
getOrderSettings(storeId: string, credentials: OrderCredentials): Promise<OrderSettings>;
|
|
1110
|
-
addProductVariantToOrder(storeId: string, credentials: OrderCredentials, request: OrderProductVariantRequest): Promise<Order>;
|
|
1111
|
-
removeProductVariantFromOrder(storeId: string, credentials: OrderCredentials, request: OrderProductVariantRequest): Promise<Order>;
|
|
1112
|
-
checkProducts(storeId: string, credentials: OrderCredentials): Promise<OrderCartCheckerResult>;
|
|
1113
|
-
setOrderCustomer(storeId: string, credentials: OrderCredentials, request: SetOrderCustomerRequest): Promise<boolean>;
|
|
1114
|
-
setOrderDeliveryMethod(storeId: string, credentials: OrderCredentials, request: SetOrderDeliveryRequest): Promise<Order>;
|
|
1115
|
-
setOrderPayments(storeId: string, credentials: OrderCredentials, request: SetOrderPaymentsRequest): Promise<Order>;
|
|
1116
|
-
getOrderBonusesPreview(storeId: string, credentials: OrderCredentials, amount: number | string): Promise<OrderCheckoutBonusesPreview>;
|
|
1117
|
-
getOrderTotal(storeId: string, credentials: OrderCredentials): Promise<OrderCheckoutTotal>;
|
|
1118
|
-
checkoutOrder(storeId: string, credentials: OrderCredentials, request: OrderCheckoutRequest): Promise<OrderCheckoutResult>;
|
|
1119
|
-
confirmOrder(storeId: string, credentials: OrderCredentials, request: ConfirmOrderRequest): Promise<boolean>;
|
|
1120
|
-
resendOrderConfirmationCode(storeId: string, credentials: OrderCredentials): Promise<boolean>;
|
|
1121
|
-
getOrderBonusesTransactions(storeId: string, credentials: OrderCredentials, request?: ListBonusesTransactionsRequest): Promise<PaginatedResponse<BonusesTransaction>>;
|
|
1122
|
-
getOrderCashbackTransaction(storeId: string, credentials: OrderCredentials): Promise<BonusesTransaction>;
|
|
1123
|
-
dispatchPromotionsChecker(storeId: string, credentials: OrderCredentials): Promise<boolean>;
|
|
1124
|
-
getOrderPromotionRewards(storeId: string, credentials: OrderCredentials): Promise<OrderPromotionReward>;
|
|
1125
|
-
}
|
|
1126
|
-
export enum AddressSuggestionsProvider {
|
|
1127
|
-
DADATA = 'dadata',
|
|
1128
|
-
}
|
|
1129
|
-
export interface DadataAddressSuggestion {
|
|
1130
|
-
value: string | null;
|
|
1131
|
-
unrestricted_value: string | null;
|
|
1132
|
-
data: {
|
|
1133
|
-
postal_code: string | null;
|
|
1134
|
-
country: string | null;
|
|
1135
|
-
country_code: string | null;
|
|
1136
|
-
federal_district: string | null;
|
|
1137
|
-
region_fias_id: string | null;
|
|
1138
|
-
region_kladr_id: string | null;
|
|
1139
|
-
region_iso_code: string | null;
|
|
1140
|
-
region_with_type: string | null;
|
|
1141
|
-
region_type: string | null;
|
|
1142
|
-
region_type_full: string | null;
|
|
1143
|
-
region: string | null;
|
|
1144
|
-
area_fias_id: string | null;
|
|
1145
|
-
area_kladr_id: string | null;
|
|
1146
|
-
area_with_type: string | null;
|
|
1147
|
-
area_type: string | null;
|
|
1148
|
-
area_type_full: string | null;
|
|
1149
|
-
area: string | null;
|
|
1150
|
-
city_fias_id: string | null;
|
|
1151
|
-
city_kladr_id: string | null;
|
|
1152
|
-
city_with_type: string | null;
|
|
1153
|
-
city_type: string | null;
|
|
1154
|
-
city_type_full: string | null;
|
|
1155
|
-
city: string | null;
|
|
1156
|
-
city_area: string | null;
|
|
1157
|
-
city_district_fias_id: string | null;
|
|
1158
|
-
city_district_with_type: string | null;
|
|
1159
|
-
city_district_type: string | null;
|
|
1160
|
-
city_district_type_full: string | null;
|
|
1161
|
-
city_district: string | null;
|
|
1162
|
-
settlement_fias_id: string | null;
|
|
1163
|
-
settlement_kladr_id: string | null;
|
|
1164
|
-
settlement_with_type: string | null;
|
|
1165
|
-
settlement_type: string | null;
|
|
1166
|
-
settlement_type_full: string | null;
|
|
1167
|
-
settlement: string | null;
|
|
1168
|
-
street_fias_id: string | null;
|
|
1169
|
-
street_kladr_id: string | null;
|
|
1170
|
-
street_with_type: string | null;
|
|
1171
|
-
street_type: string | null;
|
|
1172
|
-
street_type_full: string | null;
|
|
1173
|
-
street: string | null;
|
|
1174
|
-
stead_fias_id: string | null;
|
|
1175
|
-
stead_cadnum: string | null;
|
|
1176
|
-
stead_type: string | null;
|
|
1177
|
-
stead_type_full: string | null;
|
|
1178
|
-
stead: string | null;
|
|
1179
|
-
house_fias_id: string | null;
|
|
1180
|
-
house_kladr_id: string | null;
|
|
1181
|
-
house_cadnum: string | null;
|
|
1182
|
-
house_type: string | null;
|
|
1183
|
-
house_type_full: string | null;
|
|
1184
|
-
house: string | null;
|
|
1185
|
-
block_type: string | null;
|
|
1186
|
-
block_type_full: string | null;
|
|
1187
|
-
block: string | null;
|
|
1188
|
-
flat_fias_id: string | null;
|
|
1189
|
-
flat_cadnum: string | null;
|
|
1190
|
-
flat_type: string | null;
|
|
1191
|
-
flat_type_full: string | null;
|
|
1192
|
-
flat: string | null;
|
|
1193
|
-
flat_area: string | null;
|
|
1194
|
-
square_meter_price: string | null;
|
|
1195
|
-
flat_price: string | null;
|
|
1196
|
-
room_fias_id: string | null;
|
|
1197
|
-
room_cadnum: string | null;
|
|
1198
|
-
room_type: string | null;
|
|
1199
|
-
room_type_full: string | null;
|
|
1200
|
-
postal_box: string | null;
|
|
1201
|
-
fias_id: string | null;
|
|
1202
|
-
fias_level: string | null;
|
|
1203
|
-
fias_actuality_state: string | null;
|
|
1204
|
-
kladr_id: string | null;
|
|
1205
|
-
geoname_id: string | null;
|
|
1206
|
-
capital_marker: string | null;
|
|
1207
|
-
okato: string | null;
|
|
1208
|
-
oktmo: string | null;
|
|
1209
|
-
tax_office: string | null;
|
|
1210
|
-
tax_office_legal: string | null;
|
|
1211
|
-
timezone: string | null;
|
|
1212
|
-
geo_lat: string | null;
|
|
1213
|
-
geo_lon: string | null;
|
|
1214
|
-
qc_geo: string | null;
|
|
1215
|
-
beltway_hit: string | null;
|
|
1216
|
-
beltway_distance: string | null;
|
|
1217
|
-
metro?: {
|
|
1218
|
-
name: string | null;
|
|
1219
|
-
line: string | null;
|
|
1220
|
-
distance: string | null;
|
|
1221
|
-
}[] | null;
|
|
1222
|
-
};
|
|
1223
|
-
}
|
|
1224
|
-
export interface AddressSuggestions {
|
|
1225
|
-
provider: AddressSuggestionsProvider;
|
|
1226
|
-
suggestions: DadataAddressSuggestion[];
|
|
1227
|
-
}
|
|
1228
|
-
export interface AddressSuggestionsRequest {
|
|
1229
|
-
query: string;
|
|
1230
|
-
city_id?: string;
|
|
1231
|
-
count?: number;
|
|
1232
|
-
}
|
|
1233
|
-
export declare class AddressesResource extends AbstractResource {
|
|
1234
|
-
getAddressSuggestions(storeId: string, request: AddressSuggestionsRequest): Promise<AddressSuggestions>;
|
|
1235
|
-
}
|
|
1236
|
-
export interface AbstractRegistrationRequest {
|
|
1237
|
-
phone: PhoneRequest;
|
|
1238
|
-
password?: string;
|
|
1239
|
-
first_name?: string;
|
|
1240
|
-
last_name?: string;
|
|
1241
|
-
gender?: Gender;
|
|
1242
|
-
birth_date?: string;
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
export interface RegistrationRequest extends AbstractRegistrationRequest {
|
|
1246
|
-
referrer_code?: string;
|
|
1247
|
-
referrer_id?: string;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
export interface ConfirmRegistrationRequest extends AbstractRegistrationRequest {
|
|
1251
|
-
code: string | number;
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
export interface AuthConfirmationStatus {
|
|
1255
|
-
confirmation_required: boolean;
|
|
1256
|
-
queued_to: string;
|
|
1257
|
-
method: ConfirmationMethod;
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
export interface AuthResult {
|
|
1261
|
-
token: string;
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
export interface ResendAuthConfirmationRequest {
|
|
1265
|
-
phone: PhoneRequest;
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
export interface DispatchPasswordResetRequest {
|
|
1269
|
-
phone: PhoneRequest;
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
export interface ResetPasswordRequest {
|
|
1273
|
-
phone: PhoneRequest;
|
|
1274
|
-
code: string | number;
|
|
1275
|
-
password: string;
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
export interface LoginRequest {
|
|
1279
|
-
phone: PhoneRequest;
|
|
1280
|
-
password: string;
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
|
-
export interface CheckPhoneRequest {
|
|
1284
|
-
phone: PhoneRequest;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
export interface PhoneCheckResult {
|
|
1288
|
-
registered: boolean;
|
|
1289
|
-
confirmed: boolean;
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
export declare class AuthenticationResource extends AbstractResource {
|
|
1293
|
-
checkPhone(storeId: string, request: CheckPhoneRequest): Promise<PhoneCheckResult>;
|
|
1294
|
-
register(storeId: string, request: RegistrationRequest): Promise<AuthConfirmationStatus>;
|
|
1295
|
-
confirmRegistration(storeId: string, request: ConfirmRegistrationRequest): Promise<AuthResult>;
|
|
1296
|
-
resendRegistrationConfirmation(storeId: string, request: ResendAuthConfirmationRequest): Promise<AuthConfirmationStatus>;
|
|
1297
|
-
login(storeId: string, request: LoginRequest): Promise<AuthResult>;
|
|
1298
|
-
dispatchPasswordReset(storeId: string, request: DispatchPasswordResetRequest): Promise<AuthConfirmationStatus>;
|
|
1299
|
-
resetPassword(storeId: string, request: ResetPasswordRequest): Promise<AuthResult>;
|
|
1300
|
-
}
|