Generate CouponCodes for a Coupon
POST/coupon/:guid/codes
Generate codes for a Coupon. The properties to apply can be set globally or left to default.
Note that this is best effort, since generation can yield collissions we retry 10 new codes for each desired code. When that fails, the code is simply not generated.
Request
Path Parameters
The guid of the Coupon to generate the CouponCodes for.
- application/json
Body
Input data
Possible values: >= 1
The amount of codes to generate.
Possible values: >= 4
Default value: 8
The length of the codes to generate.
Possible values: >= 1
and <= 9999999999
Default value: 1
The maximum number of times this CouponCode can be applied within a single Order.
Possible values: [lower
, upper
, number
]
The complexity of the codes to generate, defaults to: 'lower', 'upper', 'number'.
Default value: true
Whether to allow ambiguous characters in the code (iIlLoO01).
Responses
- 200
- 403
- 404
- 406
CouponCodes generated. This returns an empty response.
Unauthorized. You do not have permission to manage the Coupon.
- application/json
- Schema
- Example (from schema)
Schema
The general error code.
The exact reason of failure.
{
"error_code": "string",
"error_description": "string"
}
Coupon not found.
- application/json
- Schema
- Example (from schema)
Schema
The general error code.
The exact reason of failure.
{
"error_code": "string",
"error_description": "string"
}
Request is invalid, see error context for validation errors.
- application/json
- Schema
- Example (from schema)
Schema
The general error code.
The exact reason of failure.
{
"error_code": "string",
"error_description": "string"
}