listPromotions
get
/ccadmin/v1/promotions
Get a list of promotions including support for pagination and sorting.
The following query params cannot be used together: name and promotionId.
Request
Supported Media Types
- application/json
Query Parameters
-
enabledState(optional): string
One of three values: enabled, disabled, both. This will return promotions that are enabled, disabled, or both enabled and disabled.
-
folder(optional): string
Filters the promotions using a specific promotion folder id. All the promotions whose parentfolder is assigned to the provided id can be retrieved through the folder parameter.
-
id(optional): string
If id used only with propertyName, then it is promotion's repository id to fetch the included/excluded promotions list on that promotion. If id is combined with itemType=stackingRule and propertyName=promotions, it returns the list of promotions with stacking rule matching the id.
-
itemType(optional): string
Type of repository item on which the list of referenced promotions is to be fetched. This parameter must be used with id and propertyName to fetch a list of promotions with stacking rule matching the id. It's value can be 'stackingRule or 'promotion'. If this property is skipped, then by default it is considered as 'promotion' type
-
limit(optional): integer
The number of items to return.
-
name(optional): string
This is a search filter value that will find promotions that match on the ID or display name.
-
offset(optional): integer
Index of the first element to return.
-
promotionId(optional): string
A filter string that will return partial matches on ID or displayName. This returns ALL promotions, no paging, no limit.
-
promotionType(optional): string
Filters the results using a specific promotion type. This can be one of three values: item, order, shipping. These can be a comma-separated list (e.g., promotionType=item,order).
-
propertyName(optional): string
Property name that stores a list of promotions on a given item id - e.g. 'excludedPromotions' on a promotion matching id param, or 'promotions' on a stacking rule. This parameter should be used with id parameter that is either repositoryId of a promotion or a stacking rule. If used with id and itemType then it is the property of a repository Item of type itemType.
-
sort(optional): string
Sorting criteria. Following are the fields supported by this param: |Field|Type|Description| |------------------|------------------|------------------| |property|string|The property the listing is sorted by.| |order|string|Sort order: asc or desc.|
-
templateFilter(optional): string
Filters the results using a specific template key in the format of type.name. E.g., item.getItemDiscount.
-
total(optional): integer
The total number of items.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : listPromotions_response
Type:
Show Source
object
-
items(optional):
array items
The items returned by the listing.
-
limit(optional):
integer
The number of items to return.
-
offset(optional):
integer
Index of the first element to return.
-
sort(optional):
array sort
Sorting criteria.
-
total(optional):
integer
The total number of items. Deprecated.
-
totalResults(optional):
integer
The total number of items.
-
type(optional):
string
The promotion type being listed.
Nested Schema : items
Type:
Show Source
object
-
cardIINRanges(optional):
array cardIINRanges
List of issuer identification numbers including wildcards and ranges for which the promotion should be applied.
-
displayName(optional):
string
The display name of the promotion.
-
enabled(optional):
boolean
Whether or not the promotion is currently enabled.
-
endDate(optional):
string
The end date of the promotion.
-
id(optional):
string
The Promotion id.
-
lastModified(optional):
string
When promotion was last modified
-
parentFolder(optional):
object parentFolder
Parent Folder object of the current promotion.
-
promotionTemplateName(optional):
string
The name of the promotion template.
-
repositoryId(optional):
string
The repository ID of the promotion.
-
sites(optional):
array sites
The list of sites
-
stackingRule(optional):
object stackingRule
It represents a rule to determine a group of promotions that can be used together.
-
startDate(optional):
string
The start date of the promotion.
-
type(optional):
integer
Integer representation of the promotion type (shipping, item, order).
-
typeName(optional):
string
The type of the promotion.
Nested Schema : cardIINRanges
Type:
array
List of issuer identification numbers including wildcards and ranges for which the promotion should be applied.
Show Source
Nested Schema : parentFolder
Type:
object
Parent Folder object of the current promotion.
Show Source
-
repositoryId(optional):
string
The promotion folder's repository ID that the promotion is assigned to.
Nested Schema : stackingRule
Type:
object
It represents a rule to determine a group of promotions that can be used together.
Show Source
-
displayName(optional):
string
Stacking rule's display name that the promotion is assigned to.
-
id(optional):
string
Stacking rule's ID that the promotion is assigned to.
-
maxPromotions(optional):
integer
The maximum number of promotions that can be applied to an order based on this rule.
-
repositoryId(optional):
string
Stacking rule's repository ID that the promotion is assigned to.
Nested Schema : items
Type:
Show Source
object
-
order(optional):
string
Sort order: asc or desc.
-
property(optional):
string
The property the listing is sorted by.
Example Response (application/json)
{
"total":3,
"totalResults":3,
"offset":0,
"limit":3,
"sort":[
{
"property":"displayName",
"order":"asc"
}
],
"type":"promotion",
"items":[
{
"parentFolder":{
"repositoryId":"200002"
},
"displayName":"Hubbard Chair Tiered Price Break",
"repositoryId":"promo20009",
"stackingRule":{
"maxPromotions":-1,
"displayName":"TEST2",
"repositoryId":"100002",
"id":"100002"
},
"id":"promo20009",
"lastModified":"2017-01-09T05:10:01.000Z",
"type":0,
"enabled":false,
"cardIINRanges":[
"456789",
"9878",
"987634-987648"
]
},
{
"parentFolder":{
"repositoryId":"200002"
},
"displayName":"TENSHIP Coupon - 10% Off Order ",
"repositoryId":"promo20011",
"id":"promo20011",
"lastModified":"2017-01-09T05:10:01.000Z",
"type":9,
"enabled":false,
"cardIINRanges":[
"456789",
"9878",
"987634-987648"
]
},
{
"displayName":"TENSHIP Coupon - Free Shipping",
"repositoryId":"promo20004",
"id":"promo20004",
"lastModified":"2017-01-09T05:10:01.000Z",
"type":5,
"enabled":false,
"cardIINRanges":[
"456789",
"9878",
"987634-987648"
]
}
]
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|21015|Invalid value for the promotionType parameter: {0}.|
|21014|This is an unsupported enabledState: {0}.|
|21001|Promotion not found for the given id: invalidPromotionId.|
|21012|The template filter is improperly formatted: {0}.|
|21011|There is no promotion item type of type {0}.|
|21010|Cannot list promotions with a blank item type.|
|21241|promotion folder not found for the given ID : nonExistingId|
|21174|propertyName is a required property for this request.|
|21240|Promotion folder ID is blank|
|21173|propertyName can only be excludedPromotions for this request.|
|21170|id is a required property for this request.|
|21019|Internal Error.|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code