Create a new Coupon
POST/coupon
Creates a new Coupon and attaches it to the requested Company.
A Coupon functions as a description for the CouponCodes. The Coupons are not used by visitors, instead they use the CouponCodes.
The Coupon holds the basic information that all underlying CouponCodes use, e.g. if the CouponCodes will be used on Orders or Products, or the value of the CouponCode or discount, depending on the type.
Request
- application/json
Body
Input data
- cheque:
- The Coupon starts at the defined amount and each time it is used the amount will decrease, by the amount it is used.
- fixed-discount:
- The Coupon will apply a fixed discount in terms of money.
- percentage-discount:
- The Coupon will apply a discount percentagewise.
- new-price:
- The Coupon will put the price to the defined amount.
- cheque:
- The total value of the CouponCode in cents. Can be used depending on usage count and applies to count.
- fixed-discount:
- The amount of discount that will be applied in cents.
- percentage-discount:
- The amount of discount that will be applied in percentages (ranges from 0.0 to 100.0).
- new-price:
- The amount to which the new price of the Order or Product Type will be set in cents.
Possible values: <= 255 characters
The name of the Coupon.
Possible values: <= 65535 characters
The description for the Coupon.
A note field for extra comments.
Possible values: [cheque
, fixed-discount
, percentage-discount
, new-price
]
The type of the Coupon.
The start date of this Coupon. The start of the date range where it can be used (inclusive).
The end date of this Coupon. The end of the date range where it can be used (exclusive).
Possible values: [enabled
, disabled
]
Whether the Coupon is enabled. When the Coupon is enabled its CouponCodes can be used.
Responses
- 200
- 403
- 404
- 406
Coupon created.
- application/json
- Schema
- Example (from schema)
Schema
- cheque:
- The Coupon starts at the defined amount and each time it is used the amount will decrease, by the amount it is used.
- fixed-discount:
- The Coupon will apply a fixed discount in terms of money.
- percentage-discount:
- The Coupon will apply a discount percentagewise.
- new-price:
- The Coupon will put the price to the defined amount.
- cheque:
- The total value of the CouponCode in cents. Can be used depending on usage count and applies to count.
- fixed-discount:
- The amount of discount that will be applied in cents.
- percentage-discount:
- The amount of discount that will be applied in percentages (ranges from 0.0 to 100.0).
- new-price:
- The amount to which the new price of the Order or Product Type will be set in cents.
Possible values: <= 255 characters
The name of the Coupon.
Possible values: <= 65535 characters
The description for the Coupon.
A note field for extra comments.
Possible values: [cheque
, fixed-discount
, percentage-discount
, new-price
]
The type of the Coupon.
The start date of this Coupon. The start of the date range where it can be used (inclusive).
The end date of this Coupon. The end of the date range where it can be used (exclusive).
Possible values: [enabled
, disabled
]
Whether the Coupon is enabled. When the Coupon is enabled its CouponCodes can be used.
{
"name": "string",
"description": "string",
"note": "string",
"type": "cheque",
"start_date": "2023-08-01T14:40:24+00:00",
"end_date": "2023-08-01T14:40:24+00:00",
"status": "enabled",
"amount": 0
}
Unauthorized. You do not have permission to create a Coupon for the Company.
- application/json
- Schema
- Example (from schema)
Schema
The general error code.
The exact reason of failure.
{
"error_code": "string",
"error_description": "string"
}
Company 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"
}