Billing Cycles & Use Cases

Overview of recurrence logic and practical use cases. Review the supported billing intervals and the specific data structures required to automate your customer's payment schedule across daily, weekly, monthly, or yearly cycles.

Billing Cycles

The system calculates next_payment_date automatically based on the interval and billing cycle parameters.

IntervalDescriptionbilling_cycle.daybilling_cycle.month
dailyEvery dayN/AN/A
weeklyEvery weekDay of week (1=Monday, 7=Sunday)N/A
monthlyEvery monthDay of month (1-31)N/A
quarterlyEvery 3 monthsDay of month (1-31)Base month (1-12)
semiannualEvery 6 monthsDay of month (1-31)Base month (1-12)
yearlyEvery yearDay of month (1-31)Month (1-12)


Practical Use Cases

Below are common scenarios demonstrating how to configure the API for different business models. See our Direct Debit Management page for further details on how to use each endpoint.

Case 1: Monthly Subscription

Scenario: A gym charges $500 MXN monthly on the 1st of each month.

// 1. Create the direct debit
POST /api/direct-debits
{
  "customer_id": "customer_123",
  "is_recurring": true,
  "amount": 500.00,
  "currency": "MXN",
  "status": "created",
  "interval": "monthly",
  "frequency": 1,
  "concept": "Gym Membership",
  "billing_cycle": {
    "day": 1
  }
}

// System calculates: next_payment_date = 2026-01-01


Case 2: Quarterly Payment

Scenario: A software company charges $3,000 MXN each quarter on the 15th of the first month of the quarter (January, April, July, October).

POST /api/direct-debits
{
  "customer_id": "customer_456",
  "is_recurring": true,
  "amount": 3000.00,
  "currency": "MXN",
  "status": "created",
  "interval": "quarterly",
  "frequency": 1,
  "concept": "Software License",
  "billing_cycle": {
    "day": 15,
    "month": 1 // January as base month
  }
}

// System calculates next dates: 2026-01-15, 2026-04-15, 2026-07-15, 2026-10-15


Case 3: Weekly Payment

Scenario: A streaming service charges $99 MXN every Friday.

POST /api/direct-debits
{
  "customer_id": "customer_789",
  "is_recurring": true,
  "amount": 99.00,
  "currency": "MXN",
  "status": "created",
  "interval": "weekly",
  "frequency": 1,
  "concept": "Streaming Premium",
  "billing_cycle": {
    "day": 5 // 5 = Friday (1=Monday, 7=Sunday)
  }
}


Case 4: Scheduled One-Time Charge

Scenario: A one-time charge of $10,000 MXN scheduled for March 31, 2026.

POST /api/direct-debits
{
  "customer_id": "customer_101",
  "is_recurring": false,
  "amount": 10000.00,
  "currency": "MXN",
  "status": "created",
  "concept": "Payment for professional services",
  "next_payment_date": "2026-03-31T00:00:00.000Z"
}