Specify a coupon expiration time

Specifies the expiration time of a coupon with a specified ID. The expiredTime of a coupon must be greater than its issuedTime.

Note: This operation cannot be performed on expired coupons.

SecurityAPI Key: SecretApiKey or HTTP: JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

ID of the resource.

Request Body schema: application/json

Coupon resource.

expiredTime
required
string <date-time>

Date and time when the coupon expires. This value must be greater than the issuedTime value. If this field contains a null or empty string, the coupon expires immediately.

post
/coupons/{id}/expiration
Request samples
application/json
{ "expiredTime": "2019-08-24T14:15:22Z" }
Responses

201

Coupon expiration set.

401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

404

Resource not found.

409

Coupon has expired and been redeemed. Unable to reschedule expiration.

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": [ ] }