/** Wallet is the main entity of WalletService that contains GiftCard and customer references */ export interface Wallet { /** * Wallet ID * @readonly */ id?: string | null; /** * Represents the current state of an item. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision * @readonly */ revision?: string | null; /** * Represents the Gift Card associated with this Wallet * @readonly */ giftCardId?: string; /** * Customer references * @readonly */ customerReferences?: CustomerReference[]; /** * Represents the time this Wallet was created * @readonly */ createdDate?: Date; /** * Represents the time this Wallet was last updated * @readonly */ updatedDate?: Date; /** * Gift Card info * @readonly */ giftCardInfo?: GiftCardInfo; } export interface CustomerReference { /** Source channel, i.e. Shopify */ sourceChannelId?: string; /** Tenant ID in Source, i.e. shop ID */ sourceTenantId?: string; /** Customer ID in Source */ sourceCustomerId?: string; /** First name */ firstName?: string | null; /** Last name */ lastName?: string | null; /** Phone */ phone?: string | null; /** Email */ email?: string; } export interface GiftCardInfo { /** * Gift Card Code * @readonly */ code?: string; /** * Current Gift Card Balance * @readonly */ balance?: string; /** * Gift Card Currency * @readonly */ currency?: string | null; } export interface CreateWalletRequest { /** Customer reference */ customerReference: CustomerReference; /** Initial amount */ initialValue?: string | null; /** Currency */ currency?: string | null; } export interface CreateWalletResponse { /** wallet */ wallet?: Wallet; /** walletAction */ walletActionId?: string | null; } export interface CreateCustomerReferenceRequest { /** Customer reference */ customerReference?: CustomerReference; } export interface CreateCustomerReferenceResponse { /** Customer reference */ customerReference?: CustomerReference; } export interface GetCustomerReferenceRequest { /** Query */ query: CustomerReferenceQuery; } export interface CustomerReferenceQuery { /** CustomerReference source */ customerReferenceSource?: Source; } export interface Source { /** Source channel, i.e. Shopify */ sourceChannelId?: string; /** Tenant ID in Source, i.e. shop ID */ sourceTenantId?: string; /** Customer ID in Source */ sourceCustomerId?: string; } export interface GetCustomerReferenceResponse { /** Customer reference */ customerReference?: CustomerReference; } export interface UpdateCustomerReferenceRequest { /** PII information of CustomerReference will be updated. CustomerReference is identified by ID or source. */ customerReference?: CustomerReference; } export interface UpdateCustomerReferenceResponse { /** Customer reference */ customerReference?: CustomerReference; } export interface DeleteCustomerReferenceRequest { /** Query */ query?: CustomerReferenceQuery; } export interface DeleteCustomerReferenceResponse { } export interface GetWalletRequest { /** Query */ query: WalletQuery; } export interface WalletQuery extends WalletQueryByOneOf { /** Wallet id */ walletId?: string; /** Email */ email?: string; /** CustomerReference source */ customerReferenceSource?: Source; } /** @oneof */ export interface WalletQueryByOneOf { /** Wallet id */ walletId?: string; /** Email */ email?: string; /** CustomerReference source */ customerReferenceSource?: Source; } export interface GetWalletResponse { /** The retrieved Wallet */ wallet?: Wallet; } export interface GetWalletGiftCardRequest { /** ID of the Wallet for which to retrieve the associated Gift Card */ query?: WalletQuery; } export interface GetWalletGiftCardResponse { /** The retrieved Gift Card */ giftCard?: GiftCard; } /** 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 QueryWalletsRequest { /** 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 { /** Number of items to load. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * You can get 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 QueryWalletsResponse { /** * list of wallets with gift card info * @readonly */ wallets?: Wallet[]; 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 pointing to next page in the list of results. */ next?: string | null; /** Cursor pointing to previous page in the list of results. */ prev?: string | null; } 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 MigrateWalletRequest { /** Customer reference */ customerReference?: CustomerReference; /** gift card id */ giftCard?: GiftCard; /** tenant id */ tenantId?: string; /** channel id */ channelId?: string; } export interface MigrateWalletResponse { /** wallet */ wallet?: Wallet; /** giftCard */ giftCard?: GiftCard; } export interface CountWalletsRequest { filter?: Record | null; } export interface CountWalletsResponse { count?: number; } export interface CreateWalletResponseNonNullableFields { wallet?: { giftCardId: string; customerReferences: { sourceChannelId: string; sourceTenantId: string; sourceCustomerId: string; email: string; }[]; giftCardInfo?: { code: string; balance: string; }; }; } export interface GetCustomerReferenceResponseNonNullableFields { customerReference?: { sourceChannelId: string; sourceTenantId: string; sourceCustomerId: string; email: string; }; } export interface GetWalletResponseNonNullableFields { wallet?: { giftCardId: string; customerReferences: { sourceChannelId: string; sourceTenantId: string; sourceCustomerId: string; email: string; }[]; giftCardInfo?: { code: string; balance: string; }; }; } export interface QueryWalletsResponseNonNullableFields { wallets: { giftCardId: string; customerReferences: { sourceChannelId: string; sourceTenantId: string; sourceCustomerId: string; email: string; }[]; giftCardInfo?: { code: string; balance: string; }; }[]; } export interface CountWalletsResponseNonNullableFields { count: number; }