POST
/
v1
/
coupons
curl --request POST \
  --url https://api.hyperline.co/v1/coupons \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Partner discount",
  "description": "<string>",
  "expiration_date": "2023-11-07T05:31:56Z",
  "redemption_limit": 123,
  "type": "amount",
  "discount_amount": 2000,
  "currency": "EUR"
}'
{
  "id": "cou_DKL4Xcb5VSa8CQ",
  "name": "Partner discount",
  "description": "<string>",
  "expiration_date": "2023-11-07T05:31:56Z",
  "redemption_limit": 123,
  "created_at": "2023-01-20T16:04:11Z",
  "type": "amount",
  "discount_amount": 2000,
  "currency": "EUR"
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

Coupon name.

description
string | null
required

Coupon description.

expiration_date
string | null
required

Date corresponding to the expiration of the coupon.

redemption_limit
number | null
required

Number of times the coupon can be used when applied on a subscription.

type
enum<string>
required
Available options:
amount
discount_amount
number
required

Amount to apply as a discount on the total amount (excluding taxes) of a subscription. Expressed in the currency's smallest unit.

currency
string
required

Currency code. See ISO 4217.

Response

201 - application/json
id
string
required

Coupon ID.

name
string
required

Coupon name.

description
string | null
required

Coupon description.

expiration_date
string | null
required

Date corresponding to the expiration of the coupon.

redemption_limit
number | null
required

Number of times the coupon can be used when applied on a subscription.

created_at
string
required

UTC date time string in the ISO 8601 format.

type
enum<string>
required
Available options:
amount
discount_amount
number
required

Amount to apply as a discount on the total amount (excluding taxes) of a subscription. Expressed in the currency's smallest unit.

currency
string
required

Currency code. See ISO 4217.