curl --request POST \
--url https://api.yorlet.com/v1/coupons \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"amount_off": 123,
"applies_to": {
"invoice_item_types": [
"rent"
]
},
"currency": "<string>",
"duration": "repeating",
"duration_in_months": 2,
"max_redemptions": 2,
"metadata": {},
"percent_off": 50.5,
"redeem_by": 123
}
'{
"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
}Create a coupon
curl --request POST \
--url https://api.yorlet.com/v1/coupons \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"amount_off": 123,
"applies_to": {
"invoice_item_types": [
"rent"
]
},
"currency": "<string>",
"duration": "repeating",
"duration_in_months": 2,
"max_redemptions": 2,
"metadata": {},
"percent_off": 50.5,
"redeem_by": 123
}
'{
"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
}API Key authentication. Use "Bearer YOUR_API_KEY".
Show child attributes
repeating, once, forever x >= 1x >= 1Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Show child attributes
1 <= x <= 100Must be a Unix timestamp in UTC time.
Create a coupon
Unique identifier for the object.
Time at which the object was created. Measured in seconds since the Unix epoch.
coupon Show child attributes
Show child attributes
The account that the object belongs to. Only returned if the request is made with a valid Yorlet-Context header.
Only returned if the object has been deleted.
Was this page helpful?