getPromotion
get
/ccadmin/v1/promotions/{id}
Get Promotion. Get a promotion by id. Optionally takes the x-ccasset-language header to get translated content in another language.
Request
Supported Media Types
- application/json
Path Parameters
- id
-
Type:
string
Required:true
ID corresponding to the promotion to get.
Query Parameters
- enableConversion
-
Type:
boolean
Enables promotion data conversion for promotions based on upgraded templates. Default value is 'false'.
Header Parameters
- X-CCAsset-Language
-
Type:
string
The asset language of the request
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : getPromotion_response
- audiences
-
Type:
array
audiencesAdditional Properties Allowed:List of audiences to which the promotion is limited. An empty list implies no restrictions. - cardIINRanges
-
Type:
array
cardIINRangesAdditional Properties Allowed:List of issuer identification numbers including wildcards and ranges for which the promotion should be applied. - claimables
-
Type:
array
claimablesAdditional Properties Allowed:The list of single coupon codes. - couponBatches
-
Type:
array
couponBatchesAdditional Properties Allowed:This will list coupon batch details. - description
-
Type:
string
The Promotion description. - displayName
-
Type:
string
The display name of the promotion. - enabled
-
Type:
boolean
Whether or not the promotion is currently enabled. - endDate
-
Type:
string
When this promotion ceases to be active - evaluationLimit
-
Type:
integer
The evaluation limit. - excludedPromotions
-
Type:
array
excludedPromotionsAdditional Properties Allowed:List of promotions to be excluded from the current promotion. Item promotions can exclude promotions of type: item, order, shipping. Order promotions can exclude promotion of type order and shipping. Shipping promotions can only exclude another shipping promotions. - global
-
Type:
boolean
Whether the promotion is global. - id
-
Type:
string
The Promotion id. - includedPromotions
-
Type:
array
includedPromotionsAdditional Properties Allowed:List of promotions to be included in the current promotion. - parentFolder
-
Type:
object
parentFolderAdditional Properties Allowed:Parent Folder object of the current promotion. - priceListGroups
-
Type:
array
priceListGroupsAdditional Properties Allowed:The list of price list groups to which promotion is associated. - priority
-
Type:
integer
The priority of this promotion over other promotions - repositoryId
-
Type:
string
The Promotion id. - shippingMethods
-
Type:
array
shippingMethodsAdditional Properties Allowed:Array of shipping methods for which the promotion should be applied. - sites
-
Type:
array
sitesAdditional Properties Allowed:This will limit the promotion to being applicable only to the 1+ specified sites. An empty array means the promotion applies to all sites. - stackingRule
-
Type:
object
stackingRuleAdditional Properties Allowed:Represents a rule to determine a group of promotions that can be used together. - startDate
-
Type:
string
When this promotion becomes active - template
-
Type:
string
The template file name. - templateValues
-
Type:
object
templateValuesAdditional Properties Allowed:Specifies the template values that are used as part of the promotion to control its behavior - type
-
Type:
integer
Integer representation of the promotion type (shipping, item, order).
Nested Schema : audiences
Nested Schema : cardIINRanges
Type:
array
List of issuer identification numbers including wildcards and ranges for which the promotion should be applied.
-
Type:
string
Nested Schema : claimables
Nested Schema : couponBatches
Nested Schema : excludedPromotions
Type:
array
List of promotions to be excluded from the current promotion. Item promotions can exclude promotions of type: item, order, shipping. Order promotions can exclude promotion of type order and shipping. Shipping promotions can only exclude another shipping promotions.
Nested Schema : includedPromotions
Nested Schema : parentFolder
Type:
object
Parent Folder object of the current promotion.
- displayName
-
Type:
string
The name of the promotion folder. - repositoryId
-
Type:
string
The promotion folder's repository ID that the promotion is assigned to.
Nested Schema : priceListGroups
Nested Schema : shippingMethods
Nested Schema : sites
Nested Schema : stackingRule
Type:
object
Represents a rule to determine a group of promotions that can be used together.
- displayName
-
Type:
string
The name of the rule. - id
-
Type:
string
The stacking rule id. - maxPromotions
-
Type:
string
The maximum number of promotions that can be applied to an order based on this rule. - repositoryId
-
Type:
string
The stacking rule id
Nested Schema : templateValues
Type:
object
Specifies the template values that are used as part of the promotion to control its behavior
- condition_psc_value
-
Type:
object
condition_psc_valueAdditional Properties Allowed:The condition product set criteria value - discount_type_value
-
Type:
string
The discount type - discount_value
-
Type:
string
The discount value - discountStructure
-
Type:
object
discountStructureAdditional Properties Allowed:The discount structure - gwpItem
-
Type:
object
gwpItemAdditional Properties Allowed:The gift with promotion configuration details - no_of_items_to_buy
-
Type:
string
The number of items to buy - no_of_items_to_discount
-
Type:
string
The number of items to discount - offer_psc_value
-
Type:
object
offer_psc_valueAdditional Properties Allowed:The offer product set criteria values - optional_offer_psc_value
-
Type:
object
optional_offer_psc_valueAdditional Properties Allowed:The offer product set criteria values - PSC_value
-
Type:
object
PSC_valueAdditional Properties Allowed:The product set criteria values - sort_by
-
Type:
string
The sort by condition - sort_order
-
Type:
string
The sort order - spend_value
-
Type:
string
The spend value
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
Required:true
The ID of an audience associated with the promotion.
Nested Schema : items
Type:
object
- id
-
Type:
string
The coupon batch id. - maxUses
-
Type:
integer
The max use count. - numberOfCoupons
-
Type:
integer
The number of coupons in batch. - prefix
-
Type:
string
The prefix of the coupons in batch.
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
The promotion's repository ID
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
The promotion's repository ID
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
The ID of a site associated with the promotion.
Nested Schema : condition_psc_value
Type:
object
The condition product set criteria value
- excludedCategories
-
Type:
array
excludedCategoriesAdditional Properties Allowed:The excluded categories - excludedProducts
-
Type:
array
excludedProductsAdditional Properties Allowed:The excluded products - includedCategories
-
Type:
array
includedCategoriesAdditional Properties Allowed:The included categories - includedProducts
-
Type:
array
includedProductsAdditional Properties Allowed:The included products
Nested Schema : discountStructure
Type:
object
The discount structure
- discount_details
-
Type:
array
discount_detailsAdditional Properties Allowed:The discount details - discount_type_value
-
Type:
string
The discount type value
Nested Schema : gwpItem
Type:
object
The gift with promotion configuration details
- autoRemove
-
Type:
boolean
Whether to remove item from cart when cart no longer meets buy condition - giftId
-
Type:
string
The product id of the gift item - giftType
-
Type:
string
The gift item type
Nested Schema : offer_psc_value
Type:
object
The offer product set criteria values
- excludedCategories
-
Type:
array
excludedCategoriesAdditional Properties Allowed:The excluded categories - excludedProducts
-
Type:
array
excludedProductsAdditional Properties Allowed:The excluded products - includedCategories
-
Type:
array
includedCategoriesAdditional Properties Allowed:The included categories - includedProducts
-
Type:
array
includedProductsAdditional Properties Allowed:The included products
Nested Schema : optional_offer_psc_value
Type:
object
The offer product set criteria values
- excludedCategories
-
Type:
array
excludedCategoriesAdditional Properties Allowed:The excluded categories - excludedProducts
-
Type:
array
excludedProductsAdditional Properties Allowed:The excluded products - includedCategories
-
Type:
array
includedCategoriesAdditional Properties Allowed:The included categories - includedProducts
-
Type:
array
includedProductsAdditional Properties Allowed:The included products - sameAsCondition
-
Type:
boolean
Items to include and exclude for offer are the same as items in buy condition
Nested Schema : PSC_value
Type:
object
The product set criteria values
- excludedCategories
-
Type:
array
excludedCategoriesAdditional Properties Allowed:The excluded categories - excludedProducts
-
Type:
array
excludedProductsAdditional Properties Allowed:The excluded products - includedCategories
-
Type:
array
includedCategoriesAdditional Properties Allowed:The included categories - includedProducts
-
Type:
array
includedProductsAdditional Properties Allowed:The included products
Nested Schema : excludedCategories
Nested Schema : excludedProducts
Nested Schema : includedCategories
Nested Schema : includedProducts
Nested Schema : discount_details
Nested Schema : items
Type:
object
- discount_value
-
Type:
string
The discount value - spend_value
-
Type:
string
The spend value
Nested Schema : excludedCategories
Nested Schema : excludedProducts
Nested Schema : includedCategories
Nested Schema : includedProducts
Nested Schema : excludedCategories
Nested Schema : excludedProducts
Nested Schema : includedCategories
Nested Schema : includedProducts
Nested Schema : excludedCategories
Nested Schema : excludedProducts
Nested Schema : includedCategories
Nested Schema : includedProducts
Example application/json
{
"template":"/order/spendYGetOrderDiscount.pmdt",
"endDate":"2014-04-29T19:30:00.000-04:00",
"displayName":"10% Off Orders Over $100 ",
"templateValues":{
"spend_value":"100",
"discount_value":"10",
"discount_type_value":"percentOff"
},
"description":"Spend $100 today and get 10% off your order!",
"sites":[
{
"repositoryId":"funSite"
}
],
"priority":1,
"type":9,
"enabled":true,
"cardIINRanges":[
"456789",
"9878",
"987634-987648"
],
"excludedPromotions":[
{
"repositoryId":"bogoPromotion"
},
{
"repositoryId":"explicitItemFixedDiscount"
}
],
"parentFolder":{
"repositoryId":"200002"
},
"stackingRule":{
"maxPromotions":-1,
"displayName":"TEST2",
"repositoryId":"100002",
"id":"100002"
},
"startDate":"2014-04-25T17:30:00.000-04:00",
"shippingMethods":[
]
}
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|
|------------------|------------------|
|21001|Promotion Id is invalid.|
|21009|Internal Error.|
Body
Root Schema : errorModel
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - errors
-
Type:
array
errorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code - type
-
Type:
string
The URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code
Examples
Sample Response Payload returned by endpoint:
{ "template": "/order/spendYGetOrderDiscount.pmdt", "endDate": "2014-04-29T19:30:00.000-04:00", "displayName": "10% Off Orders Over $100 ", "templateValues": { "spend_value": "100", "discount_value": "10", "discount_type_value": "percentOff" }, "description": "Spend $100 today and get 10% off your order!", "sites": [{"repositoryId": "funSite"}], "priority": 1, "type": 9, "enabled": true, "cardIINRanges": [ "456789", "9878", "987634-987648" ], "excludedPromotions": [ {"repositoryId": "bogoPromotion"}, {"repositoryId": "explicitItemFixedDiscount"} ], "parentFolder": {"repositoryId": "200002"}, "stackingRule": { "maxPromotions": -1, "displayName": "TEST2", "repositoryId": "100002", "id": "100002" }, "startDate": "2014-04-25T17:30:00.000-04:00", "shippingMethods": [] }