@wix/auto_sdk_ecom_order-payment-requests 1.0.59 → 1.0.61

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 (37) hide show
  1. package/build/cjs/index.d.ts +52 -18
  2. package/build/cjs/index.js +164 -0
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +269 -69
  5. package/build/cjs/index.typings.js.map +1 -1
  6. package/build/cjs/meta.d.ts +49 -37
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/cjs/schemas.js +125 -127
  9. package/build/cjs/schemas.js.map +1 -1
  10. package/build/es/index.d.mts +52 -18
  11. package/build/es/index.mjs +158 -0
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +269 -69
  14. package/build/es/index.typings.mjs.map +1 -1
  15. package/build/es/meta.d.mts +49 -37
  16. package/build/es/meta.mjs.map +1 -1
  17. package/build/es/schemas.mjs +125 -127
  18. package/build/es/schemas.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +54 -20
  20. package/build/internal/cjs/index.js +164 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +278 -80
  23. package/build/internal/cjs/index.typings.js.map +1 -1
  24. package/build/internal/cjs/meta.d.ts +49 -37
  25. package/build/internal/cjs/meta.js.map +1 -1
  26. package/build/internal/cjs/schemas.js +125 -127
  27. package/build/internal/cjs/schemas.js.map +1 -1
  28. package/build/internal/es/index.d.mts +54 -20
  29. package/build/internal/es/index.mjs +158 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +278 -80
  32. package/build/internal/es/index.typings.mjs.map +1 -1
  33. package/build/internal/es/meta.d.mts +49 -37
  34. package/build/internal/es/meta.mjs.map +1 -1
  35. package/build/internal/es/schemas.mjs +125 -127
  36. package/build/internal/es/schemas.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -9,12 +9,12 @@ interface OrderPaymentRequest {
9
9
  */
10
10
  _id?: string | null;
11
11
  /**
12
- * Additional parameters to identify the source of the order payment request.
12
+ * Details about the source that created the order payment request.
13
13
  * @immutable
14
14
  */
15
15
  source?: Source;
16
16
  /**
17
- * status.
17
+ * Payment request status. Set by the system. A new order payment request starts as `UNPAID`, unless `expirationDate` is already in the past at creation time, in which case it is created as `EXPIRED`. The system sets the status to `PAID` once payment is collected, `EXPIRED` when the expiration date passes, or `VOIDED` when the request is voided.
18
18
  * @readonly
19
19
  */
20
20
  status?: StatusWithLiterals;
@@ -31,49 +31,52 @@ interface OrderPaymentRequest {
31
31
  */
32
32
  orderNumber?: string | null;
33
33
  /**
34
- * Amount to collect.
35
- * > **Note:** The amount can only be set once.
34
+ * Amount to collect. Set when the order payment request is created and can't be changed afterward.
36
35
  * @immutable
37
36
  */
38
37
  amount?: Price;
39
38
  /**
40
- * Currency code. The value will always match the currency used in the order.
39
+ * Three-letter currency code in [ISO-4217 alphabetic format](http://en.wikipedia.org/wiki/ISO_4217). Always matches the order's currency.
41
40
  * @format CURRENCY
42
41
  * @readonly
43
42
  */
44
43
  currency?: string;
45
44
  /**
46
- * Payment gateway order id which is associated with this payment request
45
+ * Payment gateway order ID associated with this payment request.
47
46
  * @readonly
48
47
  * @minLength 1
49
48
  * @maxLength 100
50
49
  */
51
50
  paymentGatewayOrderId?: string | null;
52
51
  /**
53
- * Title to be displayed to the customer on the payment page. Provide a clear and descriptive title to inform the customer about what they are paying for.
52
+ * Title displayed to the customer on the payment page.
54
53
  * @minLength 1
55
54
  * @maxLength 200
56
55
  */
57
56
  title?: string;
58
57
  /**
59
- * Description to be displayed to the customer on the payment page. Write a detailed description so the customer understands what they are paying for.
58
+ * Description displayed to the customer on the payment page.
60
59
  * @maxLength 300
61
60
  */
62
61
  description?: string | null;
63
62
  /**
64
- * Time and date the order payment request expires.
63
+ * Date and time the order payment request expires. If not provided, the order payment request doesn't expire.
65
64
  * @immutable
66
65
  */
67
66
  expirationDate?: Date | null;
68
- /** [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the [app dashboard](https://dev.wix.com/dc3/my-apps/) before they can be accessed with API calls. */
67
+ /**
68
+ * Custom field data for this order payment request.
69
+ *
70
+ * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.
71
+ */
69
72
  extendedFields?: ExtendedFields;
70
73
  /**
71
- * Date and time the OrderPaymentRequest was created.
74
+ * Date and time the order payment request was created.
72
75
  * @readonly
73
76
  */
74
77
  _createdDate?: Date | null;
75
78
  /**
76
- * Date and time the OrderPaymentRequest was last updated.
79
+ * Date and time the order payment request was last updated.
77
80
  * @readonly
78
81
  */
79
82
  _updatedDate?: Date | null;
@@ -85,14 +88,12 @@ interface OrderPaymentRequest {
85
88
  */
86
89
  blockedPaymentMethods?: PaymentMethodWithLiterals[];
87
90
  /**
88
- * A collection of action links (e.g., navigation or error resolution URLs) intended for client-side use.
89
- *
90
- * These actions are optional and may be conditionally rendered based on the client context.
91
+ * Action links rendered by the payment page, such as navigation links or error resolution URLs.
91
92
  * @internal
92
93
  */
93
94
  actionLinks?: ActionLinks;
94
95
  /**
95
- * Charges information for each subscription in the order.
96
+ * Subscription charges for the order. Displayed to the customer on the payment page so they're aware that paying activates a subscription.
96
97
  * @internal
97
98
  * @maxSize 100
98
99
  * @readonly
@@ -101,7 +102,7 @@ interface OrderPaymentRequest {
101
102
  }
102
103
  interface Source {
103
104
  /**
104
- * App Def ID that created the order payment request.
105
+ * ID of the app that created the order payment request.
105
106
  * @format GUID
106
107
  * @minLength 1
107
108
  * @maxLength 100
@@ -109,7 +110,7 @@ interface Source {
109
110
  */
110
111
  appId?: string | null;
111
112
  /**
112
- * Reference to an ID from an external system, indicating the original source of the order payment request.
113
+ * Reference to a record in the source system. For example, if the payment request was created from a paylink or invoice, use this field to store the paylink ID or invoice ID.
113
114
  * @minLength 1
114
115
  * @maxLength 100
115
116
  * @immutable
@@ -117,10 +118,15 @@ interface Source {
117
118
  externalId?: string;
118
119
  }
119
120
  declare enum Status {
121
+ /** Payment is owed but hasn't been collected yet. */
120
122
  UNPAID = "UNPAID",
123
+ /** Payment has been collected. */
121
124
  PAID = "PAID",
125
+ /** The order payment request has passed its `expirationDate` without being paid. */
122
126
  EXPIRED = "EXPIRED",
123
- /** @documentationMaturity preview
127
+ /**
128
+ * The order payment request was voided and can no longer be paid.
129
+ * @documentationMaturity preview
124
130
  * @internal
125
131
  */
126
132
  VOIDED = "VOIDED"
@@ -158,11 +164,13 @@ declare enum PaymentMethod {
158
164
  type PaymentMethodWithLiterals = PaymentMethod | 'MANUAL';
159
165
  interface ActionLinks {
160
166
  /**
161
- * A general navigation action link rendered as an anchor in the UI.
167
+ * Navigation action links rendered as anchors on the payment page.
168
+ *
169
+ * Currently supports a single action link.
162
170
  * @maxSize 1
163
171
  */
164
172
  general?: ActionLink[];
165
- /** An action link rendered as a button in error messages in the UI. */
173
+ /** Action link rendered as a button in error messages on the payment page. */
166
174
  error?: ActionLink;
167
175
  }
168
176
  interface ActionLink {
@@ -186,7 +194,7 @@ interface SubscriptionInfo {
186
194
  */
187
195
  title?: string;
188
196
  /**
189
- * Description of the charges that will be applied for subscription.
197
+ * Description of the charges applied for the subscription.
190
198
  * @maxLength 1000
191
199
  */
192
200
  chargeDescription?: string | null;
@@ -198,30 +206,30 @@ interface SubscriptionInfo {
198
206
  /** Whether the subscription renews automatically. */
199
207
  autoRenewal?: boolean;
200
208
  }
201
- /** Triggered when the order payment request status changes to paid */
209
+ /** Triggered when an order payment request's `status` changes to `PAID`. */
202
210
  interface OrderPaymentRequestPaid {
203
- /** Order payment request */
211
+ /** Order payment request that was paid. */
204
212
  orderPaymentRequest?: OrderPaymentRequest;
205
213
  }
206
- /** Triggered when the order payment request status changes to expired */
214
+ /** Triggered when an order payment request's `status` changes to `EXPIRED`. */
207
215
  interface OrderPaymentRequestExpired {
208
- /** Order payment request */
216
+ /** Order payment request that expired. */
209
217
  orderPaymentRequest?: OrderPaymentRequest;
210
218
  }
211
- /** Triggered when the order payment request status changes to voided */
219
+ /** Triggered when an order payment request's `status` changes to `VOIDED`. */
212
220
  interface OrderPaymentRequestVoided {
213
- /** Order payment request */
221
+ /** Order payment request that was voided. */
214
222
  orderPaymentRequest?: OrderPaymentRequest;
215
223
  }
216
224
  interface CreateOrderPaymentRequestRequest {
217
- /** OrderPaymentRequest to be created. */
225
+ /** Order payment request to create. */
218
226
  orderPaymentRequest?: OrderPaymentRequest;
219
227
  }
220
228
  interface CreateOrderPaymentRequestResponse {
221
- /** The created OrderPaymentRequest. */
229
+ /** Created order payment request. */
222
230
  orderPaymentRequest?: OrderPaymentRequest;
223
231
  /**
224
- * Order payment request URL.
232
+ * Payment page URL for the order payment request. Share this URL with the customer so they can complete the payment.
225
233
  * @minLength 1
226
234
  * @maxLength 100
227
235
  */
@@ -229,26 +237,26 @@ interface CreateOrderPaymentRequestResponse {
229
237
  }
230
238
  interface GetOrderPaymentRequestRequest {
231
239
  /**
232
- * ID of the OrderPaymentRequest to retrieve.
240
+ * ID of the order payment request to retrieve.
233
241
  * @format GUID
234
242
  */
235
243
  orderPaymentRequestId: string;
236
244
  }
237
245
  interface GetOrderPaymentRequestResponse {
238
- /** The requested OrderPaymentRequest. */
246
+ /** Retrieved order payment request. */
239
247
  orderPaymentRequest?: OrderPaymentRequest;
240
248
  }
241
249
  interface UpdateOrderPaymentRequestRequest {
242
- /** OrderPaymentRequest to be updated, may be partial. */
250
+ /** Order payment request to update. */
243
251
  orderPaymentRequest: OrderPaymentRequest;
244
252
  }
245
253
  interface UpdateOrderPaymentRequestResponse {
246
- /** Updated OrderPaymentRequest. */
254
+ /** Updated order payment request. */
247
255
  orderPaymentRequest?: OrderPaymentRequest;
248
256
  }
249
257
  interface DeleteOrderPaymentRequestRequest {
250
258
  /**
251
- * Id of the OrderPaymentRequest to delete.
259
+ * ID of the order payment request to delete.
252
260
  * @format GUID
253
261
  */
254
262
  orderPaymentRequestId: string;
@@ -315,11 +323,11 @@ interface CursorPaging {
315
323
  }
316
324
  interface QueryOrderPaymentRequestsResponse {
317
325
  /**
318
- * List of payment requests.
326
+ * List of order payment requests.
319
327
  * @maxSize 1000
320
328
  */
321
329
  orderPaymentRequests?: OrderPaymentRequest[];
322
- /** Paging metadata */
330
+ /** Paging metadata. */
323
331
  pagingMetadata?: CursorPagingMetadata;
324
332
  }
325
333
  interface CursorPagingMetadata {
@@ -349,14 +357,14 @@ interface Cursors {
349
357
  }
350
358
  interface GetOrderPaymentRequestURLRequest {
351
359
  /**
352
- * Order Payment Request ID.
360
+ * ID of the order payment request.
353
361
  * @format GUID
354
362
  */
355
363
  orderPaymentRequestId: string;
356
364
  }
357
365
  interface GetOrderPaymentRequestURLResponse {
358
366
  /**
359
- * Order Payment Request URL.
367
+ * Payment page URL for the order payment request.
360
368
  * @minLength 1
361
369
  * @maxLength 100
362
370
  */
@@ -371,7 +379,7 @@ interface UpdateExtendedFieldsRequest {
371
379
  namespaceData: Record<string, any> | null;
372
380
  }
373
381
  interface UpdateExtendedFieldsResponse {
374
- /** Updated OrderPaymentRequest. */
382
+ /** Updated order payment request. */
375
383
  orderPaymentRequest?: OrderPaymentRequest;
376
384
  }
377
385
  interface VoidOrderPaymentRequestRequest {
@@ -551,6 +559,10 @@ type CreateOrderPaymentRequestApplicationErrors = {
551
559
  code?: 'INVALID_ORDER_STATUS_FOR_SUBSCRIPTION';
552
560
  description?: string;
553
561
  data?: Record<string, any>;
562
+ } | {
563
+ code?: 'ORDER_PAYMENT_REQUEST_PAGE_NOT_FOUND';
564
+ description?: string;
565
+ data?: Record<string, any>;
554
566
  };
555
567
  /** @docsIgnore */
556
568
  type GetOrderPaymentRequestApplicationErrors = {
@@ -572,7 +584,7 @@ type UpdateOrderPaymentRequestApplicationErrors = {
572
584
  description?: string;
573
585
  data?: Record<string, any>;
574
586
  } | {
575
- code?: 'CANNOT_UPDATE_SUBSCRIPTION_ORDER_PAYMENT_REQUEST_PRICE';
587
+ code?: 'CANNOT_UPDATE_ORDER_PAYMENT_REQUEST_AMOUNT';
576
588
  description?: string;
577
589
  data?: Record<string, any>;
578
590
  };
@@ -606,8 +618,193 @@ type VoidOrderPaymentRequestApplicationErrors = {
606
618
  description?: string;
607
619
  data?: Record<string, any>;
608
620
  };
621
+ interface BaseEventMetadata {
622
+ /**
623
+ * App instance ID.
624
+ * @format GUID
625
+ */
626
+ instanceId?: string | null;
627
+ /**
628
+ * Event type.
629
+ * @maxLength 150
630
+ */
631
+ eventType?: string;
632
+ /** The identification type and identity data. */
633
+ identity?: IdentificationData;
634
+ /** Details related to the account */
635
+ accountInfo?: AccountInfo;
636
+ }
637
+ interface EventMetadata extends BaseEventMetadata {
638
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
639
+ _id?: string;
640
+ /**
641
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
642
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
643
+ */
644
+ entityFqdn?: string;
645
+ /**
646
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
647
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
648
+ */
649
+ slug?: string;
650
+ /** ID of the entity associated with the event. */
651
+ entityId?: string;
652
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
653
+ eventTime?: Date | null;
654
+ /**
655
+ * Whether the event was triggered as a result of a privacy regulation application
656
+ * (for example, GDPR).
657
+ */
658
+ triggeredByAnonymizeRequest?: boolean | null;
659
+ /** If present, indicates the action that triggered the event. */
660
+ originatedFrom?: string | null;
661
+ /**
662
+ * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.
663
+ * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
664
+ */
665
+ entityEventSequence?: string | null;
666
+ accountInfo?: AccountInfoMetadata;
667
+ }
668
+ interface AccountInfoMetadata {
669
+ /** ID of the Wix account associated with the event */
670
+ accountId: string;
671
+ /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */
672
+ siteId?: string;
673
+ /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */
674
+ parentAccountId?: string;
675
+ }
676
+ interface OrderPaymentRequestCreatedEnvelope {
677
+ entity: OrderPaymentRequest;
678
+ metadata: EventMetadata;
679
+ }
680
+ /**
681
+ * Triggered when an order payment request is created.
682
+ * @permissionScope Manage Stores - all permissions
683
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
684
+ * @permissionScope Manage Stores
685
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
686
+ * @permissionScope Manage Restaurants - all permissions
687
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
688
+ * @permissionScope Manage eCommerce - all permissions
689
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
690
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
691
+ * @webhook
692
+ * @eventType wix.ecom.v1.order_payment_request_created
693
+ * @slug created
694
+ * @documentationMaturity preview
695
+ */
696
+ declare function onOrderPaymentRequestCreated(handler: (event: OrderPaymentRequestCreatedEnvelope) => void | Promise<void>): void;
697
+ interface OrderPaymentRequestDeletedEnvelope {
698
+ entity: OrderPaymentRequest;
699
+ metadata: EventMetadata;
700
+ }
701
+ /**
702
+ * Triggered when an order payment request is deleted.
703
+ * @permissionScope Manage Stores - all permissions
704
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
705
+ * @permissionScope Manage Stores
706
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
707
+ * @permissionScope Manage Restaurants - all permissions
708
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
709
+ * @permissionScope Manage eCommerce - all permissions
710
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
711
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
712
+ * @webhook
713
+ * @eventType wix.ecom.v1.order_payment_request_deleted
714
+ * @slug deleted
715
+ * @documentationMaturity preview
716
+ */
717
+ declare function onOrderPaymentRequestDeleted(handler: (event: OrderPaymentRequestDeletedEnvelope) => void | Promise<void>): void;
718
+ interface OrderPaymentRequestExpiredEnvelope {
719
+ data: OrderPaymentRequestExpired;
720
+ metadata: EventMetadata;
721
+ }
722
+ /**
723
+ * Triggered when an order payment request's `status` changes to `EXPIRED`.
724
+ * @permissionScope Manage Stores - all permissions
725
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
726
+ * @permissionScope Manage Stores
727
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
728
+ * @permissionScope Manage Restaurants - all permissions
729
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
730
+ * @permissionScope Manage eCommerce - all permissions
731
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
732
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
733
+ * @webhook
734
+ * @eventType wix.ecom.v1.order_payment_request_expired
735
+ * @slug expired
736
+ * @documentationMaturity preview
737
+ */
738
+ declare function onOrderPaymentRequestExpired(handler: (event: OrderPaymentRequestExpiredEnvelope) => void | Promise<void>): void;
739
+ interface OrderPaymentRequestPaidEnvelope {
740
+ data: OrderPaymentRequestPaid;
741
+ metadata: EventMetadata;
742
+ }
743
+ /**
744
+ * Triggered when an order payment request's `status` changes to `PAID`.
745
+ * @permissionScope Manage Stores - all permissions
746
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
747
+ * @permissionScope Manage Stores
748
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
749
+ * @permissionScope Manage Restaurants - all permissions
750
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
751
+ * @permissionScope Manage eCommerce - all permissions
752
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
753
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
754
+ * @webhook
755
+ * @eventType wix.ecom.v1.order_payment_request_paid
756
+ * @slug paid
757
+ * @documentationMaturity preview
758
+ */
759
+ declare function onOrderPaymentRequestPaid(handler: (event: OrderPaymentRequestPaidEnvelope) => void | Promise<void>): void;
760
+ interface OrderPaymentRequestUpdatedEnvelope {
761
+ entity: OrderPaymentRequest;
762
+ metadata: EventMetadata;
763
+ }
609
764
  /**
610
- * Creates a order payment request.
765
+ * Triggered when an order payment request is updated.
766
+ * @permissionScope Manage Stores - all permissions
767
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
768
+ * @permissionScope Manage Stores
769
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
770
+ * @permissionScope Manage Restaurants - all permissions
771
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
772
+ * @permissionScope Manage eCommerce - all permissions
773
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
774
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
775
+ * @webhook
776
+ * @eventType wix.ecom.v1.order_payment_request_updated
777
+ * @slug updated
778
+ * @documentationMaturity preview
779
+ */
780
+ declare function onOrderPaymentRequestUpdated(handler: (event: OrderPaymentRequestUpdatedEnvelope) => void | Promise<void>): void;
781
+ interface OrderPaymentRequestVoidedEnvelope {
782
+ data: OrderPaymentRequestVoided;
783
+ metadata: EventMetadata;
784
+ }
785
+ /**
786
+ * Triggered when an order payment request's `status` changes to `VOIDED`.
787
+ * @permissionScope Manage Stores - all permissions
788
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
789
+ * @permissionScope Manage Stores
790
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
791
+ * @permissionScope Manage Restaurants - all permissions
792
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
793
+ * @permissionScope Manage eCommerce - all permissions
794
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
795
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
796
+ * @webhook
797
+ * @eventType wix.ecom.v1.order_payment_request_voided
798
+ * @slug voided
799
+ * @documentationMaturity preview
800
+ */
801
+ declare function onOrderPaymentRequestVoided(handler: (event: OrderPaymentRequestVoidedEnvelope) => void | Promise<void>): void;
802
+ /**
803
+ * Creates an order payment request.
804
+ *
805
+ * The response includes the payment page URL, which you can share with the customer. To retrieve the URL later, call [Get Order Payment Request URL](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-payment-requests/get-order-payment-request-url).
806
+ *
807
+ * Creation fails with `ORDER_PAYMENT_REQUEST_PAGE_NOT_FOUND` if the site doesn't have a Payment Request Page added and published.
611
808
  * @public
612
809
  * @documentationMaturity preview
613
810
  * @requiredField options.orderPaymentRequest.amount
@@ -615,34 +812,34 @@ type VoidOrderPaymentRequestApplicationErrors = {
615
812
  * @requiredField options.orderPaymentRequest.title
616
813
  * @permissionId ECOM.ORDER_PAYMENT_REQUEST_CREATE
617
814
  * @applicableIdentity APP
618
- * @returns The created OrderPaymentRequest.
815
+ * @returns Created order payment request.
619
816
  * @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.CreateOrderPaymentRequest
620
817
  */
621
818
  declare function createOrderPaymentRequest(options?: NonNullablePaths<CreateOrderPaymentRequestOptions, `orderPaymentRequest.amount` | `orderPaymentRequest.orderId` | `orderPaymentRequest.title`, 3>): Promise<NonNullablePaths<OrderPaymentRequest, `source.externalId` | `status` | `orderId` | `amount.amount` | `amount.formattedAmount` | `currency` | `title` | `blockedPaymentMethods`, 3> & {
622
819
  __applicationErrorsType?: CreateOrderPaymentRequestApplicationErrors;
623
820
  }>;
624
821
  interface CreateOrderPaymentRequestOptions {
625
- /** OrderPaymentRequest to be created. */
822
+ /** Order payment request to create. */
626
823
  orderPaymentRequest?: OrderPaymentRequest;
627
824
  }
628
825
  /**
629
- * Retrieves a order payment request.
630
- * @param orderPaymentRequestId - ID of the OrderPaymentRequest to retrieve.
826
+ * Retrieves an order payment request.
827
+ * @param orderPaymentRequestId - ID of the order payment request to retrieve.
631
828
  * @public
632
829
  * @documentationMaturity preview
633
830
  * @requiredField orderPaymentRequestId
634
831
  * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
635
832
  * @applicableIdentity APP
636
- * @returns The requested OrderPaymentRequest.
833
+ * @returns Retrieved order payment request.
637
834
  * @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.GetOrderPaymentRequest
638
835
  */
639
836
  declare function getOrderPaymentRequest(orderPaymentRequestId: string): Promise<NonNullablePaths<OrderPaymentRequest, `source.externalId` | `status` | `orderId` | `amount.amount` | `amount.formattedAmount` | `currency` | `title` | `blockedPaymentMethods`, 3> & {
640
837
  __applicationErrorsType?: GetOrderPaymentRequestApplicationErrors;
641
838
  }>;
642
839
  /**
643
- * Updates a order payment request.
840
+ * Updates an order payment request.
644
841
  *
645
- * Please note that only `UNPAID` payment requests can be updated.
842
+ * Only `UNPAID` order payment requests can be updated. The `amount` can't be changed after the order payment request is created.
646
843
  * @param _id - Order payment request ID.
647
844
  * @public
648
845
  * @documentationMaturity preview
@@ -650,7 +847,7 @@ declare function getOrderPaymentRequest(orderPaymentRequestId: string): Promise<
650
847
  * @requiredField orderPaymentRequest
651
848
  * @permissionId ECOM.ORDER_PAYMENT_REQUEST_UPDATE
652
849
  * @applicableIdentity APP
653
- * @returns Updated OrderPaymentRequest.
850
+ * @returns Updated order payment request.
654
851
  * @fqn wix.ecom.order_payment_request.api.v1.OrderPaymentRequestsService.UpdateOrderPaymentRequest
655
852
  */
656
853
  declare function updateOrderPaymentRequest(_id: string, orderPaymentRequest: UpdateOrderPaymentRequest): Promise<NonNullablePaths<OrderPaymentRequest, `source.externalId` | `status` | `orderId` | `amount.amount` | `amount.formattedAmount` | `currency` | `title` | `blockedPaymentMethods`, 3> & {
@@ -664,12 +861,12 @@ interface UpdateOrderPaymentRequest {
664
861
  */
665
862
  _id?: string | null;
666
863
  /**
667
- * Additional parameters to identify the source of the order payment request.
864
+ * Details about the source that created the order payment request.
668
865
  * @immutable
669
866
  */
670
867
  source?: Source;
671
868
  /**
672
- * status.
869
+ * Payment request status. Set by the system. A new order payment request starts as `UNPAID`, unless `expirationDate` is already in the past at creation time, in which case it is created as `EXPIRED`. The system sets the status to `PAID` once payment is collected, `EXPIRED` when the expiration date passes, or `VOIDED` when the request is voided.
673
870
  * @readonly
674
871
  */
675
872
  status?: StatusWithLiterals;
@@ -686,49 +883,52 @@ interface UpdateOrderPaymentRequest {
686
883
  */
687
884
  orderNumber?: string | null;
688
885
  /**
689
- * Amount to collect.
690
- * > **Note:** The amount can only be set once.
886
+ * Amount to collect. Set when the order payment request is created and can't be changed afterward.
691
887
  * @immutable
692
888
  */
693
889
  amount?: Price;
694
890
  /**
695
- * Currency code. The value will always match the currency used in the order.
891
+ * Three-letter currency code in [ISO-4217 alphabetic format](http://en.wikipedia.org/wiki/ISO_4217). Always matches the order's currency.
696
892
  * @format CURRENCY
697
893
  * @readonly
698
894
  */
699
895
  currency?: string;
700
896
  /**
701
- * Payment gateway order id which is associated with this payment request
897
+ * Payment gateway order ID associated with this payment request.
702
898
  * @readonly
703
899
  * @minLength 1
704
900
  * @maxLength 100
705
901
  */
706
902
  paymentGatewayOrderId?: string | null;
707
903
  /**
708
- * Title to be displayed to the customer on the payment page. Provide a clear and descriptive title to inform the customer about what they are paying for.
904
+ * Title displayed to the customer on the payment page.
709
905
  * @minLength 1
710
906
  * @maxLength 200
711
907
  */
712
908
  title?: string;
713
909
  /**
714
- * Description to be displayed to the customer on the payment page. Write a detailed description so the customer understands what they are paying for.
910
+ * Description displayed to the customer on the payment page.
715
911
  * @maxLength 300
716
912
  */
717
913
  description?: string | null;
718
914
  /**
719
- * Time and date the order payment request expires.
915
+ * Date and time the order payment request expires. If not provided, the order payment request doesn't expire.
720
916
  * @immutable
721
917
  */
722
918
  expirationDate?: Date | null;
723
- /** [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the [app dashboard](https://dev.wix.com/dc3/my-apps/) before they can be accessed with API calls. */
919
+ /**
920
+ * Custom field data for this order payment request.
921
+ *
922
+ * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.
923
+ */
724
924
  extendedFields?: ExtendedFields;
725
925
  /**
726
- * Date and time the OrderPaymentRequest was created.
926
+ * Date and time the order payment request was created.
727
927
  * @readonly
728
928
  */
729
929
  _createdDate?: Date | null;
730
930
  /**
731
- * Date and time the OrderPaymentRequest was last updated.
931
+ * Date and time the order payment request was last updated.
732
932
  * @readonly
733
933
  */
734
934
  _updatedDate?: Date | null;
@@ -740,14 +940,12 @@ interface UpdateOrderPaymentRequest {
740
940
  */
741
941
  blockedPaymentMethods?: PaymentMethodWithLiterals[];
742
942
  /**
743
- * A collection of action links (e.g., navigation or error resolution URLs) intended for client-side use.
744
- *
745
- * These actions are optional and may be conditionally rendered based on the client context.
943
+ * Action links rendered by the payment page, such as navigation links or error resolution URLs.
746
944
  * @internal
747
945
  */
748
946
  actionLinks?: ActionLinks;
749
947
  /**
750
- * Charges information for each subscription in the order.
948
+ * Subscription charges for the order. Displayed to the customer on the payment page so they're aware that paying activates a subscription.
751
949
  * @internal
752
950
  * @maxSize 100
753
951
  * @readonly
@@ -755,10 +953,10 @@ interface UpdateOrderPaymentRequest {
755
953
  subscriptionInfo?: SubscriptionInfo[];
756
954
  }
757
955
  /**
758
- * Deletes a order payment request.
956
+ * Deletes an order payment request.
759
957
  *
760
- * Please note that only `UNPAID` and `VOIDED` payment requests can be deleted.
761
- * @param orderPaymentRequestId - Id of the OrderPaymentRequest to delete.
958
+ * You can delete an order payment request in any status except `PAID`. Attempting to delete a `PAID` order payment request fails with `CANNOT_DELETE_PAID_ORDER_PAYMENT_REQUEST`.
959
+ * @param orderPaymentRequestId - ID of the order payment request to delete.
762
960
  * @public
763
961
  * @documentationMaturity preview
764
962
  * @requiredField orderPaymentRequestId
@@ -770,11 +968,11 @@ declare function deleteOrderPaymentRequest(orderPaymentRequestId: string): Promi
770
968
  __applicationErrorsType?: DeleteOrderPaymentRequestApplicationErrors;
771
969
  }>;
772
970
  /**
773
- * Retrieves a list of Payment Requests, given the provided [paging, filtering, and sorting][1].
971
+ * Retrieves a list of up to 1,000 order payment requests, given the provided [paging, filtering, and sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).
774
972
  *
775
- * Query Payment Requests runs with these defaults, which you can override:
776
- * - `createdDate` is sorted in DESC order
777
- * - `cursorPaging.limit` is 100
973
+ * Query Order Payment Requests runs with these defaults, which you can override:
974
+ * - `_createdDate` is sorted in `DESC` order
975
+ * - `cursorPaging.limit` is `100`
778
976
  *
779
977
  * To learn about working with _Query_ endpoints, see
780
978
  * [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language), and
@@ -957,8 +1155,8 @@ declare const utils: {
957
1155
  };
958
1156
  };
959
1157
  /**
960
- * Retrieves the order payment request page URL of a specified order payment request.
961
- * @param orderPaymentRequestId - Order Payment Request ID.
1158
+ * Retrieves the payment page URL for an order payment request.
1159
+ * @param orderPaymentRequestId - ID of the order payment request.
962
1160
  * @public
963
1161
  * @documentationMaturity preview
964
1162
  * @requiredField orderPaymentRequestId
@@ -970,7 +1168,7 @@ declare function getOrderPaymentRequestUrl(orderPaymentRequestId: string): Promi
970
1168
  __applicationErrorsType?: GetOrderPaymentRequestUrlApplicationErrors;
971
1169
  }>;
972
1170
  /**
973
- * Updates extended fields of a order payment request
1171
+ * Updates the extended fields of an order payment request.
974
1172
  * @param _id - ID of the entity to update.
975
1173
  * @param namespace - Identifier for the app whose extended fields are being updated.
976
1174
  * @public
@@ -989,9 +1187,9 @@ interface UpdateExtendedFieldsOptions {
989
1187
  namespaceData: Record<string, any> | null;
990
1188
  }
991
1189
  /**
992
- * Voids the given order payment request
1190
+ * Voids the given order payment request.
993
1191
  *
994
- * Please note that only `UNPAID` payment requests can be voided.
1192
+ * Only `UNPAID` order payment requests can be voided. Voiding an order payment request that is already `VOIDED` succeeds without making any changes. Voiding a `PAID` or `EXPIRED` order payment request fails.
995
1193
  * @param orderPaymentRequestId - ID of the order payment request to void.
996
1194
  * @internal
997
1195
  * @documentationMaturity preview
@@ -1004,4 +1202,4 @@ declare function voidOrderPaymentRequest(orderPaymentRequestId: string): Promise
1004
1202
  __applicationErrorsType?: VoidOrderPaymentRequestApplicationErrors;
1005
1203
  }>;
1006
1204
 
1007
- export { type AccountInfo, type ActionEvent, type ActionLink, type ActionLinks, type CommonQueryWithEntityContext, type CreateOrderPaymentRequestApplicationErrors, type CreateOrderPaymentRequestOptions, type CreateOrderPaymentRequestRequest, type CreateOrderPaymentRequestResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteOrderPaymentRequestApplicationErrors, type DeleteOrderPaymentRequestRequest, type DeleteOrderPaymentRequestResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type GetOrderPaymentRequestApplicationErrors, type GetOrderPaymentRequestRequest, type GetOrderPaymentRequestResponse, type GetOrderPaymentRequestURLRequest, type GetOrderPaymentRequestURLResponse, type GetOrderPaymentRequestUrlApplicationErrors, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type OrderPaymentRequest, type OrderPaymentRequestExpired, type OrderPaymentRequestPaid, type OrderPaymentRequestQuery, type OrderPaymentRequestQuerySpec, type OrderPaymentRequestVoided, type OrderPaymentRequestsQueryBuilder, type OrderPaymentRequestsQueryResult, PaymentMethod, type PaymentMethodWithLiterals, type Price, type QueryOrderPaymentRequestsRequest, type QueryOrderPaymentRequestsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, Status, type StatusWithLiterals, type SubscriptionInfo, type UpdateExtendedFieldsOptions, type UpdateExtendedFieldsRequest, type UpdateExtendedFieldsResponse, type UpdateOrderPaymentRequest, type UpdateOrderPaymentRequestApplicationErrors, type UpdateOrderPaymentRequestRequest, type UpdateOrderPaymentRequestResponse, type VoidOrderPaymentRequestApplicationErrors, type VoidOrderPaymentRequestRequest, type VoidOrderPaymentRequestResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createOrderPaymentRequest, deleteOrderPaymentRequest, getOrderPaymentRequest, getOrderPaymentRequestUrl, queryOrderPaymentRequests, typedQueryOrderPaymentRequests, updateExtendedFields, updateOrderPaymentRequest, utils, voidOrderPaymentRequest };
1205
+ export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type ActionLink, type ActionLinks, type BaseEventMetadata, type CommonQueryWithEntityContext, type CreateOrderPaymentRequestApplicationErrors, type CreateOrderPaymentRequestOptions, type CreateOrderPaymentRequestRequest, type CreateOrderPaymentRequestResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteOrderPaymentRequestApplicationErrors, type DeleteOrderPaymentRequestRequest, type DeleteOrderPaymentRequestResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type GetOrderPaymentRequestApplicationErrors, type GetOrderPaymentRequestRequest, type GetOrderPaymentRequestResponse, type GetOrderPaymentRequestURLRequest, type GetOrderPaymentRequestURLResponse, type GetOrderPaymentRequestUrlApplicationErrors, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type OrderPaymentRequest, type OrderPaymentRequestCreatedEnvelope, type OrderPaymentRequestDeletedEnvelope, type OrderPaymentRequestExpired, type OrderPaymentRequestExpiredEnvelope, type OrderPaymentRequestPaid, type OrderPaymentRequestPaidEnvelope, type OrderPaymentRequestQuery, type OrderPaymentRequestQuerySpec, type OrderPaymentRequestUpdatedEnvelope, type OrderPaymentRequestVoided, type OrderPaymentRequestVoidedEnvelope, type OrderPaymentRequestsQueryBuilder, type OrderPaymentRequestsQueryResult, PaymentMethod, type PaymentMethodWithLiterals, type Price, type QueryOrderPaymentRequestsRequest, type QueryOrderPaymentRequestsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type Source, Status, type StatusWithLiterals, type SubscriptionInfo, type UpdateExtendedFieldsOptions, type UpdateExtendedFieldsRequest, type UpdateExtendedFieldsResponse, type UpdateOrderPaymentRequest, type UpdateOrderPaymentRequestApplicationErrors, type UpdateOrderPaymentRequestRequest, type UpdateOrderPaymentRequestResponse, type VoidOrderPaymentRequestApplicationErrors, type VoidOrderPaymentRequestRequest, type VoidOrderPaymentRequestResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createOrderPaymentRequest, deleteOrderPaymentRequest, getOrderPaymentRequest, getOrderPaymentRequestUrl, onOrderPaymentRequestCreated, onOrderPaymentRequestDeleted, onOrderPaymentRequestExpired, onOrderPaymentRequestPaid, onOrderPaymentRequestUpdated, onOrderPaymentRequestVoided, queryOrderPaymentRequests, typedQueryOrderPaymentRequests, updateExtendedFields, updateOrderPaymentRequest, utils, voidOrderPaymentRequest };