Skip to main content
POST
Grant a discount to an email

Authorizations

Authorization
string
header
default:easner_sk_test_…
required

A secret key, easner_sk_test_… or easner_sk_live_…, as Authorization: Bearer. Each key has one business, one mode and fixed scopes. Transfer routes also accept a transfer's easner_ta_… secret for the customer.

Headers

Idempotency-Key
string

Up to 255 characters. Keys are scoped to your business and mode. Longer is 400 invalid_idempotency_key. Honoured only on the operations marked idempotent.

Maximum string length: 255

Body

application/json
customer_email
string<email>
required
percent_off
number
Required range: x <= 100
amount_off
integer
currency
string
Required string length: 3
duration
enum<string>
default:once
Available options:
once,
repeating,
forever
duration_in_months
integer
Required range: 1 <= x <= 36
active
boolean
default:true

Response

The discount.

A discount for one email, applied at checkout. Not a code: a payer cannot type it.

object
any
required
id
string<uuid>
required
customer_email
string<email>
required
duration
enum<string>
required
Available options:
once,
repeating,
forever
active
boolean
required
livemode
boolean
required
created
string<date-time>
required
percent_off
number | null
amount_off
integer | null

Whole cents.

currency
string | null
duration_in_months
integer | null
description
string

For example "20% off for 3 months".