@wix/auto_sdk_ecom_order-fulfillments 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.context.d.ts +18 -0
  11. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.context.js +24 -0
  12. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.context.js.map +1 -0
  13. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.http.d.ts +47 -0
  14. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.http.js +256 -0
  15. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.http.js.map +1 -0
  16. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.meta.d.ts +28 -0
  17. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.meta.js +148 -0
  18. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.meta.js.map +1 -0
  19. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.public.d.ts +80 -0
  20. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.public.js +59 -0
  21. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.public.js.map +1 -0
  22. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.types.d.ts +431 -0
  23. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.types.js +34 -0
  24. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.types.js.map +1 -0
  25. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.universal.d.ts +710 -0
  26. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.universal.js +362 -0
  27. package/build/cjs/src/ecom-v1-fulfillments-order-fulfillments.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.context.d.ts +18 -0
  39. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.context.js +18 -0
  40. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.context.js.map +1 -0
  41. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.http.d.ts +47 -0
  42. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.http.js +247 -0
  43. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.http.js.map +1 -0
  44. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.meta.d.ts +28 -0
  45. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.meta.js +116 -0
  46. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.meta.js.map +1 -0
  47. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.public.d.ts +80 -0
  48. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.public.js +47 -0
  49. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.public.js.map +1 -0
  50. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.types.d.ts +431 -0
  51. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.types.js +31 -0
  52. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.types.js.map +1 -0
  53. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.universal.d.ts +710 -0
  54. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.universal.js +330 -0
  55. package/build/es/src/ecom-v1-fulfillments-order-fulfillments.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.context.d.ts +18 -0
  66. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.context.js +24 -0
  67. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.context.js.map +1 -0
  68. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.http.d.ts +47 -0
  69. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.http.js +256 -0
  70. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.http.js.map +1 -0
  71. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.meta.d.ts +28 -0
  72. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.meta.js +148 -0
  73. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.meta.js.map +1 -0
  74. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.public.d.ts +80 -0
  75. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.public.js +59 -0
  76. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.public.js.map +1 -0
  77. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.types.d.ts +431 -0
  78. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.types.js +34 -0
  79. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.types.js.map +1 -0
  80. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.universal.d.ts +710 -0
  81. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.universal.js +362 -0
  82. package/build/internal/cjs/src/ecom-v1-fulfillments-order-fulfillments.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.context.d.ts +18 -0
  93. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.context.js +18 -0
  94. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.context.js.map +1 -0
  95. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.http.d.ts +47 -0
  96. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.http.js +247 -0
  97. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.http.js.map +1 -0
  98. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.meta.d.ts +28 -0
  99. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.meta.js +116 -0
  100. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.meta.js.map +1 -0
  101. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.public.d.ts +80 -0
  102. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.public.js +47 -0
  103. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.public.js.map +1 -0
  104. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.types.d.ts +431 -0
  105. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.types.js +31 -0
  106. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.types.js.map +1 -0
  107. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.universal.d.ts +710 -0
  108. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.universal.js +330 -0
  109. package/build/internal/es/src/ecom-v1-fulfillments-order-fulfillments.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,710 @@
1
+ export interface OrderWithFulfillments {
2
+ /** Order ID. */
3
+ orderId?: string;
4
+ /** Fulfillments associated with the order. */
5
+ fulfillments?: Fulfillment[];
6
+ }
7
+ /** for now, this is a sub-object of Orders, so can refer to order line items by id. */
8
+ export interface Fulfillment extends FulfillmentFulfillmentInfoOneOf {
9
+ /** Tracking info. */
10
+ trackingInfo?: FulfillmentTrackingInfo;
11
+ /** Custom fulfillment info. */
12
+ customInfo?: CustomFulfillmentInfo;
13
+ /**
14
+ * Fulfillment ID.
15
+ * @readonly
16
+ */
17
+ _id?: string | null;
18
+ /**
19
+ * Fulfillment creation date and time in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.
20
+ * @readonly
21
+ */
22
+ _createdDate?: Date | null;
23
+ /** Line items being fulfilled. */
24
+ lineItems?: FulfillmentLineItem[];
25
+ /**
26
+ * Fulfillment status.
27
+ *
28
+ * Supported values:
29
+ * + `"Pending"`
30
+ * + `"Accepted"`
31
+ * + `"Ready"`
32
+ * + `"In_Delivery"`
33
+ * + `"Fulfilled"`
34
+ */
35
+ status?: string | null;
36
+ /** Fulfillment handling complete. */
37
+ completed?: boolean | null;
38
+ }
39
+ /** @oneof */
40
+ export interface FulfillmentFulfillmentInfoOneOf {
41
+ /** Tracking info. */
42
+ trackingInfo?: FulfillmentTrackingInfo;
43
+ /** Custom fulfillment info. */
44
+ customInfo?: CustomFulfillmentInfo;
45
+ }
46
+ export interface FulfillmentLineItem {
47
+ /** Line item ID (mirrors the ID of the order line item). */
48
+ _id?: string;
49
+ /**
50
+ * Line item quantity.
51
+ * * If this property isn't passed on creation, it defaults to the number of items not already linked to a fulfillment.
52
+ * * If the order does not have the requested quantity of line items available to add to this fulfillment, the fulfillment will not be created and an error is returned.
53
+ *
54
+ * Min: `1`
55
+ * Max: `100000`
56
+ */
57
+ quantity?: number | null;
58
+ }
59
+ export interface FulfillmentTrackingInfo {
60
+ /** Shipping/delivery tracking number. */
61
+ trackingNumber?: string | null;
62
+ /**
63
+ * Shipping provider. Using one of the following shipping providers will allow for auto-filling the tracking link:
64
+ * * `'fedex'`
65
+ * * `'ups'`
66
+ * * `'usps'`
67
+ * * `'dhl'`
68
+ * * `'canadaPost'`
69
+ */
70
+ shippingProvider?: string | null;
71
+ /** Tracking link. Auto-filled if a predefined shipping provider is used, otherwise provided on creation. */
72
+ trackingLink?: string | null;
73
+ }
74
+ export interface CustomFulfillmentInfo {
75
+ /** Custom fulfillment info in key:value form. */
76
+ fieldsData?: Record<string, string>;
77
+ }
78
+ export interface FulfillmentCreated {
79
+ /** Order ID (auto generated upon order creation). */
80
+ orderId?: string;
81
+ /** ID of the newly created fulfillment. */
82
+ fulfillmentId?: string;
83
+ /** Fulfillment creation date and time. */
84
+ dateCreated?: Date | null;
85
+ /** Buyer information. */
86
+ buyerInfo?: BuyerInfo;
87
+ /** Order fulfillment status. */
88
+ fulfillmentStatus?: FulfillmentStatus;
89
+ /** Fulfillment tracking information. */
90
+ trackingInfo?: V2FulfillmentTrackingInfo;
91
+ }
92
+ /** Buyer Info */
93
+ export interface BuyerInfo {
94
+ /** Wix customer ID */
95
+ _id?: string | null;
96
+ /**
97
+ * Deprecated (use identityType instead)
98
+ * @readonly
99
+ * @deprecated
100
+ */
101
+ type?: IdentityType;
102
+ /** Customer type */
103
+ identityType?: IdentityType;
104
+ /**
105
+ * Customer's first name
106
+ * @readonly
107
+ */
108
+ firstName?: string;
109
+ /**
110
+ * Customer's last name
111
+ * @readonly
112
+ */
113
+ lastName?: string;
114
+ /**
115
+ * Customer's phone number
116
+ * @readonly
117
+ */
118
+ phone?: string | null;
119
+ /**
120
+ * Customer's email address
121
+ * @readonly
122
+ */
123
+ email?: string;
124
+ }
125
+ export declare enum IdentityType {
126
+ UNSPECIFIED_IDENTITY_TYPE = "UNSPECIFIED_IDENTITY_TYPE",
127
+ /** Site member */
128
+ MEMBER = "MEMBER",
129
+ /** Contact */
130
+ CONTACT = "CONTACT"
131
+ }
132
+ export declare enum FulfillmentStatus {
133
+ /** None of the order items are fulfilled */
134
+ NOT_FULFILLED = "NOT_FULFILLED",
135
+ /**
136
+ * All of the order items are fulfilled
137
+ * Orders without shipping info are fulfilled automatically
138
+ */
139
+ FULFILLED = "FULFILLED",
140
+ /** Order is canceled */
141
+ CANCELED = "CANCELED",
142
+ /** Some, but not all of the order items are fulfilled */
143
+ PARTIALLY_FULFILLED = "PARTIALLY_FULFILLED"
144
+ }
145
+ export interface V2FulfillmentTrackingInfo {
146
+ /** Tracking number. */
147
+ trackingNumber?: string;
148
+ /**
149
+ * Shipping provider. Using the following shipping providers will allow for autofilling the tracking link:
150
+ * * `fedex`
151
+ * * `ups`
152
+ * * `usps`
153
+ * * `dhl`
154
+ * * `canadaPost`
155
+ */
156
+ shippingProvider?: string;
157
+ /** Tracking link - autofilled if using a predefined shipping provider, otherwise provided on creation. */
158
+ trackingLink?: string | null;
159
+ }
160
+ export interface FulfillmentUpdated {
161
+ /** Order ID (auto generated upon order creation). */
162
+ orderId?: string;
163
+ /** ID of the updated fulfillment. */
164
+ fulfillmentId?: string;
165
+ /** Fulfillment tracking information. */
166
+ trackingInfo?: V2FulfillmentTrackingInfo;
167
+ }
168
+ export interface FulfillmentDeleted {
169
+ /** Order ID (auto generated upon order creation). */
170
+ orderId?: string;
171
+ /** ID of the deleted fulfillment. */
172
+ fulfillmentId?: string;
173
+ /** Order fulfillment status. */
174
+ fulfillmentStatus?: FulfillmentStatus;
175
+ }
176
+ export interface ListFulfillmentsForSingleOrderRequest {
177
+ /** Order ID for which to retrieve fulfillments. */
178
+ orderId: string;
179
+ }
180
+ export interface ListFulfillmentsForSingleOrderResponse {
181
+ /** List of fulfillments associated with the order. */
182
+ orderWithFulfillments?: OrderWithFulfillments;
183
+ }
184
+ export interface ListFulfillmentsForMultipleOrdersRequest {
185
+ /** List of order IDs for which to retrieve fulfillments. */
186
+ orderIds: string[];
187
+ }
188
+ export interface ListFulfillmentsForMultipleOrdersResponse {
189
+ /** List of order IDs and their associated fulfillments. */
190
+ ordersWithFulfillments?: OrderWithFulfillments[];
191
+ }
192
+ export interface CreateFulfillmentRequest {
193
+ /** Order ID. */
194
+ orderId: string;
195
+ /** Fulfillment info. */
196
+ fulfillment: Fulfillment;
197
+ }
198
+ export interface CreateFulfillmentResponse {
199
+ /** Order ID and the orders' fulfillments. */
200
+ orderWithFulfillments?: OrderWithFulfillments;
201
+ /** ID of created fulfillment. */
202
+ fulfillmentId?: string;
203
+ }
204
+ export interface UpdateFulfillmentRequest {
205
+ /** Order ID. */
206
+ orderId: string;
207
+ /** Fulfillment info to update. */
208
+ fulfillment?: Fulfillment;
209
+ }
210
+ export interface UpdateFulfillmentResponse {
211
+ /** Order ID and the orders' associated fulfillments after update. */
212
+ orderWithFulfillments?: OrderWithFulfillments;
213
+ }
214
+ export interface DeleteFulfillmentRequest {
215
+ /** Order ID. */
216
+ orderId: string;
217
+ /** ID of the fulfillment to delete. */
218
+ fulfillmentId: string;
219
+ }
220
+ export interface DeleteFulfillmentResponse {
221
+ /** Order ID and the order's associated fulfillments after deletion. */
222
+ orderWithFulfillments?: OrderWithFulfillments;
223
+ }
224
+ export interface BulkCreateFulfillmentRequest {
225
+ /** List of order IDs and their associated fulfillments' info. */
226
+ ordersWithFulfillments: BulkCreateOrderWithFulfillments[];
227
+ }
228
+ export interface BulkCreateOrderWithFulfillments {
229
+ /** Order ID. */
230
+ orderId?: string;
231
+ /** Fulfillments associated with the order. */
232
+ fulfillments?: Fulfillment[];
233
+ }
234
+ export interface BulkCreateFulfillmentResponse {
235
+ /** Items updated by bulk action. */
236
+ results?: BulkOrderFulfillmentsResult[];
237
+ /** Bulk action metadata. */
238
+ bulkActionMetadata?: BulkActionMetadata;
239
+ }
240
+ export interface BulkOrderFulfillmentsResult {
241
+ /** Item metadata. */
242
+ itemMetadata?: ItemMetadata;
243
+ /** List of order IDs and their associated fulfillments. */
244
+ ordersWithFulfillments?: OrderWithFulfillments;
245
+ }
246
+ export interface ItemMetadata {
247
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
248
+ _id?: string | null;
249
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
250
+ originalIndex?: number;
251
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
252
+ success?: boolean;
253
+ /** Details about the error in case of failure. */
254
+ error?: ApplicationError;
255
+ }
256
+ export interface ApplicationError {
257
+ /** Error code. */
258
+ code?: string;
259
+ /** Description of the error. */
260
+ description?: string;
261
+ /** Data related to the error. */
262
+ data?: Record<string, any> | null;
263
+ }
264
+ export interface BulkActionMetadata {
265
+ /** Number of items that were successfully processed. */
266
+ totalSuccesses?: number;
267
+ /** Number of items that couldn't be processed. */
268
+ totalFailures?: number;
269
+ /** Number of failures without details because detailed failure threshold was exceeded. */
270
+ undetailedFailures?: number;
271
+ }
272
+ export interface DomainEvent extends DomainEventBodyOneOf {
273
+ createdEvent?: EntityCreatedEvent;
274
+ updatedEvent?: EntityUpdatedEvent;
275
+ deletedEvent?: EntityDeletedEvent;
276
+ actionEvent?: ActionEvent;
277
+ /**
278
+ * Unique event ID.
279
+ * Allows clients to ignore duplicate webhooks.
280
+ */
281
+ _id?: string;
282
+ /**
283
+ * Assumes actions are also always typed to an entity_type
284
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
285
+ */
286
+ entityFqdn?: string;
287
+ /**
288
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
289
+ * This is although the created/updated/deleted notion is duplication of the oneof types
290
+ * Example: created/updated/deleted/started/completed/email_opened
291
+ */
292
+ slug?: string;
293
+ /** ID of the entity associated with the event. */
294
+ entityId?: string;
295
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
296
+ eventTime?: Date | null;
297
+ /**
298
+ * Whether the event was triggered as a result of a privacy regulation application
299
+ * (for example, GDPR).
300
+ */
301
+ triggeredByAnonymizeRequest?: boolean | null;
302
+ /** If present, indicates the action that triggered the event. */
303
+ originatedFrom?: string | null;
304
+ /**
305
+ * A sequence number defining the order of updates to the underlying entity.
306
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
307
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
308
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
309
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
310
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
311
+ */
312
+ entityEventSequence?: string | null;
313
+ }
314
+ /** @oneof */
315
+ export interface DomainEventBodyOneOf {
316
+ createdEvent?: EntityCreatedEvent;
317
+ updatedEvent?: EntityUpdatedEvent;
318
+ deletedEvent?: EntityDeletedEvent;
319
+ actionEvent?: ActionEvent;
320
+ }
321
+ export interface EntityCreatedEvent {
322
+ entity?: string;
323
+ }
324
+ export interface RestoreInfo {
325
+ deletedDate?: Date | null;
326
+ }
327
+ export interface EntityUpdatedEvent {
328
+ /**
329
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
330
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
331
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
332
+ */
333
+ currentEntity?: string;
334
+ }
335
+ export interface EntityDeletedEvent {
336
+ /** Entity that was deleted */
337
+ deletedEntity?: string | null;
338
+ }
339
+ export interface ActionEvent {
340
+ body?: string;
341
+ }
342
+ export interface MessageEnvelope {
343
+ /** App instance ID. */
344
+ instanceId?: string | null;
345
+ /** Event type. */
346
+ eventType?: string;
347
+ /** The identification type and identity data. */
348
+ identity?: IdentificationData;
349
+ /** Stringify payload. */
350
+ data?: string;
351
+ }
352
+ export interface IdentificationData extends IdentificationDataIdOneOf {
353
+ /** ID of a site visitor that has not logged in to the site. */
354
+ anonymousVisitorId?: string;
355
+ /** ID of a site visitor that has logged in to the site. */
356
+ memberId?: string;
357
+ /** ID of a Wix user (site owner, contributor, etc.). */
358
+ wixUserId?: string;
359
+ /** ID of an app. */
360
+ appId?: string;
361
+ /** @readonly */
362
+ identityType?: WebhookIdentityType;
363
+ }
364
+ /** @oneof */
365
+ export interface IdentificationDataIdOneOf {
366
+ /** ID of a site visitor that has not logged in to the site. */
367
+ anonymousVisitorId?: string;
368
+ /** ID of a site visitor that has logged in to the site. */
369
+ memberId?: string;
370
+ /** ID of a Wix user (site owner, contributor, etc.). */
371
+ wixUserId?: string;
372
+ /** ID of an app. */
373
+ appId?: string;
374
+ }
375
+ export declare enum WebhookIdentityType {
376
+ UNKNOWN = "UNKNOWN",
377
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
378
+ MEMBER = "MEMBER",
379
+ WIX_USER = "WIX_USER",
380
+ APP = "APP"
381
+ }
382
+ interface FulfillmentLineItemNonNullableFields {
383
+ _id: string;
384
+ }
385
+ interface FulfillmentNonNullableFields {
386
+ lineItems: FulfillmentLineItemNonNullableFields[];
387
+ }
388
+ export interface OrderWithFulfillmentsNonNullableFields {
389
+ orderId: string;
390
+ fulfillments: FulfillmentNonNullableFields[];
391
+ }
392
+ export interface ListFulfillmentsForSingleOrderResponseNonNullableFields {
393
+ orderWithFulfillments?: OrderWithFulfillmentsNonNullableFields;
394
+ }
395
+ export interface ListFulfillmentsForMultipleOrdersResponseNonNullableFields {
396
+ ordersWithFulfillments: OrderWithFulfillmentsNonNullableFields[];
397
+ }
398
+ export interface CreateFulfillmentResponseNonNullableFields {
399
+ orderWithFulfillments?: OrderWithFulfillmentsNonNullableFields;
400
+ fulfillmentId: string;
401
+ }
402
+ export interface UpdateFulfillmentResponseNonNullableFields {
403
+ orderWithFulfillments?: OrderWithFulfillmentsNonNullableFields;
404
+ }
405
+ export interface DeleteFulfillmentResponseNonNullableFields {
406
+ orderWithFulfillments?: OrderWithFulfillmentsNonNullableFields;
407
+ }
408
+ interface ApplicationErrorNonNullableFields {
409
+ code: string;
410
+ description: string;
411
+ }
412
+ interface ItemMetadataNonNullableFields {
413
+ originalIndex: number;
414
+ success: boolean;
415
+ error?: ApplicationErrorNonNullableFields;
416
+ }
417
+ interface BulkOrderFulfillmentsResultNonNullableFields {
418
+ itemMetadata?: ItemMetadataNonNullableFields;
419
+ ordersWithFulfillments?: OrderWithFulfillmentsNonNullableFields;
420
+ }
421
+ interface BulkActionMetadataNonNullableFields {
422
+ totalSuccesses: number;
423
+ totalFailures: number;
424
+ undetailedFailures: number;
425
+ }
426
+ export interface BulkCreateFulfillmentResponseNonNullableFields {
427
+ results: BulkOrderFulfillmentsResultNonNullableFields[];
428
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields;
429
+ }
430
+ export interface BaseEventMetadata {
431
+ /** App instance ID. */
432
+ instanceId?: string | null;
433
+ /** Event type. */
434
+ eventType?: string;
435
+ /** The identification type and identity data. */
436
+ identity?: IdentificationData;
437
+ }
438
+ export interface EventMetadata extends BaseEventMetadata {
439
+ /**
440
+ * Unique event ID.
441
+ * Allows clients to ignore duplicate webhooks.
442
+ */
443
+ _id?: string;
444
+ /**
445
+ * Assumes actions are also always typed to an entity_type
446
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
447
+ */
448
+ entityFqdn?: string;
449
+ /**
450
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
451
+ * This is although the created/updated/deleted notion is duplication of the oneof types
452
+ * Example: created/updated/deleted/started/completed/email_opened
453
+ */
454
+ slug?: string;
455
+ /** ID of the entity associated with the event. */
456
+ entityId?: string;
457
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
458
+ eventTime?: Date | null;
459
+ /**
460
+ * Whether the event was triggered as a result of a privacy regulation application
461
+ * (for example, GDPR).
462
+ */
463
+ triggeredByAnonymizeRequest?: boolean | null;
464
+ /** If present, indicates the action that triggered the event. */
465
+ originatedFrom?: string | null;
466
+ /**
467
+ * A sequence number defining the order of updates to the underlying entity.
468
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
469
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
470
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
471
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
472
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
473
+ */
474
+ entityEventSequence?: string | null;
475
+ }
476
+ export interface FulfillmentsUpdatedEnvelope {
477
+ entity: OrderWithFulfillments;
478
+ metadata: EventMetadata;
479
+ }
480
+ /**
481
+ * Triggered when one or more of an order's fulfillments are created, updated, or deleted.
482
+ *
483
+ * The response contains the order's ID and details about all of its fulfillments following the change.
484
+ * @permissionScope Manage Stores - all permissions
485
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
486
+ * @permissionScope Read eCommerce - all read permissions
487
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
488
+ * @permissionScope Read Orders
489
+ * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
490
+ * @permissionScope Read Stores - all read permissions
491
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
492
+ * @permissionScope Manage Restaurants - all permissions
493
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
494
+ * @permissionScope Manage eCommerce - all permissions
495
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
496
+ * @permissionScope Manage Orders
497
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
498
+ * @permissionId ECOM.READ_FULFILLMENTS
499
+ * @webhook
500
+ * @eventType wix.ecom.v1.fulfillments_updated
501
+ */
502
+ export declare function onFulfillmentsUpdated(handler: (event: FulfillmentsUpdatedEnvelope) => void | Promise<void>): void;
503
+ /**
504
+ * Retrieves fulfillments associated with a specified order.
505
+ *
506
+ *
507
+ * The `listFulfillmentsForSingleOrder()` function returns a Promise that resolves when the fulfillments are retrieved.
508
+ * @param orderId - Order ID for which to retrieve fulfillments.
509
+ * @public
510
+ * @requiredField orderId
511
+ * @permissionId ECOM.READ_FULFILLMENTS
512
+ * @permissionScope Manage Stores - all permissions
513
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
514
+ * @permissionScope Read eCommerce - all read permissions
515
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
516
+ * @permissionScope Read Orders
517
+ * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
518
+ * @permissionScope Read Stores - all read permissions
519
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
520
+ * @permissionScope Manage Restaurants - all permissions
521
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
522
+ * @permissionScope Manage eCommerce - all permissions
523
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
524
+ * @permissionScope Manage Orders
525
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
526
+ * @applicableIdentity APP
527
+ * @applicableIdentity MEMBER
528
+ * @fqn com.wix.ecom.orders.fulfillments.v1.Fulfillments.ListFulfillmentsForSingleOrder
529
+ */
530
+ export declare function listFulfillmentsForSingleOrder(orderId: string): Promise<ListFulfillmentsForSingleOrderResponse & ListFulfillmentsForSingleOrderResponseNonNullableFields>;
531
+ /**
532
+ * Retrieves fulfillments associated with multiple specified orders.
533
+ *
534
+ *
535
+ * The `listFulfillmentsForMultipleOrders()` function returns a Promise that resolves when the fulfillments are retrieved.
536
+ * @param orderIds - List of order IDs for which to retrieve fulfillments.
537
+ * @public
538
+ * @requiredField orderIds
539
+ * @permissionId ECOM.READ_FULFILLMENTS
540
+ * @permissionScope Manage Stores - all permissions
541
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
542
+ * @permissionScope Read eCommerce - all read permissions
543
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
544
+ * @permissionScope Read Orders
545
+ * @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
546
+ * @permissionScope Read Stores - all read permissions
547
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
548
+ * @permissionScope Manage Restaurants - all permissions
549
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
550
+ * @permissionScope Manage eCommerce - all permissions
551
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
552
+ * @permissionScope Manage Orders
553
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
554
+ * @applicableIdentity APP
555
+ * @applicableIdentity MEMBER
556
+ * @fqn com.wix.ecom.orders.fulfillments.v1.Fulfillments.ListFulfillmentsForMultipleOrders
557
+ */
558
+ export declare function listFulfillmentsForMultipleOrders(orderIds: string[]): Promise<ListFulfillmentsForMultipleOrdersResponse & ListFulfillmentsForMultipleOrdersResponseNonNullableFields>;
559
+ /**
560
+ * Creates an order fulfillment.
561
+ *
562
+ *
563
+ * The `createFulfillment()` function returns a Promise that resolves when the fulfillment is created.
564
+ * @param orderId - Order ID.
565
+ * @param fulfillment - Fulfillment info.
566
+ * @public
567
+ * @requiredField fulfillment
568
+ * @requiredField fulfillment.lineItems
569
+ * @requiredField fulfillment.lineItems._id
570
+ * @requiredField orderId
571
+ * @permissionId ECOM.MODIFY_FULFILLMENTS
572
+ * @permissionScope Manage Stores - all permissions
573
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
574
+ * @permissionScope Manage Restaurants - all permissions
575
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
576
+ * @permissionScope Manage eCommerce - all permissions
577
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
578
+ * @permissionScope Manage Orders
579
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
580
+ * @applicableIdentity APP
581
+ * @fqn com.wix.ecom.orders.fulfillments.v1.Fulfillments.CreateFulfillment
582
+ */
583
+ export declare function createFulfillment(orderId: string, fulfillment: Fulfillment): Promise<CreateFulfillmentResponse & CreateFulfillmentResponseNonNullableFields>;
584
+ /**
585
+ * Updates a fulfillment's properties.
586
+ * To update a field's value, include the new value in the `fulfillment` field in the body params.
587
+ * To remove a field's value, pass `null`.
588
+ *
589
+ *
590
+ * The `updateFulfillment()` function returns a Promise that resolves when the fulfillment is updated.
591
+ *
592
+ * > **Note:** Updating line item IDs or fulfilled quantities is not allowed. To update line item IDs or quantities, delete the fulfillment and create it again.
593
+ * @public
594
+ * @requiredField identifiers
595
+ * @requiredField identifiers.fulfillmentId
596
+ * @requiredField identifiers.orderId
597
+ * @param identifiers - Order and fulfillment IDs to be updated.
598
+ * @param options - Available options to use when updating a fulfillment.
599
+ * @permissionId ECOM.MODIFY_FULFILLMENTS
600
+ * @permissionScope Manage Stores - all permissions
601
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
602
+ * @permissionScope Manage Restaurants - all permissions
603
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
604
+ * @permissionScope Manage eCommerce - all permissions
605
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
606
+ * @permissionScope Manage Orders
607
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
608
+ * @applicableIdentity APP
609
+ * @returns Order ID and the orders' associated fulfillments after update.
610
+ * @fqn com.wix.ecom.orders.fulfillments.v1.Fulfillments.UpdateFulfillment
611
+ */
612
+ export declare function updateFulfillment(identifiers: UpdateFulfillmentIdentifiers, options?: UpdateFulfillmentOptions): Promise<OrderWithFulfillments & OrderWithFulfillmentsNonNullableFields>;
613
+ export interface UpdateFulfillmentOptions {
614
+ /** Fulfillment info. */
615
+ fulfillment: {
616
+ /** Tracking info. */
617
+ trackingInfo?: FulfillmentTrackingInfo;
618
+ /** Custom fulfillment info. */
619
+ customInfo?: CustomFulfillmentInfo;
620
+ /**
621
+ * Fulfillment ID.
622
+ * @readonly
623
+ */
624
+ _id?: string | null;
625
+ /**
626
+ * Fulfillment creation date and time in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) format.
627
+ * @readonly
628
+ */
629
+ _createdDate?: Date | null;
630
+ /** Line items being fulfilled. */
631
+ lineItems?: FulfillmentLineItem[];
632
+ /**
633
+ * Fulfillment status.
634
+ *
635
+ * Supported values:
636
+ * + `"Pending"`
637
+ * + `"Accepted"`
638
+ * + `"Ready"`
639
+ * + `"In_Delivery"`
640
+ * + `"Fulfilled"`
641
+ */
642
+ status?: string | null;
643
+ /** Fulfillment handling complete. */
644
+ completed?: boolean | null;
645
+ };
646
+ }
647
+ export interface UpdateFulfillmentIdentifiers {
648
+ /**
649
+ * ID of the fulfillment to be updated.
650
+ * @readonly
651
+ */
652
+ fulfillmentId?: string | null;
653
+ /** Order ID. */
654
+ orderId: string;
655
+ }
656
+ /**
657
+ * Deletes an existing order fulfillment.
658
+ *
659
+ *
660
+ * The `deleteFulfillment()` function returns a Promise that resolves when the fulfillment is deleted.
661
+ * @public
662
+ * @requiredField identifiers
663
+ * @requiredField identifiers.fulfillmentId
664
+ * @requiredField identifiers.orderId
665
+ * @param identifiers - Order and fulfillment IDs.
666
+ * @permissionId ECOM.MODIFY_FULFILLMENTS
667
+ * @permissionScope Manage Stores - all permissions
668
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
669
+ * @permissionScope Manage Restaurants - all permissions
670
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
671
+ * @permissionScope Manage eCommerce - all permissions
672
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
673
+ * @permissionScope Manage Orders
674
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
675
+ * @applicableIdentity APP
676
+ * @fqn com.wix.ecom.orders.fulfillments.v1.Fulfillments.DeleteFulfillment
677
+ */
678
+ export declare function deleteFulfillment(identifiers: DeleteFulfillmentIdentifiers): Promise<DeleteFulfillmentResponse & DeleteFulfillmentResponseNonNullableFields>;
679
+ export interface DeleteFulfillmentIdentifiers {
680
+ /** ID of the fulfillment to delete. */
681
+ fulfillmentId: string;
682
+ /** Order ID. */
683
+ orderId: string;
684
+ }
685
+ /**
686
+ * Creates multiple fulfillments for one or more orders.
687
+ *
688
+ *
689
+ * The `bulkCreateFulfillments()` function returns a Promise that resolves when the fulfillments are created.
690
+ * @param ordersWithFulfillments - List of order IDs and their associated fulfillments' info.
691
+ * @public
692
+ * @requiredField ordersWithFulfillments
693
+ * @requiredField ordersWithFulfillments.fulfillments
694
+ * @requiredField ordersWithFulfillments.fulfillments.lineItems
695
+ * @requiredField ordersWithFulfillments.fulfillments.lineItems._id
696
+ * @requiredField ordersWithFulfillments.orderId
697
+ * @permissionId ECOM.MODIFY_FULFILLMENTS
698
+ * @permissionScope Manage Stores - all permissions
699
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
700
+ * @permissionScope Manage Restaurants - all permissions
701
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
702
+ * @permissionScope Manage eCommerce - all permissions
703
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
704
+ * @permissionScope Manage Orders
705
+ * @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
706
+ * @applicableIdentity APP
707
+ * @fqn com.wix.ecom.orders.fulfillments.v1.Fulfillments.BulkCreateFulfillment
708
+ */
709
+ export declare function bulkCreateFulfillments(ordersWithFulfillments: BulkCreateOrderWithFulfillments[]): Promise<BulkCreateFulfillmentResponse & BulkCreateFulfillmentResponseNonNullableFields>;
710
+ export {};