Create a coupon

Creates a coupon.

SecuritySecretApiKey or JWT or ApplicationJWT
Request
Request Body schema: application/json

Coupon resource.

required
object (Discount)

Coupon 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.

Responses
201

Coupon created.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
id
string <= 50 characters

ID of the coupon. This value is also known as the coupon redemption code.

required
object (Discount)

Coupon discount.

Array of objects (CouponRestriction)

Coupon restrictions.

redemptionsCount
integer >= 0

Total number of times that a coupon is redeemed.

status
string

Specifies the current status of the coupon.

Enum: "draft" "issued" "expired"
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.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

Array of objects (SelfLink)

Related links.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

422

Invalid data sent.

post/coupons
Request samples
application/json
{
  • "discount": {
    },
  • "restrictions": [
    ],
  • "description": "string",
  • "issuedTime": "2019-08-24T14:15:22Z",
  • "expiredTime": "2019-08-24T14:15:22Z"
}
Response samples
application/json
{
  • "id": "cpn_0YVCNKF81GD778N4YNVGDJK558",
  • "discount": {
    },
  • "restrictions": [
    ],
  • "redemptionsCount": 0,
  • "status": "draft",
  • "description": "string",
  • "issuedTime": "2019-08-24T14:15:22Z",
  • "expiredTime": "2019-08-24T14:15:22Z",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}