API · Create recurring plan

API v1
POST /api/v1/createPlanRepeat

What it does#

Creates a subscription plan: charge frequency, currency, trial period, modalities and webhooks.

Authentication#

Requires the API bearer token in the Authorization header — see authentication.

Parameters#

keystringrequerido#

Tilopay integration key.

titlestringrequerido#

Recurring plan title.

descriptionstring#

Plan description.

frecuencyinteger#

Charge frequency.

CodeValue
1Daily
2Weekly
3Monthly
4Yearly
5Fortnightly
6Every two months
7Quarterly
8Every four months
9Every six months
currencystringrequerido#

Currency code in ISO 4217 format.

first_amountintegerrequerido#

Initial payment amount.

trialintegerrequerido#

Enables the free trial period: 0 no, 1 yes.

trial_daysintegerrequerido#

Days of the free trial period.

attemptsintegerrequerido#

Number of retries for failed charges.

modalityarrayrequerido#

Array of plan modalities.

thanks_urlstring#

Optional field. The merchant's own thank-you URL; it must support the GET method.

webhook_subscribestring#

Optional field. Webhook URL, over POST, that receives the callback in the request body when a customer successfully takes out a subscription. Example of the data sent: {'id_plan' : 1, 'email' : 'email@email.com', 'modality' : 'ModalityName', 'amount' : 25, 'frequency' : '', 'coupon' : '5HT5W8YT', 'free_trial' : 1, 'next_payment_date' : '2023-02-25'}

webhook_paymentstring#

Optional field. Webhook URL, over POST, that receives the callback in the request body when the customer is charged successfully. Example of the data sent: {'id_plan' : 1, 'email' : 'email@email.com', 'amount' : 25, 'auth' : '123456', 'orderNumber' : 'PRE123456'}

webhook_rejectedstring#

Optional field. Webhook URL, over POST, that receives the callback in the request body when a payment fails. Example of the data sent: {'id_plan' : 1, 'email' : 'email@email.com', 'amount' : 25}

webhook_unsubscribestring#

Optional field. Webhook URL, over POST, that receives the callback in the request body when a customer cancels the subscription to one of their plans. Example of the data sent: {'id_plan' : 1, 'email' : 'email@email.com', 'expire' : '2023-02-25'}

webhook_reactivestring#

Optional field. Webhook URL, over POST, that receives the callback in the request body when a customer reactivates the subscription to one of their plans. Example of the data sent: {'id_plan' : 1, 'email' : 'email@email.com', 'next_payment_date' : '2023-02-25'}

end_atstring#

End date of the recurring plan, d-m-Y format (for example 25-09-2022). When the plan has no end date, send it empty.

notifyinteger#

Set to 1 it adds the notify_detail and notify_note text to the notification email. Set to 0 it adds neither.

notify_detail_esstring#

Detail text in Spanish. Optional when notify is 0.

notify_detail_enstring#

Detail text in English. Optional when notify is 0.

notify_note_esstring#

Notes text in Spanish. Optional when notify is 0.

notify_note_enstring#

Notes text in English. Optional when notify is 0.

Request example#

The <...> values are placeholders: replace them with your own credentials and data.

{
  "key": "<api_key>",
  "title": "Plan title",
  "description": "Plan description",
  "frecuency": 1,
  "currency": "USD",
  "first_amount": 0,
  "trial": 0,
  "trial_days": 0,
  "attempts": 1,
  "modality": [
    {
      "title": "Basic",
      "amount": 10
    },
    {
      "title": "Premium",
      "amount": 30
    }
  ],
  "thanks_url": "",
  "webhook_subscribe": "",
  "webhook_payment": "",
  "webhook_rejected": "",
  "webhook_unsubscribe": "",
  "webhook_reactive": "",
  "end_at": "25-10-2023",
  "notify": 0,
  "notify_detail_es": "",
  "notify_detail_en": "",
  "notify_note_es": "",
  "notify_note_en": ""
}

Response#

{
  "type": "200",
  "status": 1,
  "message": "Success",
  "id": 624,
  "url": "https://app.tilopay.com/link/TmpJMHwx"
}

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