Skip to main content
The Order Data Model represents a purchase order, typically linked to an invoice. Orders track the commercial transaction details and can generate invoices. In V4, orders embed complete transaction history for comprehensive financial tracking.
  • Invoice generation: Orders can generate one or more invoices
  • Embedded transactions: Complete payment history embedded in the order object
  • Status tracking: Track both order fulfillment status and payment status
  • Line item details: Detailed breakdown of items in the order

Attributes

Order Attributes

PropertyTypeDescription
rootfi_idintegerUnique identifier for this order
rootfi_created_atstringWhen this order was created in Commenda’s system (ISO 8601)
rootfi_updated_atstringWhen this order was last updated (ISO 8601)
rootfi_company_idintegerCompany identifier this order belongs to
platform_idstringPlatform-specific order identifier
contact_idstringReference to the Contact
currency_idstringISO 4217 currency code
statusenumCurrent order status
payment_statusenumPayment state of the order
total_amountnumberTotal order amount
total_discountnumberTotal discount amount
total_taxnumberTotal tax amount
created_atstringOriginal creation timestamp from platform (ISO 8601)
updated_atstringLast update timestamp from platform (ISO 8601)
invoice_idstringReference to the primary Invoice
invoice_idsarrayReferences to all related invoices
line_itemsarrayItems included in this order
transactionsarrayAll payment transactions for this order

Status Enum Values

ValueDescription
pendingOrder created but not yet processed
processingOrder is being processed
completedOrder has been fulfilled
cancelledOrder was cancelled
on_holdOrder is temporarily on hold
unknownStatus cannot be determined

Payment Status Enum Values

ValueDescription
pendingPayment initiated but not confirmed
paidPayment completed successfully
partially_paidPartial payment received
failedPayment failed to process
refundedPayment refunded
partially_refundedPartial refund issued
voidedPayment voided before capture
unknownPayment status cannot be determined

LineItem Attributes

PropertyTypeDescription
rootfi_idintegerUnique identifier for this line item
item_idstringReference to the Item/Product
descriptionstringText description of the product or service
quantityintegerNumber of units
unit_amountnumberPrice per unit
tax_amountnumberTotal tax for this line item
discount_amountnumberTotal discount applied
total_amountnumberFinal amount

Expandable Attributes

Use the expand query parameter to include related objects:
  • expand=contact - Includes full Contact object
  • expand=invoice - Includes the primary Invoice object
  • expand=invoices - Includes all related Invoice objects
  • expand=line_items - Includes detailed LineItem objects
  • expand=transactions - Includes all Transaction objects
{
  "rootfi_id": 7001,
  "rootfi_created_at": "2025-01-05T00:00:00Z",
  "rootfi_updated_at": "2025-01-05T12:00:00Z",
  "rootfi_company_id": 999,
  "platform_id": "ord_stripe_001",
  "contact_id": "12345",
  "currency_id": "USD",
  "status": "completed",
  "payment_status": "paid",
  "total_amount": 1075.00,
  "total_discount": 50.00,
  "total_tax": 100.00,
  "created_at": "2025-01-05T00:00:00Z",
  "updated_at": "2025-01-05T12:00:00Z",
  "invoice_id": "54321",
  "invoice_ids": ["54321"],
  "line_items": [
    {
      "rootfi_id": 3001,
      "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"
    }
  ]
}