createPromotionCouponBatch
post
/ccadmin/v1/couponBatches
Create Promotion Coupon Batch. Create a new coupon batch using the given promotion.
Request
Supported Media Types
- application/json
Root Schema : createPromotionCouponBatch_request
Type:
Show Source
object
-
id(optional):
string
Optional parameter to specify the ID of the coupon batch to create.
-
maxUses:
integer
The maximum number of times each coupon code can be used.
-
numberOfCoupons:
integer
The number of coupon codes to request.
-
prefix:
string
The prefix code for the coupon batch.
-
promotionId(optional):
string
ID corresponding to the promotion which the coupon batch will use. Use either promotionId or promotions, not both.
-
promotions(optional):
array promotions
List of promotions with which to associate the coupon batch. Use either promotionId or promotions, not both.
-
startDate(optional):
string
When this coupon batch becomes active.
Example:
{
"maxUses":"1",
"prefix":"SpecialEvent",
"numberOfCoupons":"5000",
"promotionId":"PromoFor10PercentOff",
"startDate":"2016-03-23T11:56:00.000-04:00"
}
Nested Schema : promotions
Type:
array
List of promotions with which to associate the coupon batch. Use either promotionId or promotions, not both.
Show Source
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : createPromotionCouponBatch_response
Type:
Show Source
object
-
repositoryId(optional):
string
The Claimable id.
Example Response (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}|
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