/** * The `Coupon` object represents all information available for a coupon * including its basic definition and runtime information. */ export interface Coupon { /** Coupon ID. */ _id?: string; /** Basic coupon info. */ specification?: Specification; /** Time the coupon was created (UNIX Epoch time in milliseconds). */ dateCreated?: string; /** Whether the coupon is expired. */ expired?: boolean; /** How many times this coupon has been used. */ numberOfUsages?: number; /** Coupon display information. */ displayData?: DisplayData; /** * ID of the app that created the coupon. Empty if created by the site owner. * @readonly */ appId?: string | null; } export interface MediaItem { /** Media item URL. */ url?: string; /** Media item width. */ width?: number; /** Media item height. */ height?: number; } /** Coupon information */ export interface Specification extends SpecificationScopeOrMinSubtotalOneOf, SpecificationBehaviorOneOf { /** Specifies the type of line items this coupon will apply to. See the [introduction](#introduction) for a table of currently supported coupon scopes. */ scope?: Scope; /** The coupon is only applicable when the order subtotal is over this amount. */ minimumSubtotal?: number | null; /** Discount as a fixed amount. */ moneyOffAmount?: number; /** Discount as a percentage. */ percentOffRate?: number; /** * Free shipping. * * If `true`, the coupon applies to all items in all `namespaces`. */ freeShipping?: boolean; /** Fixed sale price. */ fixedPriceAmount?: number; /** * Receive free products when making a purchase. * * For example, purchase `x` number of products and receive `y` number of products for free. */ buyXGetY?: BuyXGetY; /** Name of coupon. */ name?: string | null; /** * Coupon code. Must be unique for all coupons on your site. * * Max: 20 characters */ code?: string | null; /** Coupon valid from this date and time. */ startTime?: string | null; /** Coupon expires at this date and time. */ expirationTime?: string | null; /** * Maximum number of times the coupon can be used. * * >**Note:** Multiple purchases by the same customer or purchases by different customers are both counted toward `usageLimit`. */ usageLimit?: number | null; /** Maximum number of times the coupon can be used per customer. */ limitPerCustomer?: number | null; /** * Whether the coupon is limited to one item. * * If `true` and a customer pays for multiple items, the discount applies to only the lowest priced item. * Coupons with a `bookings` `scope.namespace` are always limited to one item. */ limitedToOneItem?: boolean | null; /** * Whether the coupon applies to subscription products. * * If set to `true`, the discount will apply to all billing cycles. */ appliesToSubscriptions?: boolean | null; /** * Specifies the amount of discounted cycles for a subscription item. * * + Can only be set when `scope.namespace = pricingPlans`. * + If `discountedCycleCount` is empty, the coupon applies to all available cycles. * + `discountedCycleCount` is ignored if `appliesToSubscriptions = true`. * * Max: `999` */ discountedCycleCount?: number | null; /** * Whether the coupon is currently [active](https://support.wix.com/en/article/wix-stores-activating-and-deactivating-coupons). * * Default: `true` */ active?: boolean | null; /** Coupon type. Read-only. */ type?: string; } /** @oneof */ export interface SpecificationScopeOrMinSubtotalOneOf { /** Specifies the type of line items this coupon will apply to. See the [introduction](#introduction) for a table of currently supported coupon scopes. */ scope?: Scope; /** The coupon is only applicable when the order subtotal is over this amount. */ minimumSubtotal?: number | null; } /** @oneof */ export interface SpecificationBehaviorOneOf { /** Discount as a fixed amount. */ moneyOffAmount?: number; /** Discount as a percentage. */ percentOffRate?: number; /** * Free shipping. * * If `true`, the coupon applies to all items in all `namespaces`. */ freeShipping?: boolean; /** Fixed sale price. */ fixedPriceAmount?: number; /** * Receive free products when making a purchase. * * For example, purchase `x` number of products and receive `y` number of products for free. */ buyXGetY?: BuyXGetY; } export interface Scope { /** Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) */ namespace?: string; /** Group within a `namespace` for which the coupon is applicable. If no group is specified, the coupon applies to all items in the namespace. `group` is required in some cases. See the table in the [introduction](#introduction) for a list of currently supported groups for each namespace. */ group?: Group; } export interface Group { /** Name of coupon scope's group (e.g., product or collection in Wix Stores). See the [introduction](#introduction) for a table of currently supported coupon scopes. */ name?: string; /** ID of the specific item in the group for which the coupon is applicable. If no `entityId` is specified, the coupon applies to all items in the group. In some cases when a group is specified, an `entityId` is required. See the [introduction](#introduction) for a list of currently supported entities for each namespace and group. */ entityId?: string | null; } /** Coupon type. */ export interface BuyXGetY { /** Number of purchased items required to receive free items. */ x?: number; /** Number of items received for free if required number of items were purchased. */ y?: number; } export interface DisplayData { /** Coupon name to be displayed. */ name?: string; /** Displayed media item information. */ mediaItem?: MediaItem; /** Formatted price for display. */ formattedPrice?: string | null; } export interface CreateCouponRequest { /** Coupon to create. */ specification?: Specification; } export interface CreateCouponResponse { /** ID of the newly created coupon. */ _id?: string; } export interface UpdateCouponRequest { /** ID of the coupon to update. */ _id: string; /** Field mask of fields to update (required - passing an empty `fieldMask` will return an error). Valid field masks are any of those in the `specification` field. */ fieldMask?: string[]; /** Coupon information to update. */ specification?: Specification; } export interface UpdateCouponResponse { } export interface GetCouponRequest { /** ID of the coupon to retrieve. */ _id: string; } export interface GetCouponResponse { /** Retrieved coupon. */ coupon?: Coupon; } export interface DeleteCouponRequest { /** ID of the coupon to delete. */ _id: string; } export interface DeleteCouponResponse { } export interface QueryCouponsRequest { query?: Query; } export interface Query { /** Optional pagination parameters */ paging?: Paging; /** Filter string (e.g., when {"expired":"true"}, expired coupons will be returned). */ filter?: string | null; /** Sort string. */ sort?: string | null; } export interface Paging { /** Number of items to load. */ limit?: number | null; /** Offset since the beginning of the collection. */ offset?: number | null; } export interface QueryCouponsResponse { /** Returned coupons. */ coupons?: Coupon[]; /** Total results. */ totalResults?: number | null; } export interface CalculateRequest extends CalculateRequestCalculateByOneOf { /** For calculating by coupon ID (usually for cart calculate phase). */ _id?: string; /** For calculating by coupon code (usually for apply coupon phase - for validation). */ code?: string; /** Type of in-memory discount that can be applied when coupon doesn't exist. */ discount?: Specification; /** Cart to which the coupon will be applied. */ cart?: Cart; /** Currency symbol for error message and applied coupon. */ currencySymbol?: string; /** Round the result to places after the decimal dot. Defaults to 2 if not provided. */ precision?: number | null; /** Unique identifier of a buyer that applied the coupon. Used to limit coupon use per customer. */ uniqueUserIdentifier?: string | null; } /** @oneof */ export interface CalculateRequestCalculateByOneOf { /** For calculating by coupon ID (usually for cart calculate phase). */ _id?: string; /** For calculating by coupon code (usually for apply coupon phase - for validation). */ code?: string; /** Type of in-memory discount that can be applied when coupon doesn't exist. */ discount?: Specification; } /** * Cart is passed to coupon service's apply function in order to * apply the coupons calculation on it */ export interface Cart { /** Array of cart line items. */ lineItems?: LineItem[]; /** Cart shipping information. */ shipping?: Shipping; /** Summary of cart totals. */ totals?: Totals; } export interface AppliedDiscount { /** Discount amount, in case discount is applied per line. */ discountAmount?: number; /** Line item price after applied discount. */ afterDiscountAmount?: number; } /** represents a single line in the cart */ export interface LineItem { /** Cart line item ID - represents index position (required). */ lineId?: string; /** Item ID in the external system - will usually be a product ID. */ externalId?: string; /** Line item amount (while quantity = 1). */ amount?: number; /** Line item quantity. Must be greater than 0. */ quantity?: number; /** Coupon scopes this line item applies to. */ scopes?: Scope[]; /** Applied discount on line item after calculation. */ appliedDiscount?: AppliedDiscount; /** Whether the line item is of type subscription. */ subscription?: boolean; } /** * represents the shipping line in the cart * the coupons need to know about it because of the free shipping coupon */ export interface Shipping { /** Shipping price before applying the coupon. */ amount?: number; /** Discount on shipping price. */ appliedDiscount?: AppliedDiscount; } export interface Totals { /** Cart subtotal. */ subTotal?: number; /** Sum of all discounts. */ discount?: number; total?: number; } export interface CalculateResponse { /** Cart after applying the coupon. */ cart?: Cart; /** Applied coupon information. */ appliedCoupon?: AppliedCoupon; /** Errors, in case call failed. */ error?: Error[]; } export interface AppliedCoupon { /** Name of the coupon applied. */ name?: string; /** Coupon ID. */ _id?: string; /** Coupon code. */ code?: string; /** Whether the coupon type entitles free shipping. */ isFreeShipping?: boolean; /** Coupon type (e.g., moneyOffAmount, buyXGetY, percentOffRate). */ couponType?: string; /** Discount value (e.g., $10, 10%). */ discountValue?: string; /** Amount of discounted cycles for subscription item. None specifies for all cycles. */ discountedCycleCount?: number | null; } export interface Error { /** error code */ code?: string; /** descriptive error message */ message?: string; } export interface IncreaseUsageRequest { /** Coupon ID. */ _id?: string; /** Unique ID of the entity that the coupon was applied to (e.g., orderId). */ usedBy?: string | null; /** Unique identifier of a buyer that applied the coupon. Used to limit coupon use per customer. */ uniqueUserIdentifier?: string | null; /** ID of app that applied the coupon (e.g. bookings appDefId). */ wixAppId?: string | null; } export interface IncreaseUsageResponse { /** Errors, in case call failed. */ error?: Error[]; } export interface CouponApplied { /** Applied coupon information. */ coupon?: Coupon; /** * ID of Wix app that applied the coupon. Supported values: * + Wix Stores - `1380b703-ce81-ff05-f115-39571d94dfcd` * + Wix Bookings - `13d21c63-b5ec-5912-8397-c3a5ddb27a97` * + Wix Events - `140603ad-af8d-84a5-2c80-a0f60cb47351` */ wixAppId?: string; /** ID of the entity that the coupon was applied to (orderId, bookingId, etc.). */ wixAppOrderId?: string; } export interface HasCouponsRequest { } export interface HasCouponsResponse { /** True if site has ever had a coupon. */ hasCoupons?: boolean; } export interface BulkDeleteCouponsRequest { /** IDs of coupons to delete. */ ids?: string[]; } export interface BulkDeleteCouponsResponse { /** Item metadata. */ results?: ItemMetadata[]; /** Bulk action metadata. */ deleteMetadata?: BulkActionMetadata; } 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 BulkCreateCouponsRequest { /** List of coupon specifications to be created. */ specifications?: Specification[]; /** * Whether to return full coupon entity in the response. * * Default: `false` */ returnFullEntity?: boolean; } export interface BulkCreateCouponsResponse { /** Items created by bulk action. */ results?: BulkCreateCouponResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } export interface BulkCreateCouponResult { /** Item metadata. */ itemMetadata?: ItemMetadata; /** New coupons. */ coupon?: Coupon; } 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 { entity?: string; } 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. */ currentEntity?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntity?: string | null; } export interface ActionEvent { body?: string; } 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" } export interface CreateCouponResponseNonNullableFields { _id: string; } interface GroupNonNullableFields { name: string; } interface ScopeNonNullableFields { namespace: string; group?: GroupNonNullableFields; } interface BuyXGetYNonNullableFields { x: number; y: number; } interface SpecificationNonNullableFields { scope?: ScopeNonNullableFields; moneyOffAmount: number; percentOffRate: number; freeShipping: boolean; fixedPriceAmount: number; buyXGetY?: BuyXGetYNonNullableFields; type: string; } interface MediaItemNonNullableFields { url: string; width: number; height: number; } interface DisplayDataNonNullableFields { name: string; mediaItem?: MediaItemNonNullableFields; } export interface CouponNonNullableFields { _id: string; specification?: SpecificationNonNullableFields; dateCreated: string; expired: boolean; numberOfUsages: number; displayData?: DisplayDataNonNullableFields; } export interface GetCouponResponseNonNullableFields { coupon?: CouponNonNullableFields; } export interface QueryCouponsResponseNonNullableFields { coupons: CouponNonNullableFields[]; } interface ApplicationErrorNonNullableFields { code: string; description: string; } interface ItemMetadataNonNullableFields { originalIndex: number; success: boolean; error?: ApplicationErrorNonNullableFields; } interface BulkActionMetadataNonNullableFields { totalSuccesses: number; totalFailures: number; undetailedFailures: number; } export interface BulkDeleteCouponsResponseNonNullableFields { results: ItemMetadataNonNullableFields[]; deleteMetadata?: BulkActionMetadataNonNullableFields; } interface BulkCreateCouponResultNonNullableFields { itemMetadata?: ItemMetadataNonNullableFields; coupon?: CouponNonNullableFields; } export interface BulkCreateCouponsResponseNonNullableFields { results: BulkCreateCouponResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } export interface BaseEventMetadata { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; } export interface EventMetadata extends BaseEventMetadata { /** * 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; } export interface CouponCreatedEnvelope { entity: Coupon; metadata: EventMetadata; } /** * Triggered when a coupon is created. * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionId COUPONS.MANAGE * @webhook * @eventType wix.ecommerce.coupons.v2.coupon_created */ export declare function onCouponCreated(handler: (event: CouponCreatedEnvelope) => void | Promise): void; export interface CouponUpdatedEnvelope { entity: Coupon; metadata: EventMetadata; } /** * Triggered when a coupon specification is updated. * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionId COUPONS.MANAGE * @webhook * @eventType wix.ecommerce.coupons.v2.coupon_updated */ export declare function onCouponUpdated(handler: (event: CouponUpdatedEnvelope) => void | Promise): void; export interface CouponDeletedEnvelope { metadata: EventMetadata; } /** * Triggered when a coupon is deleted. * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionId COUPONS.MANAGE * @webhook * @eventType wix.ecommerce.coupons.v2.coupon_deleted */ export declare function onCouponDeleted(handler: (event: CouponDeletedEnvelope) => void | Promise): void; export interface CouponAppliedEnvelope { data: CouponApplied; metadata: EventMetadata; } /** * Triggered when a coupon is applied. * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionId COUPONS.MANAGE * @webhook * @eventType wix.ecommerce.coupons.v2.coupon_applied */ export declare function onCouponApplied(handler: (event: CouponAppliedEnvelope) => void | Promise): void; /** * Creates a new coupon. * * The `createCoupon()` function returns a Promise that resolves to the new coupon when it is created. * * When creating a coupon, the `specification` object must contain values for `name`, `code`, `startTime`, and either `scope` or `minimumSubtotal`. The exception is for a `freeShipping` coupon type, for which you cannot apply a `scope` and `minimumSubtotal` is optional. * * The coupon `scope` defines the items a coupon applies to. A coupon can apply to all items in a specific Wix application, a group within the application, or a single item within a group. See the [introduction](#introduction) for a table of currently supported coupon scopes. * * The `specification` object must also contain a value for exactly 1 of the following coupon properties. This defines the coupon type. * * + `"moneyOffAmount"` * + `"percentOffRate"` * + `"freeShipping"` * + `"fixedPriceAmount"` * + `"buyXGetY"` * @param specification - Coupon to create. * @public * @requiredField specification * @permissionId COUPONS.MANAGE * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @applicableIdentity APP * @fqn wix.coupons.api.v2.CouponsV2.Create */ export declare function createCoupon(specification: Specification): Promise; /** * Updates a coupon. * * The `updateCoupon()` function returns a Promise that resolves when the coupon is updated. * * Only the properties passed in the `specification` object will be updated. All other properties will remain the same. * * To remove a value from the coupon, pass its corresponding property with a value of `null`. * * When updating a coupon, you cannot change the coupon's `type`. For example, if the coupon's `type` is `moneyOffAmount`, you cannot change it to `fixedPriceAmount`. You can update the coupon type's value. For example, you can change the value of `moneyOffAmount` from `5` to `10`. * * The coupon `scope` defines the items a coupon applies to. A coupon can apply to all items in a specific Wix application, a group within the application, or a single item within a group. * See the [introduction](#introduction) for a table of currently supported coupon scopes. * @param _id - ID of the coupon to update. * @param specification - Coupon information to update. * @param fieldMask - Field mask of fields to update (required - passing an empty `fieldMask` will return an error). Valid field masks are any of those in the `specification` field. * @public * @requiredField _id * @requiredField fieldMask * @requiredField specification * @permissionId COUPONS.MANAGE * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @applicableIdentity APP * @fqn wix.coupons.api.v2.CouponsV2.Update */ export declare function updateCoupon(_id: string, specification: Specification, fieldMask: string[]): Promise; /** * Retrieves a coupon by ID. * * The `getCoupon()` function returns a Promise that resolves when the specified coupon is retrieved. * @param _id - ID of the coupon to retrieve. * @public * @requiredField _id * @permissionId COUPONS.MANAGE * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @applicableIdentity APP * @returns Retrieved coupon. * @fqn wix.coupons.api.v2.CouponsV2.Get */ export declare function getCoupon(_id: string): Promise; /** * Deletes a coupon. * * The `deleteCoupon()` function returns a Promise that resolves when the specified coupon is deleted. * @param _id - ID of the coupon to delete. * @public * @requiredField _id * @permissionId COUPONS.MANAGE * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @applicableIdentity APP * @fqn wix.coupons.api.v2.CouponsV2._delete */ export declare function deleteCoupon(_id: string): Promise; /** * Retrieves a list of up to 100 coupons with pagination and filters. * * The `queryCoupons()` function returns a Promise that resolves when the coupons are retrieved. * @public * @requiredField query * @permissionId COUPONS.MANAGE * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @applicableIdentity APP * @fqn wix.coupons.api.v2.CouponsV2.Query */ export declare function queryCoupons(query: Query): Promise; /** * Deletes the specified coupons. * * The `bulkDeleteCoupons()` function returns a Promise that resolves when the coupons are deleted. * @param ids - IDs of coupons to delete. * @public * @requiredField ids * @permissionId COUPONS.MANAGE * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @applicableIdentity APP * @fqn wix.coupons.api.v2.CouponsV2.BulkDeleteCoupons */ export declare function bulkDeleteCoupons(ids: string[]): Promise; /** * Creates multiple coupons. * * The `bulkCreateCoupons()` function returns a Promise that resolves when the coupons are created. * @param specifications - List of coupon specifications to be created. * @public * @requiredField specifications * @permissionId COUPONS.MANAGE * @permissionScope Manage Coupons * @permissionScopeId SCOPE.DC-COUPONS.MANAGE-COUPONS * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @applicableIdentity APP * @fqn wix.coupons.api.v2.CouponsV2.BulkCreateCoupons */ export declare function bulkCreateCoupons(specifications: Specification[], options?: BulkCreateCouponsOptions): Promise; export interface BulkCreateCouponsOptions { /** * Whether to return full coupon entity in the response. * * Default: `false` */ returnFullEntity?: boolean; } export {};