@wix/auto_sdk_ecom_order-payment-requests 1.0.59 → 1.0.60

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 +38 -8
  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 +191 -12
  5. package/build/cjs/index.typings.js.map +1 -1
  6. package/build/cjs/meta.d.ts +3 -4
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/cjs/schemas.js +22 -12
  9. package/build/cjs/schemas.js.map +1 -1
  10. package/build/es/index.d.mts +38 -8
  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 +191 -12
  14. package/build/es/index.typings.mjs.map +1 -1
  15. package/build/es/meta.d.mts +3 -4
  16. package/build/es/meta.mjs.map +1 -1
  17. package/build/es/schemas.mjs +22 -12
  18. package/build/es/schemas.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +40 -10
  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 +193 -14
  23. package/build/internal/cjs/index.typings.js.map +1 -1
  24. package/build/internal/cjs/meta.d.ts +3 -4
  25. package/build/internal/cjs/meta.js.map +1 -1
  26. package/build/internal/cjs/schemas.js +22 -12
  27. package/build/internal/cjs/schemas.js.map +1 -1
  28. package/build/internal/es/index.d.mts +40 -10
  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 +193 -14
  32. package/build/internal/es/index.typings.mjs.map +1 -1
  33. package/build/internal/es/meta.d.mts +3 -4
  34. package/build/internal/es/meta.mjs.map +1 -1
  35. package/build/internal/es/schemas.mjs +22 -12
  36. package/build/internal/es/schemas.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -14,7 +14,7 @@ interface OrderPaymentRequest {
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,8 +31,7 @@ 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;
@@ -554,7 +553,7 @@ type UpdateOrderPaymentRequestApplicationErrors = {
554
553
  description?: string;
555
554
  data?: Record<string, any>;
556
555
  } | {
557
- code?: 'CANNOT_UPDATE_SUBSCRIPTION_ORDER_PAYMENT_REQUEST_PRICE';
556
+ code?: 'CANNOT_UPDATE_ORDER_PAYMENT_REQUEST_AMOUNT';
558
557
  description?: string;
559
558
  data?: Record<string, any>;
560
559
  };
@@ -588,6 +587,187 @@ type VoidOrderPaymentRequestApplicationErrors = {
588
587
  description?: string;
589
588
  data?: Record<string, any>;
590
589
  };
590
+ interface BaseEventMetadata {
591
+ /**
592
+ * App instance ID.
593
+ * @format GUID
594
+ */
595
+ instanceId?: string | null;
596
+ /**
597
+ * Event type.
598
+ * @maxLength 150
599
+ */
600
+ eventType?: string;
601
+ /** The identification type and identity data. */
602
+ identity?: IdentificationData;
603
+ /** Details related to the account */
604
+ accountInfo?: AccountInfo;
605
+ }
606
+ interface EventMetadata extends BaseEventMetadata {
607
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
608
+ _id?: string;
609
+ /**
610
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
611
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
612
+ */
613
+ entityFqdn?: string;
614
+ /**
615
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
616
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
617
+ */
618
+ slug?: string;
619
+ /** ID of the entity associated with the event. */
620
+ entityId?: string;
621
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
622
+ eventTime?: Date | null;
623
+ /**
624
+ * Whether the event was triggered as a result of a privacy regulation application
625
+ * (for example, GDPR).
626
+ */
627
+ triggeredByAnonymizeRequest?: boolean | null;
628
+ /** If present, indicates the action that triggered the event. */
629
+ originatedFrom?: string | null;
630
+ /**
631
+ * 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.
632
+ * 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.
633
+ */
634
+ entityEventSequence?: string | null;
635
+ accountInfo?: AccountInfoMetadata;
636
+ }
637
+ interface AccountInfoMetadata {
638
+ /** ID of the Wix account associated with the event */
639
+ accountId: string;
640
+ /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */
641
+ siteId?: string;
642
+ /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */
643
+ parentAccountId?: string;
644
+ }
645
+ interface OrderPaymentRequestCreatedEnvelope {
646
+ entity: OrderPaymentRequest;
647
+ metadata: EventMetadata;
648
+ }
649
+ /**
650
+ * Triggered when an order payment request is created.
651
+ * @permissionScope Manage Stores - all permissions
652
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
653
+ * @permissionScope Manage Stores
654
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
655
+ * @permissionScope Manage Restaurants - all permissions
656
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
657
+ * @permissionScope Manage eCommerce - all permissions
658
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
659
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
660
+ * @webhook
661
+ * @eventType wix.ecom.v1.order_payment_request_created
662
+ * @slug created
663
+ * @documentationMaturity preview
664
+ */
665
+ declare function onOrderPaymentRequestCreated(handler: (event: OrderPaymentRequestCreatedEnvelope) => void | Promise<void>): void;
666
+ interface OrderPaymentRequestDeletedEnvelope {
667
+ entity: OrderPaymentRequest;
668
+ metadata: EventMetadata;
669
+ }
670
+ /**
671
+ * Triggered when an order payment request is deleted.
672
+ * @permissionScope Manage Stores - all permissions
673
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
674
+ * @permissionScope Manage Stores
675
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
676
+ * @permissionScope Manage Restaurants - all permissions
677
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
678
+ * @permissionScope Manage eCommerce - all permissions
679
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
680
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
681
+ * @webhook
682
+ * @eventType wix.ecom.v1.order_payment_request_deleted
683
+ * @slug deleted
684
+ * @documentationMaturity preview
685
+ */
686
+ declare function onOrderPaymentRequestDeleted(handler: (event: OrderPaymentRequestDeletedEnvelope) => void | Promise<void>): void;
687
+ interface OrderPaymentRequestExpiredEnvelope {
688
+ data: OrderPaymentRequestExpired;
689
+ metadata: EventMetadata;
690
+ }
691
+ /**
692
+ * Triggered when an order payment request status is updated to `"EXPIRED"`.
693
+ * @permissionScope Manage Stores - all permissions
694
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
695
+ * @permissionScope Manage Stores
696
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
697
+ * @permissionScope Manage Restaurants - all permissions
698
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
699
+ * @permissionScope Manage eCommerce - all permissions
700
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
701
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
702
+ * @webhook
703
+ * @eventType wix.ecom.v1.order_payment_request_expired
704
+ * @slug expired
705
+ * @documentationMaturity preview
706
+ */
707
+ declare function onOrderPaymentRequestExpired(handler: (event: OrderPaymentRequestExpiredEnvelope) => void | Promise<void>): void;
708
+ interface OrderPaymentRequestPaidEnvelope {
709
+ data: OrderPaymentRequestPaid;
710
+ metadata: EventMetadata;
711
+ }
712
+ /**
713
+ * Triggered when an order payment request status is updated to `"PAID"`.
714
+ * @permissionScope Manage Stores - all permissions
715
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
716
+ * @permissionScope Manage Stores
717
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
718
+ * @permissionScope Manage Restaurants - all permissions
719
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
720
+ * @permissionScope Manage eCommerce - all permissions
721
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
722
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
723
+ * @webhook
724
+ * @eventType wix.ecom.v1.order_payment_request_paid
725
+ * @slug paid
726
+ * @documentationMaturity preview
727
+ */
728
+ declare function onOrderPaymentRequestPaid(handler: (event: OrderPaymentRequestPaidEnvelope) => void | Promise<void>): void;
729
+ interface OrderPaymentRequestUpdatedEnvelope {
730
+ entity: OrderPaymentRequest;
731
+ metadata: EventMetadata;
732
+ }
733
+ /**
734
+ * Triggered when an order payment request is updated.
735
+ * @permissionScope Manage Stores - all permissions
736
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
737
+ * @permissionScope Manage Stores
738
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
739
+ * @permissionScope Manage Restaurants - all permissions
740
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
741
+ * @permissionScope Manage eCommerce - all permissions
742
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
743
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
744
+ * @webhook
745
+ * @eventType wix.ecom.v1.order_payment_request_updated
746
+ * @slug updated
747
+ * @documentationMaturity preview
748
+ */
749
+ declare function onOrderPaymentRequestUpdated(handler: (event: OrderPaymentRequestUpdatedEnvelope) => void | Promise<void>): void;
750
+ interface OrderPaymentRequestVoidedEnvelope {
751
+ data: OrderPaymentRequestVoided;
752
+ metadata: EventMetadata;
753
+ }
754
+ /**
755
+ * Triggered when an order payment request status is updated to `"VOIDED"`.
756
+ * @permissionScope Manage Stores - all permissions
757
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
758
+ * @permissionScope Manage Stores
759
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
760
+ * @permissionScope Manage Restaurants - all permissions
761
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
762
+ * @permissionScope Manage eCommerce - all permissions
763
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
764
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
765
+ * @webhook
766
+ * @eventType wix.ecom.v1.order_payment_request_voided
767
+ * @slug voided
768
+ * @documentationMaturity preview
769
+ */
770
+ declare function onOrderPaymentRequestVoided(handler: (event: OrderPaymentRequestVoidedEnvelope) => void | Promise<void>): void;
591
771
  /**
592
772
  * Creates a order payment request.
593
773
  * @public
@@ -622,9 +802,9 @@ declare function getOrderPaymentRequest(orderPaymentRequestId: string): Promise<
622
802
  __applicationErrorsType?: GetOrderPaymentRequestApplicationErrors;
623
803
  }>;
624
804
  /**
625
- * Updates a order payment request.
805
+ * Updates an order payment request.
626
806
  *
627
- * Please note that only `UNPAID` payment requests can be updated.
807
+ * Only `UNPAID` order payment requests can be updated. The `amount` can't be changed after the order payment request is created.
628
808
  * @param _id - Order payment request ID.
629
809
  * @public
630
810
  * @documentationMaturity preview
@@ -651,7 +831,7 @@ interface UpdateOrderPaymentRequest {
651
831
  */
652
832
  source?: Source;
653
833
  /**
654
- * status.
834
+ * 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.
655
835
  * @readonly
656
836
  */
657
837
  status?: StatusWithLiterals;
@@ -668,8 +848,7 @@ interface UpdateOrderPaymentRequest {
668
848
  */
669
849
  orderNumber?: string | null;
670
850
  /**
671
- * Amount to collect.
672
- * > **Note:** The amount can only be set once.
851
+ * Amount to collect. Set when the order payment request is created and can't be changed afterward.
673
852
  * @immutable
674
853
  */
675
854
  amount?: Price;
@@ -723,9 +902,9 @@ interface UpdateOrderPaymentRequest {
723
902
  blockedPaymentMethods?: PaymentMethodWithLiterals[];
724
903
  }
725
904
  /**
726
- * Deletes a order payment request.
905
+ * Deletes an order payment request.
727
906
  *
728
- * Please note that only `UNPAID` and `VOIDED` payment requests can be deleted.
907
+ * 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`.
729
908
  * @param orderPaymentRequestId - Id of the OrderPaymentRequest to delete.
730
909
  * @public
731
910
  * @documentationMaturity preview
@@ -957,4 +1136,4 @@ interface UpdateExtendedFieldsOptions {
957
1136
  namespaceData: Record<string, any> | null;
958
1137
  }
959
1138
 
960
- 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 };
1139
+ 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 };