API · Create coupon
API v1POST /api/v1/createCouponWhat it does#
Creates a discount coupon for a recurring plan: discount type, expiration, user and email permissions, and usage limits.
Authentication#
Requires the API bearer token in the Authorization header — see authentication.
Parameters#
Tilopay integration key.
Recurring plan id.
User permission.
| Code | Value |
|---|---|
| 0 | Allow new users only |
| 1 | Allow already registered users |
Discount type.
| Code | Value |
|---|---|
| 1 | Percentage |
| 2 | Fixed amount |
Numeric value of the discount.
Coupon expiration date, Y-m-d format (for example 2025-10-20).
Email permission.
| Code | Value |
|---|---|
| 1 | Specific emails |
| 2 | Any email |
Comma-separated list of emails. Required when email_group is sent as 1.
Total number of uses.
Total number of valid renewals.
Total uses by the same user.
Request example#
The <...> values are placeholders: replace them with your own credentials and data.
{
"key": "<api_key>",
"planId": 10,
"active_users": 1,
"type_discount": 1,
"discount": 40,
"expire": "2025-10-20",
"email_group": 1,
"email": "cliente@ejemplo.com, cliente@ejemplo.com",
"usage": 1,
"renews": 2,
"renews_by_user": 2
}Response#
{
"type": "200",
"status": 1,
"message": "Success",
"id": 10788,
"code": "E6RMS339"
}id is the id of the created coupon and code is the code the end customer uses when subscribing.
To interpret a response that is not a success, see how to read an error response.
Last verified: 2026-09-02 · Owner: equipo-integraciones