v1

latestOpenAPI 3.0.22026-07-146168117.0 KB
Coupons

This endpoint updates a specific coupon by code. This feature is available as part of the Standard API.

put/forms/{slug_or_id}/coupons/{code}

Path parameters

slug_or_idstring required

The form's slug, custom slug or ID.

codestring required

The coupon code to get results for.

Request body

enabledboolean

Whether the coupon is enabled or not.

target'price' | 'subscription'

The target of the coupon.

discountAmountnumber

The discount as an amount.

discountPercentagenumber

The discount as a percentage.

expiresAtstring date-time nullable

The date and time when the coupon expires.

Example request

{
  "enabled": true,
  "target": "price",
  "discountAmount": 10,
  "discountPercentage": 10,
  "expiresAt": "2020-01-01T00:00:00.000Z"
}

Response

Successfully updated a single coupon with the provided values

status'ok'

Example response

{
  "results": {
    "coupon": {
      "code": "DISCOUNT1",
      "enabled": true,
      "target": "price",
      "discountAmount": 10,
      "discountPercentage": 10,
      "expiresAt": "2020-01-01T00:00:00.000Z"
    }
  }
}