Skip to main content
The Subscription Data Model represents a recurring billing arrangement with a contact. Subscriptions automatically generate invoices at regular intervals and track all related transactions.
  • Automated billing: Generate invoices automatically based on billing interval
  • Complete history: Track all invoices, payments, and transactions generated by the subscription
  • Flexible intervals: Support for daily, weekly, monthly, and annual billing cycles
  • Status management: Track subscription lifecycle from trial through cancellation

Attributes

Subscription Attributes

PropertyTypeDescription
rootfi_idintegerUnique identifier for this subscription
rootfi_created_atstringWhen this subscription was created in Commenda’s system (ISO 8601)
rootfi_updated_atstringWhen this subscription was last updated (ISO 8601)
rootfi_company_idintegerCompany identifier this subscription belongs to
platform_idstringPlatform-specific subscription identifier
contact_idstringReference to the Contact subscribed
currency_idstringISO 4217 currency code for subscription charges
statusenumCurrent status of the subscription
amountnumberRecurring charge amount per billing cycle
intervalenumBilling frequency unit (day, week, month, year)
interval_countintegerNumber of intervals between billings (e.g., 2 = every 2 months)
next_billing_datestringNext scheduled billing date (ISO 8601)
last_invoice_datestringDate when the last invoice was generated (ISO 8601)
last_payment_datestringDate when the last successful payment was received (ISO 8601)
created_atstringOriginal creation timestamp from platform (ISO 8601)
updated_atstringLast update timestamp from platform (ISO 8601)
invoice_idsarrayReferences to all invoices generated from this subscription
transaction_idsarrayReferences to all transactions (payments, refunds, fees)
itemsarrayProducts/services included in this subscription

Status Enum Values

ValueDescription
activeSubscription is active and billing normally
in_trialSubscription is in a trial period (no charges)
cancelledSubscription has been cancelled and will not renew
pausedSubscription is temporarily paused
past_dueSubscription has failed payment and is past due
incompleteSubscription setup is incomplete
unknownStatus cannot be determined

Interval Enum Values

ValueDescription
dayDaily billing
weekWeekly billing
monthMonthly billing
yearAnnual billing

SubscriptionItem Attributes

PropertyTypeDescription
rootfi_idintegerUnique identifier for this subscription item
item_idstringReference to the Item/Product
descriptionstringDescription of the subscribed product or service
quantityintegerNumber of units subscribed
unit_amountnumberPrice per unit

Expandable Attributes

Use the expand query parameter to include related objects:
  • expand=contact - Includes full Contact object
  • expand=items - Includes detailed SubscriptionItem objects
  • expand=invoices - Includes all generated Invoice objects
  • expand=transactions - Includes all Transaction objects
{
  "rootfi_id": 6001,
  "rootfi_created_at": "2025-01-01T00:00:00Z",
  "rootfi_updated_at": "2025-01-15T10:00:00Z",
  "rootfi_company_id": 999,
  "platform_id": "sub_stripe_001",
  "contact_id": "12345",
  "currency_id": "USD",
  "status": "active",
  "amount": 99.99,
  "interval": "month",
  "interval_count": 1,
  "next_billing_date": "2025-02-01T00:00:00Z",
  "last_invoice_date": "2025-01-15T00:00:00Z",
  "last_payment_date": "2025-01-15T12:00:00Z",
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-15T10:00:00Z",
  "invoice_ids": ["inv_54321", "inv_54322"],
  "transaction_ids": ["txn_9001", "txn_9002", "txn_9003"],
  "items": [
    {
      "rootfi_id": 2001,
      "item_id": "prod_001",
      "description": "Premium Plan",
      "quantity": 1,
      "unit_amount": 99.99
    }
  ]
}