Skip to main content
The Invoice Data Model represents a bill issued to a contact for products or services. In V4, invoices embed complete transaction history, payment links, and relationship references to provide a full financial picture.
  • Embedded transaction history: Invoices include complete arrays of payments, refunds, and credits applied
  • Integrated payment links: Payment link functionality is merged directly into the invoice model
  • Comprehensive financial tracking: Track amounts paid, refunded, credited, and due in a single object
  • Relationship references: Links to orders, subscriptions, and contacts for complete context

Attributes

Invoice Attributes

PropertyTypeDescription
rootfi_idintegerUnique identifier for this invoice
rootfi_created_atstringWhen this invoice was created in Commenda’s system (ISO 8601)
rootfi_updated_atstringWhen this invoice was last updated in Commenda’s system (ISO 8601)
rootfi_company_idintegerCompany identifier this invoice belongs to
platform_idstringPlatform-specific invoice identifier
contact_idstringReference to the Contact who is billed
currency_idstringISO 4217 currency code for all amounts on this invoice
document_numberstringHuman-readable invoice number (e.g., “INV-2025-001”)
posted_datestringDate when the invoice was issued (ISO 8601)
due_datestringDate when payment is due (ISO 8601)
statusenumCurrent payment status of the invoice
sub_totalnumberTotal amount before tax, discounts, and shipping
tax_amountnumberTotal tax charged on this invoice
total_discountnumberTotal discount amount applied
shipping_amountnumberShipping and handling charges
total_amountnumberFinal total amount due
amount_paidnumberTotal amount paid by the contact
amount_refundednumberTotal amount refunded to the contact
amount_creditednumberTotal credit notes applied to this invoice
amount_duenumberRemaining balance due
memostringAdditional notes or description for this invoice
created_atstringOriginal creation timestamp from platform (ISO 8601)
updated_atstringLast update timestamp from platform (ISO 8601)
order_idsarrayReferences to associated Orders (for consolidated invoices)
subscription_idstringReference to the Subscription (for recurring invoices)
payment_linkstringURL where contact can pay this invoice online
payment_link_expires_atstringExpiration date for the payment link (ISO 8601)
line_itemsarrayIndividual items/services billed on this invoice
transactionsarrayComplete history of payments, refunds, and credits

Status Enum Values

ValueDescription
draftInvoice created but not yet sent to contact
submittedInvoice sent to contact, payment pending (replaces ‘open’)
partially_paidPartial payment received
paidInvoice has been fully paid
overduePayment due date has passed without full payment
voidInvoice has been cancelled/voided
unknownStatus cannot be determined

LineItem Attributes

PropertyTypeDescription
rootfi_idintegerUnique identifier for this line item
item_idstringReference to the Item/Product being billed
descriptionstringText description of the product or service
quantityintegerNumber of units
unit_amountnumberPrice per unit before tax and discounts
tax_amountnumberTotal tax for this line item
discount_amountnumberTotal discount applied to this line item
total_amountnumberFinal amount (quantity × unit_amount + tax - discount)

Expandable Attributes

Use the expand query parameter to include related objects:
  • expand=contact - Includes full Contact object
  • expand=line_items - Includes detailed LineItem objects
  • expand=transactions - Includes all Transaction objects (payments, refunds, credits)
  • expand=subscription - Includes the parent Subscription object (if applicable)
  • expand=orders - Includes associated Order objects (if applicable)
{
  "rootfi_id": 54321,
  "rootfi_created_at": "2025-01-05T00:00:00Z",
  "rootfi_updated_at": "2025-01-15T14:20:00Z",
  "rootfi_company_id": 999,
  "platform_id": "inv_stripe_001",
  "contact_id": "12345",
  "currency_id": "USD",
  "document_number": "INV-2025-001",
  "posted_date": "2025-01-05T00:00:00Z",
  "due_date": "2025-02-05T00:00:00Z",
  "status": "paid",
  "sub_total": 1000.00,
  "tax_amount": 100.00,
  "total_discount": 50.00,
  "shipping_amount": 25.00,
  "total_amount": 1075.00,
  "amount_paid": 1075.00,
  "amount_refunded": 0.00,
  "amount_credited": 0.00,
  "amount_due": 0.00,
  "memo": "Monthly subscription",
  "created_at": "2025-01-05T00:00:00Z",
  "updated_at": "2025-01-15T14:20:00Z",
  "order_ids": ["ord_001"],
  "subscription_id": "sub_001",
  "payment_link": "https://pay.example.com/inv_54321",
  "payment_link_expires_at": "2025-02-05T00:00:00Z",
  "line_items": [
    {
      "rootfi_id": 1001,
      "item_id": "prod_001",
      "description": "Premium Plan - Monthly",
      "quantity": 1,
      "unit_amount": 1000.00,
      "tax_amount": 100.00,
      "discount_amount": 50.00,
      "total_amount": 1050.00
    }
  ],
  "transactions": [
    {
      "rootfi_id": 9001,
      "platform_id": "txn_stripe_001",
      "type": "payment",
      "amount": 1075.00,
      "currency_id": "USD",
      "status": "completed",
      "payment_method_type": "card",
      "gateway": "stripe",
      "description": "Payment for INV-2025-001",
      "created_at": "2025-01-05T12:00:00Z"
    }
  ]
}