Skip to main content
POST
/
v1
/
coupons
/
{id}
Update a coupon
curl --request POST \
  --url https://api.yorlet.com/v1/coupons/{id} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>"
}
'
{
  "id": "<string>",
  "created": 123,
  "object": "coupon",
  "amount_off": 123,
  "applies_to": {
    "invoice_item_types": [
      "<string>"
    ]
  },
  "currency": "<string>",
  "duration": "<string>",
  "duration_in_months": 123,
  "max_redemptions": 123,
  "metadata": {},
  "name": "<string>",
  "percent_off": 123,
  "redeem_by": 123,
  "valid": true,
  "account": "<string>",
  "deleted": false,
  "times_redeemed": 0
}

Authorizations

Authorization
string
header
required

API Key authentication. Use "Bearer YOUR_API_KEY".

Path Parameters

id
string
required

The id identifier.

Body

application/json
name
string
required

Response

200 - application/json

Update a coupon

id
string
required

Unique identifier for the object.

created
number
required

Time at which the object was created. Measured in seconds since the Unix epoch.

object
enum<string>
required
Available options:
coupon
amount_off
number | null
required
applies_to
object
required
currency
string
required
duration
string | null
required
duration_in_months
number | null
required
max_redemptions
number | null
required
metadata
object
required
name
string | null
required
percent_off
number | null
required
redeem_by
number | null
required
valid
boolean
required
account
string

The account that the object belongs to. Only returned if the request is made with a valid Yorlet-Context header.

deleted
boolean
default:false

Only returned if the object has been deleted.

times_redeemed
number
default:0