/** GiftCard is the main entity of GiftCardService that matches between code and credit balance */ export interface GiftCard { /** * Gift Card unique id * @readonly */ id?: string | null; /** Gift Card code */ code?: string | null; /** Gift Card initial value */ initialValue?: string; /** * Gift Card balance * @readonly */ balance?: string | null; /** Gift card source info */ sourceInfo?: GiftCardSourceInfo; /** * Gift Card revision * @readonly */ revision?: string | null; /** Gift Card currency */ currency?: string | null; /** Gift Card expiration date */ expirationDate?: Date; /** * Gift Card creation date * @readonly */ createdDate?: Date; /** * Gift Card last update date * @readonly */ updatedDate?: Date; /** * Last Transaction id * @readonly */ lastTransactionId?: string | null; /** * Gift Card disable date * @readonly */ disableDate?: Date; } export interface GiftCardSourceInfo extends GiftCardSourceInfoGiftCardOptionsOneOf { /** Gift Card purchase */ orderOptions?: OrderOptions; /** Bulk Options */ campaignOptions?: CampaignOptions; /** Migration Options (migrating from another gift card) */ migrationOptions?: MigrationOptions; /** Store Credit Options */ storeCreditOptions?: StoreCreditOptions; type?: GiftCardType; /** The Tenant ID that is associated with the gift card creation */ sourceTenantId?: string | null; /** The Channel ID that is associated with the gift card creation */ sourceChannelId?: string | null; } /** @oneof */ export interface GiftCardSourceInfoGiftCardOptionsOneOf { /** Gift Card purchase */ orderOptions?: OrderOptions; /** Bulk Options */ campaignOptions?: CampaignOptions; /** Migration Options (migrating from another gift card) */ migrationOptions?: MigrationOptions; /** Store Credit Options */ storeCreditOptions?: StoreCreditOptions; } export declare enum GiftCardType { UNKNOWN = "UNKNOWN", ORDER = "ORDER", CAMPAIGN = "CAMPAIGN", MIGRATION = "MIGRATION", STORE_CREDIT = "STORE_CREDIT", MANUAL = "MANUAL" } export interface OrderOptions { orderId?: string; liability?: boolean | null; } export interface CampaignOptions { campaignId?: string; liability?: boolean | null; } export interface MigrationOptions { previousId?: string | null; liability?: boolean | null; note?: string | null; } export interface StoreCreditOptions { walletId?: string; } export interface CreateGiftCardRequest { giftCard?: GiftCard; } export interface CreateGiftCardResponse { giftCard?: GiftCard; } export interface GiftCardInitialized { giftCard?: GiftCard; } export interface GetGiftCardRequest { giftCardId: string; } export interface GetGiftCardResponse { giftCard?: GiftCard; } export interface GiftCardNotFoundDetails { /** Gift Card Id */ giftCardId?: string; } export interface GiftCardDisabledDetails { /** Gift Card Id */ giftCardId?: string; } export interface GiftCardExpiredDetails { /** Gift Card Id */ giftCardId?: string; } export interface UpdateGiftCardRequest { giftCardId: string; giftCard: GiftCard; } export interface UpdateGiftCardResponse { giftCard?: GiftCard; } export interface DisableGiftCardRequest { giftCardId: string; } export interface DisableGiftCardResponse { giftCard?: GiftCard; } export interface IncreaseBalanceRequest { transaction: Transaction; } /** Transaction is the secondary entity of GiftCardService that indicate an action over a Gift Card's balance */ export interface Transaction extends TransactionTransactionOptionsOneOf { /** Gift card Usage Options */ redeemOptions?: RedeemOptions; /** Void transaction Options */ voidOptions?: VoidOptions; /** Reward Options */ rewardOptions?: RewardOptions; /** Wallet Action End Options */ walletActionEndOptions?: WalletActionEndOptions; /** Bulk Options */ campaignOptions?: CampaignOptions; /** Store credit refund Options */ storeCreditRefundOptions?: StoreCreditRefundOptions; /** Migration Options */ migrationOptions?: MigrationOptions; /** Payment method refund Options */ paymentMethodRefundOptions?: PaymentMethodRefundOptions; /** * Transaction unique id * @readonly */ id?: string | null; /** * Transaction creation date * @readonly */ createdDate?: Date; /** Transaction external Options */ type?: Type; /** Linked Gift Card unique id */ giftCardId?: string; /** Transaction amount */ amount?: string; /** * Indicates whether the transaction adds / subtracts from the GiftCard balance * @readonly */ operationType?: OperationType; /** The Tenant ID that is associated with the action */ sourceTenantId?: string | null; /** The Channel ID that is associated with the action */ sourceChannelId?: string | null; /** Idempotency key */ idempotencyKey?: string | null; /** * Gift card Balance after this transaction operation * @readonly */ updatedBalance?: string | null; } /** @oneof */ export interface TransactionTransactionOptionsOneOf { /** Gift card Usage Options */ redeemOptions?: RedeemOptions; /** Void transaction Options */ voidOptions?: VoidOptions; /** Reward Options */ rewardOptions?: RewardOptions; /** Wallet Action End Options */ walletActionEndOptions?: WalletActionEndOptions; /** Bulk Options */ campaignOptions?: CampaignOptions; /** Store credit refund Options */ storeCreditRefundOptions?: StoreCreditRefundOptions; /** Migration Options */ migrationOptions?: MigrationOptions; /** Payment method refund Options */ paymentMethodRefundOptions?: PaymentMethodRefundOptions; } export declare enum Type { UNKNOWN = "UNKNOWN", REDEEM = "REDEEM", VOID = "VOID", REWARD = "REWARD", WALLET_ACTION_END = "WALLET_ACTION_END", MANUAL = "MANUAL", CAMPAIGN = "CAMPAIGN", STORE_CREDIT_REFUND = "STORE_CREDIT_REFUND", MIGRATION = "MIGRATION", INITIAL = "INITIAL", PAYMENT_METHOD_REFUND = "PAYMENT_METHOD_REFUND" } export interface RedeemOptions { orderId?: string; liability?: boolean | null; } export interface VoidOptions { transactionId?: string; } export interface RewardOptions { walletActionId?: string; liability?: boolean | null; } export interface WalletActionEndOptions { walletActionId?: string; transactionId?: string; liability?: boolean | null; } export interface StoreCreditRefundOptions { walletActionId?: string; liability?: boolean | null; } export interface PaymentMethodRefundOptions { orderId?: string; liability?: boolean | null; } export declare enum OperationType { ADD = "ADD", SUBTRACT = "SUBTRACT" } export interface IncreaseBalanceResponse { transaction?: Transaction; /** Gift card balance after transaction */ balance?: string; /** Gift card Currency */ currency?: string | null; } export interface TransactionAdded { transaction?: Transaction; } export interface IdempotencyKeyDetails { /** Gift Card Id */ giftCardId?: string; /** Idempotency Key */ idempotencyKey?: string; } export interface DecreaseBalanceRequest { transaction: Transaction; } export interface DecreaseBalanceResponse { transaction?: Transaction; /** Gift card balance after transaction */ balance?: string; /** Gift card Currency */ currency?: string | null; } export interface InsufficientFundsDetails { /** Gift Card Id */ giftCardId?: string; /** Gift Card Balance */ balance?: string; /** Transaction amount */ amount?: string; } export interface VoidTransactionRequest { transactionId?: string; sourceTenantId?: string | null; sourceChannelId?: string | null; } export interface VoidTransactionResponse { transaction?: Transaction; /** Gift card balance after transaction */ balance?: string; /** Gift card Currency */ currency?: string | null; } export interface VoidFailedDetails { /** Gift Card Id */ transactionId?: string; } export interface QueryGiftCardsRequest { /** WQL expression */ query: QueryV2; } export interface QueryV2 extends QueryV2PagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */ fields?: string[]; /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */ fieldsets?: string[]; } /** @oneof */ export interface QueryV2PagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ 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 Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } 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 QueryGiftCardsResponse { /** The retrieved GiftCards */ giftCards?: GiftCard[]; 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 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 BulkDeleteGiftCardsByFilterRequest { /** WQL expression */ query?: QueryV2; } export interface BulkDeleteGiftCardsByFilterResponse { jobId?: string; } 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. */ eventTime?: Date; /** * 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; } 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 CreateMigrationGiftCardRequest { /** The gift card to create. */ giftCard?: GiftCard; } export interface CreateMigrationGiftCardResponse { /** The created gift card. */ giftCard?: GiftCard; } export interface CreateMigrationTransactionRequest { /** The transaction to create. */ transaction?: Transaction; } export interface CreateMigrationTransactionResponse { /** The created transaction. */ transaction?: Transaction; } export interface CountGiftCardsRequest { filter?: Record | null; } export interface CountGiftCardsResponse { count?: number; } export interface CreateGiftCardResponseNonNullableFields { giftCard?: { initialValue: string; sourceInfo?: { orderOptions?: { orderId: string; }; campaignOptions?: { campaignId: string; }; storeCreditOptions?: { walletId: string; }; type: GiftCardType; }; }; } export interface GetGiftCardResponseNonNullableFields { giftCard?: { initialValue: string; sourceInfo?: { orderOptions?: { orderId: string; }; campaignOptions?: { campaignId: string; }; storeCreditOptions?: { walletId: string; }; type: GiftCardType; }; }; } export interface UpdateGiftCardResponseNonNullableFields { giftCard?: { initialValue: string; sourceInfo?: { orderOptions?: { orderId: string; }; campaignOptions?: { campaignId: string; }; storeCreditOptions?: { walletId: string; }; type: GiftCardType; }; }; } export interface DisableGiftCardResponseNonNullableFields { giftCard?: { initialValue: string; sourceInfo?: { orderOptions?: { orderId: string; }; campaignOptions?: { campaignId: string; }; storeCreditOptions?: { walletId: string; }; type: GiftCardType; }; }; } export interface IncreaseBalanceResponseNonNullableFields { transaction?: { redeemOptions?: { orderId: string; }; voidOptions?: { transactionId: string; }; rewardOptions?: { walletActionId: string; }; walletActionEndOptions?: { walletActionId: string; transactionId: string; }; campaignOptions?: { campaignId: string; }; storeCreditRefundOptions?: { walletActionId: string; }; paymentMethodRefundOptions?: { orderId: string; }; type: Type; giftCardId: string; amount: string; operationType: OperationType; }; balance: string; } export interface DecreaseBalanceResponseNonNullableFields { transaction?: { redeemOptions?: { orderId: string; }; voidOptions?: { transactionId: string; }; rewardOptions?: { walletActionId: string; }; walletActionEndOptions?: { walletActionId: string; transactionId: string; }; campaignOptions?: { campaignId: string; }; storeCreditRefundOptions?: { walletActionId: string; }; paymentMethodRefundOptions?: { orderId: string; }; type: Type; giftCardId: string; amount: string; operationType: OperationType; }; balance: string; } export interface QueryGiftCardsResponseNonNullableFields { giftCards: { initialValue: string; sourceInfo?: { orderOptions?: { orderId: string; }; campaignOptions?: { campaignId: string; }; storeCreditOptions?: { walletId: string; }; type: GiftCardType; }; }[]; } export interface CountGiftCardsResponseNonNullableFields { count: number; }