@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;
@@ -572,7 +571,7 @@ type UpdateOrderPaymentRequestApplicationErrors = {
572
571
  description?: string;
573
572
  data?: Record<string, any>;
574
573
  } | {
575
- code?: 'CANNOT_UPDATE_SUBSCRIPTION_ORDER_PAYMENT_REQUEST_PRICE';
574
+ code?: 'CANNOT_UPDATE_ORDER_PAYMENT_REQUEST_AMOUNT';
576
575
  description?: string;
577
576
  data?: Record<string, any>;
578
577
  };
@@ -606,6 +605,187 @@ type VoidOrderPaymentRequestApplicationErrors = {
606
605
  description?: string;
607
606
  data?: Record<string, any>;
608
607
  };
608
+ interface BaseEventMetadata {
609
+ /**
610
+ * App instance ID.
611
+ * @format GUID
612
+ */
613
+ instanceId?: string | null;
614
+ /**
615
+ * Event type.
616
+ * @maxLength 150
617
+ */
618
+ eventType?: string;
619
+ /** The identification type and identity data. */
620
+ identity?: IdentificationData;
621
+ /** Details related to the account */
622
+ accountInfo?: AccountInfo;
623
+ }
624
+ interface EventMetadata extends BaseEventMetadata {
625
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
626
+ _id?: string;
627
+ /**
628
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
629
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
630
+ */
631
+ entityFqdn?: string;
632
+ /**
633
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
634
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
635
+ */
636
+ slug?: string;
637
+ /** ID of the entity associated with the event. */
638
+ entityId?: string;
639
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
640
+ eventTime?: Date | null;
641
+ /**
642
+ * Whether the event was triggered as a result of a privacy regulation application
643
+ * (for example, GDPR).
644
+ */
645
+ triggeredByAnonymizeRequest?: boolean | null;
646
+ /** If present, indicates the action that triggered the event. */
647
+ originatedFrom?: string | null;
648
+ /**
649
+ * 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.
650
+ * 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.
651
+ */
652
+ entityEventSequence?: string | null;
653
+ accountInfo?: AccountInfoMetadata;
654
+ }
655
+ interface AccountInfoMetadata {
656
+ /** ID of the Wix account associated with the event */
657
+ accountId: string;
658
+ /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */
659
+ siteId?: string;
660
+ /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */
661
+ parentAccountId?: string;
662
+ }
663
+ interface OrderPaymentRequestCreatedEnvelope {
664
+ entity: OrderPaymentRequest;
665
+ metadata: EventMetadata;
666
+ }
667
+ /**
668
+ * Triggered when an order payment request is created.
669
+ * @permissionScope Manage Stores - all permissions
670
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
671
+ * @permissionScope Manage Stores
672
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
673
+ * @permissionScope Manage Restaurants - all permissions
674
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
675
+ * @permissionScope Manage eCommerce - all permissions
676
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
677
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
678
+ * @webhook
679
+ * @eventType wix.ecom.v1.order_payment_request_created
680
+ * @slug created
681
+ * @documentationMaturity preview
682
+ */
683
+ declare function onOrderPaymentRequestCreated(handler: (event: OrderPaymentRequestCreatedEnvelope) => void | Promise<void>): void;
684
+ interface OrderPaymentRequestDeletedEnvelope {
685
+ entity: OrderPaymentRequest;
686
+ metadata: EventMetadata;
687
+ }
688
+ /**
689
+ * Triggered when an order payment request is deleted.
690
+ * @permissionScope Manage Stores - all permissions
691
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
692
+ * @permissionScope Manage Stores
693
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
694
+ * @permissionScope Manage Restaurants - all permissions
695
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
696
+ * @permissionScope Manage eCommerce - all permissions
697
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
698
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
699
+ * @webhook
700
+ * @eventType wix.ecom.v1.order_payment_request_deleted
701
+ * @slug deleted
702
+ * @documentationMaturity preview
703
+ */
704
+ declare function onOrderPaymentRequestDeleted(handler: (event: OrderPaymentRequestDeletedEnvelope) => void | Promise<void>): void;
705
+ interface OrderPaymentRequestExpiredEnvelope {
706
+ data: OrderPaymentRequestExpired;
707
+ metadata: EventMetadata;
708
+ }
709
+ /**
710
+ * Triggered when an order payment request status is updated to `"EXPIRED"`.
711
+ * @permissionScope Manage Stores - all permissions
712
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
713
+ * @permissionScope Manage Stores
714
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
715
+ * @permissionScope Manage Restaurants - all permissions
716
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
717
+ * @permissionScope Manage eCommerce - all permissions
718
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
719
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
720
+ * @webhook
721
+ * @eventType wix.ecom.v1.order_payment_request_expired
722
+ * @slug expired
723
+ * @documentationMaturity preview
724
+ */
725
+ declare function onOrderPaymentRequestExpired(handler: (event: OrderPaymentRequestExpiredEnvelope) => void | Promise<void>): void;
726
+ interface OrderPaymentRequestPaidEnvelope {
727
+ data: OrderPaymentRequestPaid;
728
+ metadata: EventMetadata;
729
+ }
730
+ /**
731
+ * Triggered when an order payment request status is updated to `"PAID"`.
732
+ * @permissionScope Manage Stores - all permissions
733
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
734
+ * @permissionScope Manage Stores
735
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
736
+ * @permissionScope Manage Restaurants - all permissions
737
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
738
+ * @permissionScope Manage eCommerce - all permissions
739
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
740
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
741
+ * @webhook
742
+ * @eventType wix.ecom.v1.order_payment_request_paid
743
+ * @slug paid
744
+ * @documentationMaturity preview
745
+ */
746
+ declare function onOrderPaymentRequestPaid(handler: (event: OrderPaymentRequestPaidEnvelope) => void | Promise<void>): void;
747
+ interface OrderPaymentRequestUpdatedEnvelope {
748
+ entity: OrderPaymentRequest;
749
+ metadata: EventMetadata;
750
+ }
751
+ /**
752
+ * Triggered when an order payment request is updated.
753
+ * @permissionScope Manage Stores - all permissions
754
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
755
+ * @permissionScope Manage Stores
756
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
757
+ * @permissionScope Manage Restaurants - all permissions
758
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
759
+ * @permissionScope Manage eCommerce - all permissions
760
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
761
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
762
+ * @webhook
763
+ * @eventType wix.ecom.v1.order_payment_request_updated
764
+ * @slug updated
765
+ * @documentationMaturity preview
766
+ */
767
+ declare function onOrderPaymentRequestUpdated(handler: (event: OrderPaymentRequestUpdatedEnvelope) => void | Promise<void>): void;
768
+ interface OrderPaymentRequestVoidedEnvelope {
769
+ data: OrderPaymentRequestVoided;
770
+ metadata: EventMetadata;
771
+ }
772
+ /**
773
+ * Triggered when an order payment request status is updated to `"VOIDED"`.
774
+ * @permissionScope Manage Stores - all permissions
775
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
776
+ * @permissionScope Manage Stores
777
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
778
+ * @permissionScope Manage Restaurants - all permissions
779
+ * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
780
+ * @permissionScope Manage eCommerce - all permissions
781
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
782
+ * @permissionId ECOM.ORDER_PAYMENT_REQUEST_READ
783
+ * @webhook
784
+ * @eventType wix.ecom.v1.order_payment_request_voided
785
+ * @slug voided
786
+ * @documentationMaturity preview
787
+ */
788
+ declare function onOrderPaymentRequestVoided(handler: (event: OrderPaymentRequestVoidedEnvelope) => void | Promise<void>): void;
609
789
  /**
610
790
  * Creates a order payment request.
611
791
  * @public
@@ -640,9 +820,9 @@ declare function getOrderPaymentRequest(orderPaymentRequestId: string): Promise<
640
820
  __applicationErrorsType?: GetOrderPaymentRequestApplicationErrors;
641
821
  }>;
642
822
  /**
643
- * Updates a order payment request.
823
+ * Updates an order payment request.
644
824
  *
645
- * Please note that only `UNPAID` payment requests can be updated.
825
+ * Only `UNPAID` order payment requests can be updated. The `amount` can't be changed after the order payment request is created.
646
826
  * @param _id - Order payment request ID.
647
827
  * @public
648
828
  * @documentationMaturity preview
@@ -669,7 +849,7 @@ interface UpdateOrderPaymentRequest {
669
849
  */
670
850
  source?: Source;
671
851
  /**
672
- * status.
852
+ * 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
853
  * @readonly
674
854
  */
675
855
  status?: StatusWithLiterals;
@@ -686,8 +866,7 @@ interface UpdateOrderPaymentRequest {
686
866
  */
687
867
  orderNumber?: string | null;
688
868
  /**
689
- * Amount to collect.
690
- * > **Note:** The amount can only be set once.
869
+ * Amount to collect. Set when the order payment request is created and can't be changed afterward.
691
870
  * @immutable
692
871
  */
693
872
  amount?: Price;
@@ -755,9 +934,9 @@ interface UpdateOrderPaymentRequest {
755
934
  subscriptionInfo?: SubscriptionInfo[];
756
935
  }
757
936
  /**
758
- * Deletes a order payment request.
937
+ * Deletes an order payment request.
759
938
  *
760
- * Please note that only `UNPAID` and `VOIDED` payment requests can be deleted.
939
+ * 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`.
761
940
  * @param orderPaymentRequestId - Id of the OrderPaymentRequest to delete.
762
941
  * @public
763
942
  * @documentationMaturity preview
@@ -989,9 +1168,9 @@ interface UpdateExtendedFieldsOptions {
989
1168
  namespaceData: Record<string, any> | null;
990
1169
  }
991
1170
  /**
992
- * Voids the given order payment request
1171
+ * Voids the given order payment request.
993
1172
  *
994
- * Please note that only `UNPAID` payment requests can be voided.
1173
+ * 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
1174
  * @param orderPaymentRequestId - ID of the order payment request to void.
996
1175
  * @internal
997
1176
  * @documentationMaturity preview
@@ -1004,4 +1183,4 @@ declare function voidOrderPaymentRequest(orderPaymentRequestId: string): Promise
1004
1183
  __applicationErrorsType?: VoidOrderPaymentRequestApplicationErrors;
1005
1184
  }>;
1006
1185
 
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 };
1186
+ 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 };