Type aliases
Static AsyncCreated
AsyncCreated: {}
Static AttributeDefinition
Attribute
Definition: { 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 id?: string
-
Optional key?: boolean
-
Optional localizable?: boolean
-
Optional mandatory?: boolean
-
Optional max?: number
-
Optional min?: number
-
Optional minLength?: number
-
Optional multiValueType?: boolean
-
-
-
Optional regularExpression?: string
-
Optional scale?: number
-
Optional searchable?: boolean
-
Optional siteSpecific?: boolean
-
Optional system?: boolean
-
type: string
-
-
Optional visible?: boolean
Static BoolFilter
Bool
Filter: { filters?: Array<Filter>; operator: string } & {}
Static BoolQuery
Bool
Query: { must?: Array<Query>; mustNot?: Array<Query>; should?: Array<Query> } & {}
Static Campaign
Campaign: { campaignId: string; coupons?: Array<string>; creationDate?: any; customerGroups?: Array<string>; description?: string; enabled?: boolean; endDate?: any; lastModified?: any; sourceCodeGroups?: Array<string>; startDate?: 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: {}
Static DateRangeFilter
DateRangeFilter: {}
Static DatetimeRangeFilter
DatetimeRangeFilter: {}
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: {}
Static EtagResponse
EtagResponse: {}
Static Filter
Static FilteredQuery
Static IntegerRangeFilter
IntegerRangeFilter: {}
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
Nested
Query: { path: string; query: Query; scoreMode?: string } & {}
Static NoPropertiesAllowed
NoPropertiesAllowed: {}
Static NumericRangeFilter
NumericRangeFilter: {}
Static OffsetPaginated
OffsetPaginated: {}
Static OpenObject
OpenObject: {} & {}
Static PaginatedSearchResult
Paginated
SearchResult: { hits?: Array<object>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}
Static PaginatedSearchResultBase
Paginated
SearchResultBase: { hits?: Array<object>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}
Static Promotion
Promotion
: { archived
?: boolean; assignmentInformation
?: PromotionAssignmentInformation; creationDate
?: any; currencyCode
?: string; disableGloballyExcluded
?: boolean; enabled
?: boolean; exclusivity
?: string; id
?: string; lastModified
?: any; name
?: {} & {}; promotionClass
?: string; siteId
?: string; tags
?: Array<Tag> } & {}
Static PromotionAbtestGroupAssignment
Promotion
AbtestGroupAssignment: { abtestDescription: string; abtestId: string; enabled: boolean; schedule: Schedule; segmentDescription: string; segmentId: string }
Type declaration
-
abtestDescription: string
-
abtestId: string
-
enabled: boolean
-
-
segmentDescription: string
-
segmentId: string
Static PromotionAssignmentInformation
Type declaration
-
Optional abtestId?: string
-
Optional abtestSegmentId?: string
-
active: boolean
-
-
-
campaignId: string
-
enabled: boolean
-
Optional endDate?: any
-
-
scheduleType: string
-
Optional startDate?: any
-
-
Static PromotionCampaignAssignment
Promotion
CampaignAssignment: { campaign?: Campaign; campaignId: string; coupons?: Array<string>; customerGroups?: Array<string>; description: string; enabled: boolean; promotion?: Promotion; promotionId: string; rank?: number; schedule: Schedule; sourceCodeGroups?: Array<string> }
Type declaration
-
Optional campaign?: Campaign
-
campaignId: string
-
Optional coupons?: Array<string>
-
Optional customerGroups?: Array<string>
-
description: string
-
enabled: boolean
-
Optional promotion?: Promotion
-
promotionId: string
-
Optional rank?: number
-
-
Optional sourceCodeGroups?: Array<string>
Static PromotionIdConflict
PromotionIdConflict: {}
Static PromotionNotFound
PromotionNotFound: {}
Static PromotionSearchResult
Promotion
SearchResult: { hits: Array<Promotion>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}
Static PropertyDefinition
Property
Definition: { 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
Property
ValueDefinition: { description: L10nString; displayValue: L10nString; id: string; position?: number; value: string }
Type declaration
-
-
-
id: string
-
Optional position?: number
-
value: string
Static Query
Static QueryFilter
Query
Filter: { query: Query } & {}
Static QueryParamsLimit
QueryParamsLimit: {}
Static QueryParamsOffset
QueryParamsOffset: {}
Static Range2Filter
Range2Filter: { filterMode?: string; fromField: string; fromInclusive?: boolean; fromValue?: any; toField: string; toInclusive?: boolean; toValue?: any } & {}
Static RangeFilter
RangeFilter: {}
Static RateLimited
RateLimited: {}
Static RateLimited2
RateLimited2: {}
Static RateLimited3
RateLimited3: {}
Static RateLimited4
RateLimited4: {}
Static RateLimited5
RateLimited5: {}
Static Recurrence
Recurrence
: { dayOfWeek
: Array<string>; timeOfDay
: TimeOfDay }
Static Schedule
Schedule
: { endDate
?: any; recurrence
?: Recurrence; startDate
?: any }
Type declaration
-
Optional endDate?: any
-
Optional recurrence?: Recurrence
-
Optional startDate?: any
Static SearchRequest
Search
Request: { limit?: number; offset?: any; query: Query; sorts?: Array<Sort> } & {}
Static SearchRequestBase
Search
RequestBase: { limit?: number; offset?: any; query: Query; sorts?: Array<Sort> } & {}
Static Selectable
Selectable: {}
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: {}
Static Sort
Sort: { field: string; sortOrder?: string } & {}
Static SpecifiedPropertiesAllowed
SpecifiedPropertiesAllowed: {} & {}
Static SyncCreated
SyncCreated: {}
Static Tag
Tag: { tagId: string }
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 TimeOfDay
TimeOfDay: { timeFrom: string; timeTo: string }
Type declaration
-
timeFrom: string
-
timeTo: string
Promotions
Launch and manage promotions across 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
API Version: 1.0.24import { 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 promotionsClient = new Pricing.Promotions(clientConfig);
Last Updated: