/** * A loyalty reward is an object a customer can redeem with loyalty points. * Redeeming a reward then creates a loyalty coupon that the customer can use. */ export interface Reward extends RewardTypeDetailsOneOf { /** Discount details. */ discountAmount?: DiscountAmount; /** Coupon details. */ couponReward?: CouponReward; /** * Reward ID. * @readonly */ id?: string | null; /** Reward name. */ name?: string; /** Whether the reward is active. Default: `FALSE` */ active?: boolean; /** Reward type. */ type?: RewardType; /** * Revision number, which increments by 1 each time the loyalty reward is updated. * * To prevent conflicting changes, the current `revision` must be passed when updating the loyalty reward. * @readonly */ revision?: string | null; /** * Date and time the reward was created. * @readonly */ createdDate?: Date | null; /** * Date and time the reward was last updated. * @readonly */ updatedDate?: Date | null; } /** @oneof */ export interface RewardTypeDetailsOneOf { /** Discount details. */ discountAmount?: DiscountAmount; /** Coupon details. */ couponReward?: CouponReward; } /** Available reward types. */ export declare enum RewardType { /** Undefined reward type. */ UNDEFINED = "UNDEFINED", /** Discount reward. Special flexible reward type used in checkout. */ DISCOUNT_AMOUNT = "DISCOUNT_AMOUNT", /** Coupon reward. [Learn more about coupons.](https://support.wix.com/en/article/using-coupons-as-loyalty-rewards) */ COUPON_REWARD = "COUPON_REWARD", /** For internal use. */ SPI_DISCOUNT_AMOUNT = "SPI_DISCOUNT_AMOUNT" } export interface DiscountAmount { /** Discount details for each tier. */ configsByTier?: DiscountAmountConfig[]; } export interface DiscountAmountConfig { /** Discount amount. Must be a positive value. */ amount?: string; /** Tier ID, or empty if config applies to the base tier. */ tierId?: string | null; /** Amount of points required to redeem the reward. */ costInPoints?: number; } export interface CouponReward extends CouponRewardDiscountTypeOneOf, CouponRewardScopeOrMinSubtotalOneOf { /** Discount as a fixed amount. */ fixedAmount?: FixedAmountDiscount; /** Discount as a percentage. */ percentage?: PercentageDiscount; /** Free shipping. */ freeShipping?: FreeShippingDiscount; /** Limit the coupon to carts with a subtotal greater than this number. */ minimumSubtotal?: number; /** * Specifies the type of line items this coupon will apply to. * For more information, see [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). */ scope?: CouponScope; /** Whether the coupon is limited to one item. */ limitedToOneItem?: boolean | null; /** Whether the coupon also applies to subscriptions. */ appliesToSubscriptions?: boolean | null; /** * Specifies the amount of discounted cycles for a subscription item. * * Can only be set when `appliesToSubscriptions` is `true` and `scope.namespace` is `pricingPlans`. * If `discountedCycleCount` is empty, the coupon applies to all available cycles. */ discountedCycleCount?: number | null; } /** @oneof */ export interface CouponRewardDiscountTypeOneOf { /** Discount as a fixed amount. */ fixedAmount?: FixedAmountDiscount; /** Discount as a percentage. */ percentage?: PercentageDiscount; /** Free shipping. */ freeShipping?: FreeShippingDiscount; } /** @oneof */ export interface CouponRewardScopeOrMinSubtotalOneOf { /** Limit the coupon to carts with a subtotal greater than this number. */ minimumSubtotal?: number; /** * Specifies the type of line items this coupon will apply to. * For more information, see [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). */ scope?: CouponScope; } export interface FixedAmountDiscount { /** Discount details for each tier. */ configsByTier?: FixedAmountDiscountConfig[]; } export interface FixedAmountDiscountConfig { /** Tier ID, or empty if config applies to the base tier. */ tierId?: string | null; /** Amount of points required to redeem the reward. */ costInPoints?: number; /** Discount amount. */ amount?: number; } export interface PercentageDiscount { /** Discount details for each tier. */ configsByTier?: PercentageDiscountConfig[]; } export interface PercentageDiscountConfig { /** Tier ID, or empty if config applies to the base tier. */ tierId?: string | null; /** Amount of points required to redeem the reward. */ costInPoints?: number; /** Percentage discount. */ percentage?: number; } export interface FreeShippingDiscount { /** Discount details for each tier. */ configsByTier?: FreeShippingDiscountConfig[]; } export interface FreeShippingDiscountConfig { /** Tier ID, or empty if config applies to the base tier. */ tierId?: string | null; /** Amount of points required to redeem the reward. */ costInPoints?: number; } export interface CouponScope { /** * Scope namespace. * * See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values) for valid namespaces. */ namespace?: string; /** * Coupon scope's applied group. * * See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values) for valid groups. */ group?: Group; } export interface Group { /** * Name of coupon scope's group. * * See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values) for valid groups. */ name?: string; /** Entity ID, if the coupon scope is limited to just one item. */ entityId?: string | null; } export interface SpiDiscountAmount { /** Discount details for each tier. */ configsByTier?: DiscountAmountConfig[]; /** Description of the SPI discount amount reward. Taken from user input in the SPI config. */ description?: string; } export interface RewardDisabled { } export interface CreateRewardRequest { /** Reward to create. */ reward: Reward; } export interface CreateRewardResponse { /** Created reward. */ reward?: Reward; } export interface BulkCreateRewardsRequest { /** Rewards to create. */ rewards: Reward[]; } export interface BulkCreateRewardsResponse { /** Created rewards. */ results?: BulkRewardResult[]; /** Total successes and failures of the bulk create rewards action. */ bulkActionMetadata?: BulkActionMetadata; } export interface BulkRewardResult { /** Item metadata. */ itemMetadata?: ItemMetadata; /** Created reward. */ item?: Reward; } export interface ItemMetadata { /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */ id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } export interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } export interface BulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } export interface GetRewardRequest { /** ID of the reward to retrieve. */ id: string; } export interface GetRewardResponse { /** Retrieved reward. */ reward?: Reward; } export interface BulkGetRewardsRequest { } export interface BulkGetRewardsResponse { /** Found rewards per site. */ rewardsInSite?: RewardsInSite[]; } export interface RewardsInSite { /** Metasite id. */ metaSiteId?: string; /** Rewards. */ rewards?: Reward[]; } export interface QueryRewardsRequest { /** Query parameters. */ query: CursorQuery; } export interface CursorQuery extends CursorQueryPagingMethodOneOf { /** * Cursor paging options. * * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). */ cursorPaging?: CursorPaging; /** * Filter object. * * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section). */ filter?: Record | null; /** * Sort object. * * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section). */ sort?: Sorting[]; } /** @oneof */ export interface CursorQueryPagingMethodOneOf { /** * Cursor paging options. * * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging). */ cursorPaging?: CursorPaging; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } export interface CursorPaging { /** Maximum number of items to return in the results. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. */ cursor?: string | null; } export interface QueryRewardsResponse { /** Retrieved loyalty rewards. */ rewards?: Reward[]; /** Details on the paged set of results returned. */ pagingMetadata?: CursorPagingMetadata; } export interface CursorPagingMetadata { /** Number of items returned in current page. */ count?: number | null; /** Cursor strings that point to the next page, previous page, or both. */ cursors?: Cursors; /** * Whether there are more pages to retrieve following the current page. * * + `true`: Another page of results can be retrieved. * + `false`: This is the last page. */ hasNext?: boolean | null; } export interface Cursors { /** Cursor string pointing to the next page in the list of results. */ next?: string | null; /** Cursor pointing to the previous page in the list of results. */ prev?: string | null; } export interface UpdateRewardRequest { /** Reward information to update. */ reward: Reward; } export interface UpdateRewardResponse { /** Updated reward. */ reward?: Reward; } export interface DeleteRewardRequest { /** ID of the reward to delete. */ id: string; /** * Revision number, which increments by 1 each time the reward is updated. * * To prevent conflicting changes, the current `revision` must be passed when deleting the reward. */ revision?: string; } export interface DeleteRewardResponse { } export interface ListRewardsRequest { /** Pagination options. */ cursorPaging?: CursorPaging; } export interface ListRewardsResponse { /** Retrieved loyalty rewards. */ rewards?: Reward[]; /** Details on the paged set of results returned. */ pagingMetadata?: PagingMetadataV2; } export interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } export interface ListRewardsInTierRequest { /** * Tier id. * @readonly */ tierId?: string | null; /** Pagination options. */ cursorPaging?: CursorPaging; } export interface ListRewardsInTierResponse { /** Retrieved loyalty rewards. */ rewards?: Reward[]; /** Details on the paged set of results returned. */ pagingMetadata?: PagingMetadataV2; } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * Example: created/updated/deleted/started/completed/email_opened */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } export interface RestoreInfo { deletedDate?: Date | null; } export interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntityAsJson?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntityAsJson?: string | null; } export interface ActionEvent { bodyAsJson?: string; } export interface Empty { } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface DiscountAmountConfigNonNullableFields { amount: string; costInPoints: number; } interface DiscountAmountNonNullableFields { amount: string; configsByTier: DiscountAmountConfigNonNullableFields[]; } interface FixedAmountDiscountConfigNonNullableFields { costInPoints: number; amount: number; } interface FixedAmountDiscountNonNullableFields { configsByTier: FixedAmountDiscountConfigNonNullableFields[]; } interface PercentageDiscountConfigNonNullableFields { costInPoints: number; percentage: number; } interface PercentageDiscountNonNullableFields { configsByTier: PercentageDiscountConfigNonNullableFields[]; } interface FreeShippingDiscountConfigNonNullableFields { costInPoints: number; } interface FreeShippingDiscountNonNullableFields { configsByTier: FreeShippingDiscountConfigNonNullableFields[]; } interface GroupNonNullableFields { name: string; } interface CouponScopeNonNullableFields { namespace: string; group?: GroupNonNullableFields; } interface CouponRewardNonNullableFields { fixedAmount?: FixedAmountDiscountNonNullableFields; percentage?: PercentageDiscountNonNullableFields; freeShipping?: FreeShippingDiscountNonNullableFields; minimumSubtotal: number; scope?: CouponScopeNonNullableFields; } interface SpiDiscountAmountNonNullableFields { configsByTier: DiscountAmountConfigNonNullableFields[]; description: string; } interface RewardNonNullableFields { discountAmount?: DiscountAmountNonNullableFields; couponReward?: CouponRewardNonNullableFields; spiDiscountAmount?: SpiDiscountAmountNonNullableFields; name: string; requiredPoints: number; active: boolean; type: RewardType; } export interface CreateRewardResponseNonNullableFields { reward?: RewardNonNullableFields; } interface ApplicationErrorNonNullableFields { code: string; description: string; } interface ItemMetadataNonNullableFields { originalIndex: number; success: boolean; error?: ApplicationErrorNonNullableFields; } interface BulkRewardResultNonNullableFields { itemMetadata?: ItemMetadataNonNullableFields; item?: RewardNonNullableFields; } interface BulkActionMetadataNonNullableFields { totalSuccesses: number; totalFailures: number; undetailedFailures: number; } export interface BulkCreateRewardsResponseNonNullableFields { results: BulkRewardResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } export interface GetRewardResponseNonNullableFields { reward?: RewardNonNullableFields; } interface RewardsInSiteNonNullableFields { metaSiteId: string; rewards: RewardNonNullableFields[]; } export interface BulkGetRewardsResponseNonNullableFields { rewardsInSite: RewardsInSiteNonNullableFields[]; } export interface QueryRewardsResponseNonNullableFields { rewards: RewardNonNullableFields[]; } export interface UpdateRewardResponseNonNullableFields { reward?: RewardNonNullableFields; } export interface ListRewardsResponseNonNullableFields { rewards: RewardNonNullableFields[]; } export {};