Subscription Templates

⚠️

IMPORTANT

To follow the steps below, it is essential to have the corresponding Authorization Token. For more information, please refer to the following documentation page: Authorization Token

Create a Subscription Template

Use a template when you want to define a reusable subscription model with parameters like billing frequency and trial period.

💻

Visit our API Reference to test this endpoint.

Endpoint

  • POST https://ecartpay.com/api/subscriptions-template
  • POST https://sandbox.ecartpay.com/api/subscriptions-template

Headers

  • Authorization: token

Request Body

FieldTypeDescription
amountnumberAmount to charge per interval (e.g., 100 = $100.00)
currencystringISO 4217 currency code (MXN or USD)
intervalstringBilling interval: daily, weekly, monthly, quarterly, semiannual, or yearly
frequencynumberFrequency multiplier (default: 1)
servicestringName or label for the subscription service
trial_period_daysnumber(Optional) Number of days before the first charge
benefitsarray(Optional) List of benefits included in the subscription
billing_cycleobject(Optional) Specific billing cycle configuration
end_datestring(Optional) ISO date string for subscription termination

Examples

Request

curl --request POST \
     --url https://sandbox.ecartpay.com/api/subscriptions-template \
     --header 'Authorization: sha512-VWqeodM6nKbe3sr+UXs0X5ZhIjrdmVMEzBMEEpP29VaKx1YTE+E8BW/6KH2JWCdU1s7ZuyGajv9G9Yh6lvRygQ==?g3WA' \
     --header 'User-Agent: ReadMe-API-Explorer' \
     --header 'content-type: application/json' \
     --data '
{
  "interval": "daily",
  "amount": 8.99,
  "currency": "USD",
  "frequency": 1,
  "service": "Taquitos al día",
  "benefits": [
    "Salsita",
    "Cilantro",
    "Cebolla",
    "Limón reseco"
  ]
}
'

Response

{
  "account_id": "68a4c3150b28a9584305a2a6",
  "amount": 8.99,
  "currency": "USD",
  "interval": "daily",
  "frequency": 1,
  "service": "Taquitos al día",
  "benefits": [
    "Salsita",
    "Cilantro",
    "Cebolla",
    "Limón reseco"
  ],
  "id": "68dc141db5f2f511be9e8fa9",
  "created_at": "2025-09-30T17:32:13.530Z",
  "updated_at": "2025-09-30T17:32:13.530Z"
}


Get All Subscription Templates

Use this endpoint to retrieve all subscription templates.

💻

Visit our API Reference to test this endpoint.

Endpoint

  • https://ecartpay.com/api/subscriptions-template
  • https://sandbox.ecartpay.com/api/subscriptions-template

Headers

  • Authorization: token

Examples

Request

curl --request GET \
     --url https://sandbox.ecartpay.com/api/subscriptions-template \
     --header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY4YTRjMzE1MGIyOGE5NTg0MzA1YTJhYSIsImFjY291bnRfaWQiOiI2OGE0YzMxNTBiMjhhOTU4NDMwNWEyYTYiLCJhY2NvdW50Ijp7ImVtYWlsIjoiaHVnby5tb3JpbkBlY2FydHBheS5jb20iLCJmaXJzdF9uYW1lIjoiSHVnbyIsImxhc3RfbmFtZSI6Ik1vcsOtbiIsInBob25lIjoiNTI4MTE2MTI2NzY3IiwiY291bnRyeSI6Ik1YIiwiY3VycmVuY3kiOiJNWE4iLCJ2ZXJpZmllZCI6dHJ1ZSwiYWN0aXZlIjp0cnVlfSwiaWF0IjoxNzU5MjU3OTk3LCJleHAiOjE3NTkyNjE1OTd9.i7zFffRfAj3gDwBXrDwn3Jg8rDquLMtXIubGuu0yRX7N2T4amp1G2pW4736F0vh4kcPEl4W7kEpWsHbIpg3LnQ'

Response

{
  "count": 4,
  "docs": [
    {
      "id": "68dc141db5f2f511be9e8fa9",
      "amount": 8.99,
      "currency": "USD",
      "interval": "daily",
      "frequency": 1,
      "service": "Taquitos al día",
      "benefits": [
        "Salsita",
        "Cilantro",
        "Cebolla",
        "Limón reseco"
      ],
      "created_at": "2025-09-30T17:32:13.530Z"
    },
    {
      "id": "68dc1306ff8f016d8e16adbc",
      "amount": 1300,
      "currency": "MXN",
      "interval": "monthly",
      "frequency": 1,
      "service": "Taquiza Mensual",
      "benefits": [
        "Tortillas extra",
        "Salsa individual",
        "5 servilletas",
        "Cilantro y Cebolla 60gr"
      ],
      "created_at": "2025-09-30T17:27:34.879Z"
    },
    {
      "id": "68dc0d00ff8f016d8e16abdc",
      "amount": 4999,
      "currency": "MXN",
      "interval": "monthly",
      "frequency": 1,
      "service": "Tacos infinitos",
      "benefits": [
        "Tortillas infinitas",
        "Salsa eterna",
        "Servilletas interminables",
        "Cilantro y cebolla sin fin"
      ],
      "created_at": "2025-09-30T17:01:52.520Z"
    },
    {
      "id": "68c03efbacc9edbc2d955db0",
      "amount": 200,
      "currency": "MXN",
      "interval": "weekly",
      "frequency": 1,
      "service": "Tacos cada semana",
      "trial_period_days": 0,
      "benefits": [
        "Tortillas extra",
        "Salsa verde",
        "Salsa roja",
        "Salsa guacamole",
        "Sal",
        "Limón"
      ],
      "created_at": "2025-09-09T14:51:39.850Z"
    }
  ],
  "pages": 1
}