Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GiftCertificates

Manage your gift certificates.

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 giftCertificatesClient = new Pricing.GiftCertificates(clientConfig);
API Version: 1.0.24
Last Updated:

Hierarchy

  • BaseClient
    • GiftCertificates

Index

Type aliases

Static AccountTransaction

AccountTransaction: { amount: Money; orderNo: string; timestamp: any; typeCode: string } & {}

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<any>; operator: string } & {}

Static BoolQuery

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

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 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: any; query: any } & {}

Static GiftCertificate

GiftCertificate: { amount?: Money; balance?: Money; creationDate?: any; description?: string; enabled?: boolean; lastModified?: any; maskedGiftCertificateCode?: string; merchantId?: string; message?: string; orderNo?: string; recipientEmail?: string; recipientName?: string; senderName?: string; status?: string; transactions?: Array<AccountTransaction> } & {}

Static GiftCertificateAmountOutOfRangeException

GiftCertificateAmountOutOfRangeException: {}

Type declaration

Static GiftCertificateCreateMerchantIdNotUniqueException

GiftCertificateCreateMerchantIdNotUniqueException: {}

Type declaration

Static GiftCertificateNotFound

GiftCertificateNotFound: {}

Type declaration

Static GiftCertificateSearchResult

GiftCertificateSearchResult: { hits: Array<GiftCertificate>; limit: number; offset: any; query: any; sorts?: Array<Sort>; total: any } & {}

Static GiftCertificates

GiftCertificates: { data?: Array<GiftCertificate>; limit: number; offset: any; total?: number } & {}

Static IntegerRangeFilter

IntegerRangeFilter: {}

Type declaration

Static InvalidGiftCertificateException

InvalidGiftCertificateException: {}

Type declaration

Static InvalidGiftCertificateStatus

InvalidGiftCertificateStatus: {}

Type declaration

Static InvalidRecipientEmail

InvalidRecipientEmail: {}

Type declaration

Static L10nString

L10nString: {} & {}

Static LocalizedString

LocalizedString: {} & {}

Static MalformedQuery

MalformedQuery: {}

Type declaration

Static MatchAllQuery

MatchAllQuery: {} & {}

Static Money

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

Static MoneyMnemonic

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

Static NestedQuery

NestedQuery: { path: string; query: any; 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: any; sorts?: Array<Sort>; total: any } & {}

Static PaginatedSearchResultBase

PaginatedSearchResultBase: { hits?: Array<object>; limit: number; offset: any; query: any; 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: any } & {}

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 SearchRequest

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

Static SearchRequestBase

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

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 } & {}

Static UnqueryableField

UnqueryableField: {}

Type declaration

Constructors

constructor

  • Parameters

    • config: ClientConfig

    Returns GiftCertificates

Properties

clientConfig

clientConfig: ClientConfig

Methods

createGiftCertificate

  • createGiftCertificate(options: { body: GiftCertificate; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<GiftCertificate>
  • createGiftCertificate<T>(options: { body: GiftCertificate; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : GiftCertificates.GiftCertificate>
  • Creates a gift certificate using the information provided. If a gift certificate with the same unique identifier is generated, it is deleted and a new one is created.

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

    Parameters

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

      An object containing the options for this method.

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

    Returns Promise<GiftCertificate>

    A promise of type GiftCertificates.GiftCertificate.

  • Creates a gift certificate using the information provided. If a gift certificate with the same unique identifier is generated, it is deleted and a new one is created.

    Type parameters

    • T: boolean

    Parameters

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

      An object containing the options for this method.

      • body: GiftCertificate
      • 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 : GiftCertificates.GiftCertificate>

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

deleteGiftCertificate

  • deleteGiftCertificate(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { merchantId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<GiftCertificate>
  • deleteGiftCertificate<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { merchantId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : GiftCertificates.GiftCertificate>
  • Deletes the gift certificate by merchant ID.

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

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { merchantId: 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?: { merchantId: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<GiftCertificate>

    A promise of type GiftCertificates.GiftCertificate.

  • Deletes the gift certificate by merchant ID.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { merchantId: 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?: { merchantId: 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 : GiftCertificates.GiftCertificate>

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

getGiftCertificate

  • getGiftCertificate(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { merchantId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<GiftCertificate>
  • getGiftCertificate<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { merchantId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : GiftCertificates.GiftCertificate>
  • Action to get gift certificate information using merchant ID.

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

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { merchantId: 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?: { merchantId: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<GiftCertificate>

    A promise of type GiftCertificates.GiftCertificate.

  • Action to get gift certificate information using merchant ID.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { merchantId: 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?: { merchantId: 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 : GiftCertificates.GiftCertificate>

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

giftCertificatesSearch

  • giftCertificatesSearch(options: { body: SearchRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<GiftCertificateSearchResult>
  • giftCertificatesSearch<T>(options: { body: SearchRequest; fetchOptions?: RequestInit; headers?: {}; parameters?: { organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : GiftCertificates.GiftCertificateSearchResult>
  • Searches for gift certificates. The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:

    Attribute Type Sortable
    merchantId String yes
    maskedGiftCertificateCode * String no
    orderNo String yes
    senderName String yes
    recipientName String yes
    recipientEmail String yes
    status String yes
    enabled Boolean yes
    message String yes
    description String yes
    creationDate Date yes
    currencyMnemonic ** String yes

    Notes:

    maskedGiftCertificateCode, also known as just code, can only be used in a term query. If a four-character code is supplied, it is assumed that the search is on the unmasked portion of the code, otherwise the full code must be matched. Text queries are not allowed. *currencyMnemonic can only be joined with other attributes using a conjunction (AND). Only searchable attributes can be used in sorting.

    If you would like to get a raw Response object use the other giftCertificatesSearch 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<GiftCertificateSearchResult>

    A promise of type GiftCertificates.GiftCertificateSearchResult.

  • Searches for gift certificates. The query attribute specifies a complex query that can be used to narrow down the search. These are the list of searchable attributes:

    Attribute Type Sortable
    merchantId String yes
    maskedGiftCertificateCode * String no
    orderNo String yes
    senderName String yes
    recipientName String yes
    recipientEmail String yes
    status String yes
    enabled Boolean yes
    message String yes
    description String yes
    creationDate Date yes
    currencyMnemonic ** String yes

    Notes:

    maskedGiftCertificateCode, also known as just code, can only be used in a term query. If a four-character code is supplied, it is assumed that the search is on the unmasked portion of the code, otherwise the full code must be matched. Text queries are not allowed. *currencyMnemonic can only be joined with other attributes using a conjunction (AND). 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 : GiftCertificates.GiftCertificateSearchResult>

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

updateGiftCertificate

  • updateGiftCertificate(options: { body: GiftCertificate; fetchOptions?: RequestInit; headers?: {}; parameters?: { merchantId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<GiftCertificate>
  • updateGiftCertificate<T>(options: { body: GiftCertificate; fetchOptions?: RequestInit; headers?: {}; parameters?: { merchantId: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : GiftCertificates.GiftCertificate>
  • Updates the gift certificate with the specified information using merchant ID.

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

    Parameters

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

      An object containing the options for this method.

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

    Returns Promise<GiftCertificate>

    A promise of type GiftCertificates.GiftCertificate.

  • Updates the gift certificate with the specified information using merchant ID.

    Type parameters

    • T: boolean

    Parameters

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

      An object containing the options for this method.

      • body: GiftCertificate
      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { merchantId: 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 : GiftCertificates.GiftCertificate>

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

Generated using TypeDoc