import { ServicePluginDefinition } from '@wix/sdk-types'; interface GiftCardProviderEntity { /** * Dummy id for docs generation. * @format GUID */ _id?: string | null; } interface GetBalanceRequest { /** * Gift card code. * @minLength 8 * @maxLength 20 */ code?: string; /** * App ID of the Gift Card provider. Deprecated. * @format GUID * @deprecated App ID of the Gift Card provider. Deprecated. * @targetRemovalDate 2025-07-01 */ appInstanceId?: string; /** * The physical location ID. Can be based on the Locations API or an external provider. * @maxLength 50 */ locationId?: string | null; /** * Gift card PIN. * @maxLength 50 */ pin?: string | null; /** [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ extendedFields?: ExtendedFields; } interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } interface GetBalanceResponse { /** * Current balance. * @max 999999999.99 */ balance?: number; /** * Currency code. * @format CURRENCY */ currencyCode?: string; /** * External ID in the gift card provider's system. * Used for integration and tracking across different platforms. * @minLength 1 * @maxLength 50 */ externalId?: string | null; } interface RedeemRequest { /** * Gift card code. * @minLength 8 * @maxLength 20 */ code?: string; /** * App ID of the Gift Card provider. Deprecated. * @format GUID * @deprecated App ID of the Gift Card provider. Deprecated. * @targetRemovalDate 2025-07-01 */ appInstanceId?: string; /** * Amount to redeem from the gift card. * @max 999999999.99 */ amount?: number; /** * Order ID the gift card transaction is applied to. Order details can be collected from eCommerce Search Orders. * @format GUID */ orderId?: string; /** * Currency code. * @format CURRENCY */ currencyCode?: string; /** * Physical location ID. Can be based on the Locations API or an external provider. * @maxLength 50 */ locationId?: string | null; /** * Gift card PIN. * @maxLength 50 */ pin?: string | null; /** * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). * @internal */ extendedFields?: ExtendedFields; } interface RedeemResponse { /** * Remaining balance on the Gift Card after the redemption. * @max 999999999.99 */ remainingBalance?: number; /** * Currency code. * @format CURRENCY */ currencyCode?: string; /** * Transaction ID. * @minLength 1 * @maxLength 100 */ transactionId?: string; } interface VoidRequest { /** * App ID of the Gift Card provider. Deprecated. * @format GUID * @deprecated App ID of the Gift Card provider. Deprecated. * @targetRemovalDate 2025-07-01 */ appInstanceId?: string; /** * Transaction ID to void. * @minLength 1 * @maxLength 100 */ transactionId?: string; /** * Physical location ID. Can be based on the Locations API or an external provider. * @maxLength 50 */ locationId?: string | null; /** * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). * @internal */ extendedFields?: ExtendedFields; } interface VoidResponse { /** * Remaining balance on the Gift Card after voiding the transaction. * @max 999999999.99 */ remainingBalance?: number; /** * Currency code. * @format CURRENCY */ currencyCode?: string; } interface GiftCardProviderConfig { /** Base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI. For example, to call the Get Balance endpoint at `https://my-gift-cards.com/v1/balance`, the base URI you provide here is `https://my-gift-cards.com/`. */ deploymentUri?: string; } /** * this message is not directly used by any service, * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform. * e.g. SPIs, event-handlers, etc.. * NOTE: this context object MUST be provided as the last argument in each Velo method signature. * * Example: * ```typescript * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) { * ... * } * ``` */ interface Context { /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */ requestId?: string | null; /** * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. * @format CURRENCY */ currency?: string | null; /** An object that describes the identity that triggered this request. */ identity?: IdentificationData; /** A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. */ languages?: string[]; /** * The service provider app's instance ID. * @format GUID */ instanceId?: string | null; /** * Extension ID in Dev Center. * @internal * @maxLength 256 */ appExtensionId?: string | null; /** * Extension type in Dev Center. * @internal * @maxLength 256 */ appExtensionType?: string | null; /** * Invoked function. * @internal * @maxLength 256 */ functionName?: string | null; } declare enum IdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: IdentityType; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } interface GetBalanceEnvelope { request: GetBalanceRequest; metadata: Context; } interface RedeemEnvelope { request: RedeemRequest; metadata: Context; } interface _voidEnvelope { request: VoidRequest; metadata: Context; } declare const provideHandlers: ServicePluginDefinition<{ /** * * This method retrieves gift card data from your app. * Wix calls this method when a customer applies a gift card as a payment method at checkout. */ getBalance(payload: GetBalanceEnvelope): GetBalanceResponse | Promise; /** * * This method requests that a transaction be created by your app. * Wix calls this method when a customer completes a purchase that includes a gift card as a payment method at checkout. */ redeem(payload: RedeemEnvelope): RedeemResponse | Promise; /** * * This method requests that a gift card transaction be voided by your app. * Wix calls this method when a purchase fails after gift card redemption. */ _void(payload: _voidEnvelope): VoidResponse | Promise; }>; /** * Couldn't find the gift card. */ declare class GiftCardNotFoundWixError extends Error { /** @hidden */ httpCode: number; /** @hidden */ statusCode: string; /** @hidden */ applicationCode: string; /** @hidden */ name: string; /** @hidden */ errorType: string; /** @hidden */ spiErrorData: object; constructor(); /** @hidden */ static readonly __type = "wix_spi_error"; } /** * Gift card is disabled. */ declare class GiftCardDisabledWixError extends Error { /** @hidden */ httpCode: number; /** @hidden */ statusCode: string; /** @hidden */ applicationCode: string; /** @hidden */ name: string; /** @hidden */ errorType: string; /** @hidden */ spiErrorData: object; constructor(); /** @hidden */ static readonly __type = "wix_spi_error"; } /** * Gift card has expired. */ declare class GiftCardExpiredWixError extends Error { /** @hidden */ httpCode: number; /** @hidden */ statusCode: string; /** @hidden */ applicationCode: string; /** @hidden */ name: string; /** @hidden */ errorType: string; /** @hidden */ spiErrorData: object; constructor(); /** @hidden */ static readonly __type = "wix_spi_error"; } /** * Gift card currency is missing. */ declare class MissingCurrencyWixError extends Error { /** @hidden */ httpCode: number; /** @hidden */ statusCode: string; /** @hidden */ applicationCode: string; /** @hidden */ name: string; /** @hidden */ errorType: string; /** @hidden */ spiErrorData: object; constructor(); /** @hidden */ static readonly __type = "wix_spi_error"; } /** * Gift card doesn't have enough funds. */ declare class InsufficientFundsWixError extends Error { /** @hidden */ httpCode: number; /** @hidden */ statusCode: string; /** @hidden */ applicationCode: string; /** @hidden */ name: string; /** @hidden */ errorType: string; /** @hidden */ spiErrorData: object; constructor(); /** @hidden */ static readonly __type = "wix_spi_error"; } /** * Gift card was already redeemed for this order. */ declare class AlreadyRedeemedWixError extends Error { /** @hidden */ httpCode: number; /** @hidden */ statusCode: string; /** @hidden */ applicationCode: string; /** @hidden */ name: string; /** @hidden */ errorType: string; /** @hidden */ spiErrorData: object; constructor(); /** @hidden */ static readonly __type = "wix_spi_error"; } /** * Currency code isn't supported. */ declare class CurrencyNotSupportedWixError extends Error { /** @hidden */ httpCode: number; /** @hidden */ statusCode: string; /** @hidden */ applicationCode: string; /** @hidden */ name: string; /** @hidden */ errorType: string; /** @hidden */ spiErrorData: object; constructor(); /** @hidden */ static readonly __type = "wix_spi_error"; } /** * Couldn't find the transaction. */ declare class TransactionNotFoundWixError extends Error { /** @hidden */ httpCode: number; /** @hidden */ statusCode: string; /** @hidden */ applicationCode: string; /** @hidden */ name: string; /** @hidden */ errorType: string; /** @hidden */ spiErrorData: object; constructor(); /** @hidden */ static readonly __type = "wix_spi_error"; } /** * Transaction was already voided. */ declare class AlreadyVoidedWixError extends Error { /** @hidden */ httpCode: number; /** @hidden */ statusCode: string; /** @hidden */ applicationCode: string; /** @hidden */ name: string; /** @hidden */ errorType: string; /** @hidden */ spiErrorData: object; constructor(); /** @hidden */ static readonly __type = "wix_spi_error"; } export { AlreadyRedeemedWixError as A, type Context as C, type ExtendedFields as E, type GiftCardProviderEntity as G, IdentityType as I, MissingCurrencyWixError as M, type RedeemRequest as R, TransactionNotFoundWixError as T, type VoidRequest as V, type _voidEnvelope as _, type GetBalanceRequest as a, type GetBalanceResponse as b, type RedeemResponse as c, type VoidResponse as d, type GiftCardProviderConfig as e, type IdentificationData as f, type IdentificationDataIdOneOf as g, GiftCardNotFoundWixError as h, GiftCardDisabledWixError as i, GiftCardExpiredWixError as j, InsufficientFundsWixError as k, CurrencyNotSupportedWixError as l, AlreadyVoidedWixError as m, type GetBalanceEnvelope as n, type RedeemEnvelope as o, provideHandlers as p };