Create a coupon

Creates a coupon.

SecurityAPI Key: SecretApiKey or HTTP: JWT or HTTP: ApplicationJWT
Request
Request Body schema: application/json

Coupon resource.

required
object or object (Discount)
Array of objects (CouponRestriction)

Coupon restrictions.

description
string

Description of the coupon. Use this field to provide an invoice discount item description.

If this field is empty, the invoice discount item description uses the related coupon ID, in the following format: Coupon "COUPON-ID".

issuedTime
required
string <date-time>

Date and time when the coupon is issued. This value may also be described as start time of the coupon.

expiredTime
string or null <date-time>

Date and time when the coupon expires.

post
/coupons
Request samples
application/json
{ "discount": { "amount": 0.01, "currency": "USD", "type": "fixed", "context": "items" }, "restrictions": [ ], "description": "string", "issuedTime": "2019-08-24T14:15:22Z", "expiredTime": "2019-08-24T14:15:22Z" }
Responses

201

Coupon created.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

422

Invalid data sent.

Response samples
application/json
{ "id": "cpn_0YVCNKF81GD778N4YNVGDJK558", "discount": { "amount": 0.01, "currency": "USD", "type": "fixed", "context": "items" }, "restrictions": [ ], "redemptionsCount": 0, "status": "draft", "description": "string", "issuedTime": "2019-08-24T14:15:22Z", "expiredTime": "2019-08-24T14:15:22Z", "revision": 0, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ ] }