Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Coupons

Manage coupons for use in your storefront.

For instructions on how to retrieve access token for admin APIs: https://developer.salesforce.com/docs/commerce/commerce-api/guide/authorization-for-admin-apis.html

Example with admin auth

import { Pricing, ClientConfig } from "commerce-sdk";
// or
const { Pricing, ClientConfig } = require("commerce-sdk");

const clientConfig: ClientConfig = {
  parameters: {
    clientId: "XXXXXX",
    organizationId: "XXXX",
    shortCode: "XXX",
    siteId: "XX"
  }
};

token = { access_token: 'INSERT_ACCESS_TOKEN_HERE' };

clientConfig.headers['authorization'] = `Bearer ${token.access_token}`;
const couponsClient = new Pricing.Coupons(clientConfig);
API Version: 1.0.28
Last Updated:

Hierarchy

  • BaseClient
    • Coupons

Index

Type aliases

Static AsyncCreated

AsyncCreated: {}

Type declaration

Static AttributeDefinition

AttributeDefinition: { defaultValue?: PropertyValueDefinition; description: L10nString; id?: string; key?: boolean; localizable?: boolean; mandatory?: boolean; max?: number; min?: number; minLength?: number; multiValueType?: boolean; name: L10nString; possibleValues?: Array<PropertyValueDefinition>; regularExpression?: string; scale?: number; searchable?: boolean; siteSpecific?: boolean; system?: boolean; type: string; unit?: L10nString; visible?: boolean }

Type declaration

  • Optional defaultValue?: PropertyValueDefinition
  • description: L10nString
  • Optional id?: string
  • Optional key?: boolean
  • Optional localizable?: boolean
  • Optional mandatory?: boolean
  • Optional max?: number
  • Optional min?: number
  • Optional minLength?: number
  • Optional multiValueType?: boolean
  • name: L10nString
  • Optional possibleValues?: Array<PropertyValueDefinition>
  • Optional regularExpression?: string
  • Optional scale?: number
  • Optional searchable?: boolean
  • Optional siteSpecific?: boolean
  • Optional system?: boolean
  • type: string
  • Optional unit?: L10nString
  • Optional visible?: boolean

Static BoolFilter

BoolFilter: { filters?: Array<Filter>; operator: string } & {}

Static BoolQuery

BoolQuery: { must?: Array<Query>; mustNot?: Array<Query>; should?: Array<Query> } & {}

Static ChangeControlled

ChangeControlled: { createdBy?: string; creationDate?: any; lastModifiedBy?: string; modificationDate?: any } & {}

Static ChangeControlledDataType

ChangeControlledDataType: { createdBy?: string; creationDate?: any; lastModifiedBy?: string; modificationDate?: any } & {}

Static ClosedObject

ClosedObject: {} & {}

Static Coupon

Coupon: { couponId: string; creationDate?: any; description?: string; enabled: boolean; exportedCodeCount?: number; lastModified?: any; redemptionCount?: number; redemptionLimits?: RedemptionLimits; singleCode?: string; systemCodesConfig?: CouponSystemCodeConfig; totalCodesCount?: number; type: string }

Type declaration

  • couponId: string
  • Optional creationDate?: any
  • Optional description?: string
  • enabled: boolean
  • Optional exportedCodeCount?: number
  • Optional lastModified?: any
  • Optional redemptionCount?: number
  • Optional redemptionLimits?: RedemptionLimits
  • Optional singleCode?: string
  • Optional systemCodesConfig?: CouponSystemCodeConfig
  • Optional totalCodesCount?: number
  • type: string

Static CouponCode

CouponCode: { code: string; issued: boolean; redemptionCount: number }

Type declaration

  • code: string
  • issued: boolean
  • redemptionCount: number

Static CouponCodeRedemptionRequest

CouponCodeRedemptionRequest: { code: string; customerEmail?: string; orderNo: string }

Type declaration

  • code: string
  • Optional customerEmail?: string
  • orderNo: string

Static CouponCodes

CouponCodes: { data: Array<CouponCode>; limit?: number; offset?: any; total: number }

Type declaration

  • data: Array<CouponCode>
  • Optional limit?: number
  • Optional offset?: any
  • total: number

Static CouponMultiCodesRequest

CouponMultiCodesRequest: { codes: Array<string> }

Type declaration

  • codes: Array<string>

Static CouponNotFound

CouponNotFound: {}

Type declaration

Static CouponRedemption

CouponRedemption: { code: string; couponId: string; creationDate: any; customerEmail: string; orderNo: string; viewOrderUrl: string }

Type declaration

  • code: string
  • couponId: string
  • creationDate: any
  • customerEmail: string
  • orderNo: string
  • viewOrderUrl: string

Static CouponRedemptionSearchResult

CouponRedemptionSearchResult: { hits: Array<CouponRedemption>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}

Static CouponSearchResult

CouponSearchResult: { hits: Array<Coupon>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}

Static CouponSystemCodeConfig

CouponSystemCodeConfig: { codePrefix: string; numberOfCodes: number }

Type declaration

  • codePrefix: string
  • numberOfCodes: number

Static DateConditionalRequest

DateConditionalRequest: {}

Type declaration

Static DateRangeFilter

DateRangeFilter: {}

Type declaration

Static DatetimeRangeFilter

DatetimeRangeFilter: {}

Type declaration

Static Error

Error: { detail?: string; instance?: string; title?: string; type: string } & {}

Static ErrorResponse

ErrorResponse: { detail?: string; instance?: string; title?: string; type: string } & {}

Static EtagConditionalRequest

EtagConditionalRequest: {}

Type declaration

Static EtagResponse

EtagResponse: {}

Type declaration

Static Filter

Filter: { boolFilter?: BoolFilter; queryFilter?: QueryFilter; range2Filter?: Range2Filter; rangeFilter?: RangeFilter; termFilter?: TermFilter } & {}

Static FilteredQuery

FilteredQuery: { filter: Filter; query: Query } & {}

Static IntegerRangeFilter

IntegerRangeFilter: {}

Type declaration

Static L10nString

L10nString: {} & {}

Static LocalizedString

LocalizedString: {} & {}

Static MatchAllQuery

MatchAllQuery: {} & {}

Static Money

Money: { currencyMnemonic?: string; value?: number } & {}

Static MoneyMnemonic

MoneyMnemonic: { currencyMnemonic?: string; value?: number } & {}

Static NestedQuery

NestedQuery: { path: string; query: Query; scoreMode?: string } & {}

Static NoPropertiesAllowed

NoPropertiesAllowed: {}

Type declaration

Static NumericRangeFilter

NumericRangeFilter: {}

Type declaration

Static OffsetPaginated

OffsetPaginated: {}

Type declaration

Static OpenObject

OpenObject: {} & {}

Static PaginatedSearchResult

PaginatedSearchResult: { hits?: Array<object>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}

Static PaginatedSearchResultBase

PaginatedSearchResultBase: { hits?: Array<object>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}

Static PropertyDefinition

PropertyDefinition: { defaultValue?: PropertyValueDefinition; description: L10nString; id?: string; key?: boolean; localizable?: boolean; mandatory?: boolean; max?: number; min?: number; minLength?: number; multiValueType?: boolean; name: L10nString; possibleValues?: Array<PropertyValueDefinition>; regularExpression?: string; scale?: number; searchable?: boolean; siteSpecific?: boolean; system?: boolean; type: string; unit?: L10nString; visible?: boolean } & {}

Static PropertyValueDefinition

PropertyValueDefinition: { description: L10nString; displayValue: L10nString; id: string; position?: number; value: string }

Type declaration

  • description: L10nString
  • displayValue: L10nString
  • id: string
  • Optional position?: number
  • value: string

Static Query

Query: { boolQuery?: BoolQuery; filteredQuery?: FilteredQuery; matchAllQuery?: MatchAllQuery; nestedQuery?: NestedQuery; termQuery?: TermQuery; textQuery?: TextQuery } & {}

Static QueryFilter

QueryFilter: { query: Query } & {}

Static QueryParamsLimit

QueryParamsLimit: {}

Type declaration

Static QueryParamsOffset

QueryParamsOffset: {}

Type declaration

Static Range2Filter

Range2Filter: { filterMode?: string; fromField: string; fromInclusive?: boolean; fromValue?: any; toField: string; toInclusive?: boolean; toValue?: any } & {}

Static RangeFilter

RangeFilter: {}

Type declaration

Static RateLimited

RateLimited: {}

Type declaration

Static RateLimited2

RateLimited2: {}

Type declaration

Static RateLimited3

RateLimited3: {}

Type declaration

Static RateLimited4

RateLimited4: {}

Type declaration

Static RateLimited5

RateLimited5: {}

Type declaration

Static RedemptionLimitPerPeriod

RedemptionLimitPerPeriod: { limit: number; redemptionTimeFrame: number }

Type declaration

  • limit: number
  • redemptionTimeFrame: number

Static RedemptionLimits

RedemptionLimits: { limitPerCode: number; limitPerCustomer: number; limitPerTimeFrame: RedemptionLimitPerPeriod }

Type declaration

Static SearchRequest

SearchRequest: { limit?: number; offset?: any; query: Query; sorts?: Array<Sort> } & {}

Static SearchRequestBase

SearchRequestBase: { limit?: number; offset?: any; query: Query; sorts?: Array<Sort> } & {}

Static Selectable

Selectable: {}

Type declaration

Static SimpleSearchResult

SimpleSearchResult: { hits?: Array<object>; limit: number; offset: any; total: any } & {}

Static SimpleSearchResultBase

SimpleSearchResultBase: { hits?: Array<object>; limit: number; offset: any; total: any } & {}

Static SiteSpecific

SiteSpecific: {}

Type declaration

Static Sort

Sort: { field: string; sortOrder?: string } & {}

Static SpecifiedPropertiesAllowed

SpecifiedPropertiesAllowed: {} & {}

Static SyncCreated

SyncCreated: {}

Type declaration

Static TermFilter

TermFilter: { field: string; operator: string; values?: Array<any> } & {}

Static TermQuery

TermQuery: { fields: Array<string>; operator: string; values?: Array<any> } & {}

Static TextQuery

TextQuery: { fields: Array<string>; searchPhrase: string } & {}

Constructors

constructor

  • new Coupons(config: ClientConfig): Coupons
  • Parameters

    • config: ClientConfig

    Returns Coupons

Properties

clientConfig

clientConfig: ClientConfig

Methods

couponRedemptionsSearch

  • couponRedemptionsSearch(options: { body: SearchRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<CouponRedemptionSearchResult>
  • couponRedemptionsSearch<T>(options: { body: SearchRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Coupons.CouponRedemptionSearchResult>
  • Searches for coupon redemptions.

    The Coupon Redemption Search document contains a search object that allows filtering on various attributes.

    The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:

    Attribute Type
    code String
    couponId String
    customerEmail String
    orderNo String

    Note that only searchable attributes can be used in sorting.

    If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.

    If you would like to get a raw Response object use the other couponRedemptionsSearch function.

    Parameters

    • options: { body: SearchRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: SearchRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<CouponRedemptionSearchResult>

    A promise of type Coupons.CouponRedemptionSearchResult.

  • Searches for coupon redemptions.

    The Coupon Redemption Search document contains a search object that allows filtering on various attributes.

    The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:

    Attribute Type
    code String
    couponId String
    customerEmail String
    orderNo String

    Note that only searchable attributes can be used in sorting.

    If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: SearchRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: SearchRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Coupons.CouponRedemptionSearchResult>

    A promise of type Response if rawResponse is true, a promise of type Coupons.CouponRedemptionSearchResult otherwise.

couponsSearch

  • couponsSearch(options: { body: SearchRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<CouponSearchResult>
  • couponsSearch<T>(options: { body: SearchRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Coupons.CouponSearchResult>
  • Searches for coupons.

    The Coupon Search document contains a search object that allows filtering on various attributes.

    The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:

    Attribute Type
    couponId String
    description String
    type one of {"single_code", "multiple_codes", "system_codes"}
    enabled Boolean

    Note that only searchable attributes can be used in sorting.

    If you would like to get a raw Response object use the other couponsSearch function.

    Parameters

    • options: { body: SearchRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: SearchRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<CouponSearchResult>

    A promise of type Coupons.CouponSearchResult.

  • Searches for coupons.

    The Coupon Search document contains a search object that allows filtering on various attributes.

    The query attribute specifies a complex query that can be used to narrow down the search with the following searchable attributes:

    Attribute Type
    couponId String
    description String
    type one of {"single_code", "multiple_codes", "system_codes"}
    enabled Boolean

    Note that only searchable attributes can be used in sorting.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: SearchRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: SearchRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Coupons.CouponSearchResult>

    A promise of type Response if rawResponse is true, a promise of type Coupons.CouponSearchResult otherwise.

createCoupon

  • createCoupon(options: { body: Coupon; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<Coupon>
  • createCoupon<T>(options: { body: Coupon; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Coupons.Coupon>
  • Creates a coupon using the information provided. If a coupon exists with the same unique identifier, the coupon is replaced completely.

    If you would like to get a raw Response object use the other createCoupon function.

    Parameters

    • options: { body: Coupon; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: Coupon
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<Coupon>

    A promise of type Coupons.Coupon.

  • Creates a coupon using the information provided. If a coupon exists with the same unique identifier, the coupon is replaced completely.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: Coupon; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: Coupon
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Coupons.Coupon>

    A promise of type Response if rawResponse is true, a promise of type Coupons.Coupon otherwise.

deleteCoupon

  • deleteCoupon(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<void>
  • deleteCoupon<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : void>
  • Delete a coupon by ID.

    If you would like to get a raw Response object use the other deleteCoupon function.

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<void>

    A promise of type void.

  • Delete a coupon by ID.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

getCoupon

  • getCoupon(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<Coupon>
  • getCoupon<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Coupons.Coupon>
  • Returns coupon information for the given coupon ID. If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.

    If you would like to get a raw Response object use the other getCoupon function.

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<Coupon>

    A promise of type Coupons.Coupon.

  • Returns coupon information for the given coupon ID. If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Coupons.Coupon>

    A promise of type Response if rawResponse is true, a promise of type Coupons.Coupon otherwise.

getCouponCodes

  • getCouponCodes(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; limit?: number; offset?: any; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<CouponCodes>
  • getCouponCodes<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; limit?: number; offset?: any; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Coupons.CouponCodes>
  • Get the coupon codes for the given coupon.

    If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.

    If you would like to get a raw Response object use the other getCouponCodes function.

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; limit?: number; offset?: any; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; limit?: number; offset?: any; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<CouponCodes>

    A promise of type Coupons.CouponCodes.

  • Get the coupon codes for the given coupon.

    If the user role does not have the View_Coupon_Codes permission, then the coupon codes returned are masked.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; limit?: number; offset?: any; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; limit?: number; offset?: any; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Coupons.CouponCodes>

    A promise of type Response if rawResponse is true, a promise of type Coupons.CouponCodes otherwise.

redeemCoupon

  • redeemCoupon(options: { body: CouponCodeRedemptionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<void>
  • redeemCoupon<T>(options: { body: CouponCodeRedemptionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : void>
  • Redeems a coupon code for an existing coupon within the selected site. The coupon code must be redeemable.

    If you would like to get a raw Response object use the other redeemCoupon function.

    Parameters

    • options: { body: CouponCodeRedemptionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: CouponCodeRedemptionRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<void>

    A promise of type void.

  • Redeems a coupon code for an existing coupon within the selected site. The coupon code must be redeemable.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: CouponCodeRedemptionRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: CouponCodeRedemptionRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

updateCoupon

  • updateCoupon(options: { body: Coupon; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<Coupon>
  • updateCoupon<T>(options: { body: Coupon; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : Coupons.Coupon>
  • Updates the coupon with the specified information.

    If you would like to get a raw Response object use the other updateCoupon function.

    Parameters

    • options: { body: Coupon; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: Coupon
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<Coupon>

    A promise of type Coupons.Coupon.

  • Updates the coupon with the specified information.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: Coupon; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: Coupon
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : Coupons.Coupon>

    A promise of type Response if rawResponse is true, a promise of type Coupons.Coupon otherwise.

updateCouponCodes

  • updateCouponCodes(options: { body: CouponMultiCodesRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; delete?: boolean; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<void>
  • updateCouponCodes<T>(options: { body: CouponMultiCodesRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; delete?: boolean; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : void>
  • Add or delete (modify) multiple codes to and from the supplied coupon.

    If you would like to get a raw Response object use the other updateCouponCodes function.

    Parameters

    • options: { body: CouponMultiCodesRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; delete?: boolean; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: CouponMultiCodesRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; delete?: boolean; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<void>

    A promise of type void.

  • Add or delete (modify) multiple codes to and from the supplied coupon.

    Type parameters

    • T: boolean

    Parameters

    • options: { body: CouponMultiCodesRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { couponId: string; delete?: boolean; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • body: CouponMultiCodesRequest
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { couponId: string; delete?: boolean; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true ? Response : void>

    A promise of type Response if rawResponse is true, a promise of type void otherwise.

Generated using TypeDoc