createPromotionCouponBatch
post
/ccadmin/v1/couponBatches
Create Promotion Coupon Batch. Create a new coupon batch using the given promotion.
Request
Supported Media Types
- application/json
Body Parameter
Root Schema : createPromotionCouponBatch_request
{
"maxUses":"1",
"prefix":"SpecialEvent",
"numberOfCoupons":"5000",
"promotionId":"PromoFor10PercentOff",
"startDate":"2016-03-23T11:56:00.000-04:00"
}
- id
-
Type:
stringOptional parameter to specify the ID of the coupon batch to create. - maxUses
-
Type:
integerRequired:trueThe maximum number of times each coupon code can be used. - numberOfCoupons
-
Type:
integerRequired:trueThe number of coupon codes to request. - prefix
-
Type:
stringRequired:trueThe prefix code for the coupon batch. - promotionId
-
Type:
stringID corresponding to the promotion which the coupon batch will use. Use either promotionId or promotions, not both. - promotions
-
Type:
arraypromotionsAdditional Properties Allowed:List of promotions with which to associate the coupon batch. Use either promotionId or promotions, not both. - startDate
-
Type:
stringWhen this coupon batch becomes active.
Nested Schema : promotions
Nested Schema : items
Type:
object- repositoryId
-
Type:
stringRequired:trueThe promotion's repository ID
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : createPromotionCouponBatch_response
- repositoryId
-
Type:
stringThe Claimable id.
Example application/json
{
"repositoryId":"44d23",
"links":[
{
"method":"POST",
"rel":"self",
"href":"/couponBatches"
}
]
}
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|
|------------------|------------------|
|21134|ID value is too long: {0}|
|21122|Promotion ID cannot be blank.|
|21133|Max uses is missing from the input data.|
|21121|Claimable ID {0} is invalid. Claimable IDs may not contain forwardslash or backslash characters.|
|21132|Specified property is not permitted for coupon batches: {0}|
|21131|ID already exists for coupon batch {0}.|
|21153|Prefix has an invalid format. Can only be alphanumeric with no special characters: {0}|
|21164|Number of Coupons not in the valid range. It must be in the range: 1, 1006632|
|21139|Internal error when creating a batch.|
|21130|Promotion {0} could not be found.|
|21152|Prefix already exists.|
|21163|Coupon batch prefix is too long. Maximum: {0}. Actual: {1}.|
|21162|Missing expected property: {0}|
|21150|Required property cannot be blank: {0}|
|21161|Coupon batch properties cannot be empty or null.|
|21160|Coupon batch property does not exist, or value is invalid: {0}, {1}|
Body
Root Schema : errorModel
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - errors
-
Type:
arrayerrorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code - type
-
Type:
stringThe URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code
Examples
Sample Request:
{
"maxUses": "1",
"prefix": "SpecialEvent",
"numberOfCoupons": "5000",
"promotionId": "PromoFor10PercentOff",
"startDate": "2016-03-23T11:56:00.000-04:00"
}
Sample Response Payload returned by endpoint:
{
"repositoryId": "44d23",
"links": [{
"method": "POST",
"rel": "self",
"href": "/couponBatches"
}]
}