API · Create coupon

API v1
POST /api/v1/createCoupon

What 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#

keystringrequerido#

Tilopay integration key.

planIdintegerrequerido#

Recurring plan id.

active_usersintegerrequerido#

User permission.

CodeValue
0Allow new users only
1Allow already registered users
type_discountintegerrequerido#

Discount type.

CodeValue
1Percentage
2Fixed amount
discountintegerrequerido#

Numeric value of the discount.

expirestringrequerido#

Coupon expiration date, Y-m-d format (for example 2025-10-20).

email_groupintegerrequerido#

Email permission.

CodeValue
1Specific emails
2Any email
emailstring#

Comma-separated list of emails. Required when email_group is sent as 1.

usageinteger#

Total number of uses.

renewsinteger#

Total number of valid renewals.

renews_by_userinteger#

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
}

To interpret a response that is not a success, see how to read an error response.

Last verified: 2026-08-29 · Owner: equipo-integraciones

View as raw Markdown