Skip to main content
POST
/
discounts
Create discount
curl --request POST \
  --url https://api.crevio.co/v1/discounts \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "discount": {
    "code": "<string>",
    "discountType": "amount_off",
    "amountOff": 123,
    "percentOff": 123,
    "currency": "<string>",
    "duration": "once",
    "durationInMonths": 123,
    "redeemBy": "2023-11-07T05:31:56Z",
    "maxRedemptions": 123,
    "priceVariants": [
      123
    ]
  }
}
'
{
  "id": 123,
  "status": "active",
  "discountType": "amount_off",
  "code": "<string>",
  "redeemBy": "2023-11-07T05:31:56Z",
  "maxRedemptions": 123,
  "timesRedeemed": 123,
  "duration": "once",
  "durationInMonths": 123,
  "amountOff": 123,
  "percentOff": 123,
  "currency": "<string>",
  "prefixId": "<string>",
  "destroyable": true,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "priceVariants": [
    {
      "id": 123,
      "name": "<string>",
      "amount": 123,
      "currency": "<string>",
      "billingType": "one_time",
      "amountType": "<string>",
      "discountedFromAmount": 123,
      "presetAmount": 123,
      "minimumAmount": 123,
      "maximumAmount": 123,
      "recurringInterval": "<string>",
      "intervalCount": 123,
      "trialPeriodDays": 123,
      "revokeAfterDays": 123,
      "hidden": true,
      "archived": true,
      "waitlist": true,
      "position": 123,
      "prefixId": "<string>",
      "benefits": [
        "<string>"
      ],
      "seatQuantity": 123,
      "isDefault": true,
      "isPayWhatYouWant": true,
      "hasFreeTrial": true,
      "isQuantityLimited": true
    }
  ]
}

Authorizations

Authorization
string
header
required

API key in the format: Bearer {api_token}

Body

application/json
discount
object
required

Response

Discount created

id
integer
status
enum<string>
Available options:
active,
expired,
scheduled
discountType
enum<string>
Available options:
amount_off,
percent_off
code
string
redeemBy
string<date-time> | null
maxRedemptions
integer | null
timesRedeemed
integer
duration
enum<string> | null
Available options:
once,
forever,
repeating
durationInMonths
integer | null
amountOff
integer | null

Discount amount in cents

percentOff
number | null
currency
string | null
prefixId
string
destroyable
boolean
createdAt
string<date-time>
updatedAt
string<date-time>
priceVariants
object[]