Update a Coupon

Updates a coupon by the given id.

put
Path parameters
idstringRequired

The id of the coupon.

Header parameters
Brand-URLstringRequired

The brand URL of the request. This is used to identify the brand.

Example: YOUR_BRAND_URL
Auth-KeystringRequired

This is used to authenticate the request. If the request is not authenticated, the server will return a 401 Unauthorized response.

Example: YOUR_AUTH_KEY
Body

This class is used to provide a data transfer object for the coupon which is used for command requests.

namestring · min: 1Required

The name of the coupon.

codestring · min: 1Required

The code of the coupon.

percentagenumber · double | nullableOptional

The percentage of the coupon.

quantityinteger · int32 | nullableOptional

The quantity of the coupon.

startDatestring · date-timeRequired

The start date and end date of the coupon.

endDatestring · date-timeRequired

The end date of the coupon.

autoApplyToPricebooleanOptional

Is the coupon auto apply to price. If true, the coupon will be applied to the price automatically. By default, the value is false.

descriptionstring | nullableOptional

The description of the coupon.

tagsstring | nullableOptional

The tags of the coupon.

statusstring · enumOptionalPossible values:
testModebooleanOptional

The test mode of the coupon. By default, the value is false.

Responses
200
The request was successful.
application/json
put
PUT /api/v1/coupons/{id} HTTP/1.1
Host: protocol.jframework.io
Brand-URL: text
Auth-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 230

{
  "name": "text",
  "code": "text",
  "percentage": 1,
  "quantity": 1,
  "startDate": "2025-06-24T12:17:56.535Z",
  "endDate": "2025-06-24T12:17:56.535Z",
  "autoApplyToPrice": true,
  "description": "text",
  "tags": "text",
  "status": "1 - Active",
  "testMode": true
}
{
  "success": true,
  "statusCode": 200,
  "message": "The request was successful.",
  "data": {
    "id": "sApKpllz4sAplsmzha",
    "code": "COUPON1",
    "name": "Coupon 1",
    "description": "This is a coupon",
    "tags": "tag1, tag2",
    "percentage": 10,
    "quantity": 100,
    "startDate": "2025-06-23T13:56:00.4346197+07:00",
    "endDate": "2025-07-23T13:56:00.4346201+07:00",
    "autoApplyToPrice": true,
    "status": "Active",
    "testMode": false,
    "modifiedDate": "2025-06-23T13:56:00.4346205+07:00"
  },
  "errors": []
}

Last updated

Was this helpful?