Set a coupon's expiration time

Set a coupon's expiration time with the specified coupon ID. The expiredTime of a coupon must be greater than its issuedTime. This cannot be performed on expired coupons.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

Request Body schema: application/json

Coupon resource.

expiredTime
required
string <date-time>

The coupon's expiration time, must be greater than the issued time. Null or empty string will immediately expire the coupon.

Responses
201

Coupon expiration was successfully set.

Response Headers
Location
string <uri>

The location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
required
object (Discount)
amount
required
number <double> > 0

Discount amount.

currency
required
string = 3 characters

ISO 4217 alphabetic currency code.

type
string

Discount type.

context
string (DiscountContext)
Default: "items"

The context in which the discount applies.

Enum: Description
items

items (less discounts)

shipping

shipping (less discounts)

items-and-shipping

items and shipping (less discounts)

issuedTime
required
string <date-time>

Coupon's issued time (start time).

id
string <= 50 characters

Coupon's ID a.k.a redemption code.

Array of objects (CouponRestriction)

Coupon restrictions.

Array
type
required
string

Coupon's restriction type.

quantity
required
integer

Restriction quantity.

redemptionsCount
integer >= 0

Coupon's redemptions count.

status
string

If coupon enabled.

Enum: "draft" "issued" "expired"
description
string

Your coupon description. When it is not empty this is used for invoice discount item description, otherwise the item's description uses coupon's ID like 'Coupon "COUPON-ID"'.

expiredTime
string <date-time>

Coupon's expire time (end time).

createdTime
string <date-time>

Coupon created time.

updatedTime
string <date-time>

Read-only timestamp updates when the resource is updated.

Array of objects (Self) non-empty

The links related to resource.

Array (non-empty)
href
required
string

The link URL.

rel
required
string

The link type.

Value: "self"
401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

404

Resource was not found.

409

The coupon is already expired and has been redeemed, unable to. reschedule expiration.

422

Invalid data was sent.

post/coupons/{id}/expiration
Request samples
application/json
{
  • "expiredTime": "2019-08-24T14:15:22Z"
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "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": [
    ]
}