Getting Started with V4
The Commenda Integrations API V4 provides a unified interface for managing customers, invoices, subscriptions, and all payment-related transactions across multiple payment platforms. This version introduces significant improvements including:- Unified Transaction Model: Payments, refunds, and credit notes are consolidated into a single Transaction model
- Embedded Relationships: Invoices include complete transaction history and payment links
- Enhanced Tracking: Subscriptions track invoice history, transaction IDs, and billing dates
- Consistent Enums: All status and type fields use standardized, lowercase enum values
Environments
Default API endpoint ishttps://api.rootfi.dev/v4
KSA (Kingdom of Saudi Arabia) region API endpoint is https://api.sa.rootfi.dev/v4
Authentication
All API requests require authentication using an API key. Include your API key in theapi_key header:
Rate Limits
- Standard rate limit: 100 requests per minute per API key
- Burst limit: 200 requests per minute
- Rate limit headers included in all responses:
X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-Reset
Callback URLs
The default callback URL for OAuth2 integrations ishttps://integrate.rootfi.dev/oauth/callback
For the KSA (Kingdom of Saudi Arabia) region, the callback URL is https://app.sa.rootfi.dev/oauth/callback
What’s New in V4
V4 introduces a unified, world-class API standardization across all domains. The key improvements help you migrate seamlessly from V3 with better consistency and richer data models.Payments API
| Feature | V3 | V4 |
|---|---|---|
| Payments, Refunds, Credit Notes | Separate endpoints | Unified Transaction model |
| Payment Links | Separate model | Embedded in Invoice |
| Products | Separate model | Items with embedded Variants |
| Transaction History | Separate calls | Embedded in Invoice/Subscription |
| Subscription Tracking | Basic fields | invoice_ids, transaction_ids, billing dates |
| Status Enums | Mixed case (e.g., ACTIVE, Pending) | Lowercase (e.g., active, pending) |
| V3 Endpoint | V4 Endpoint |
|---|---|
GET /v3/payments/payments | GET /v4/payments/transactions?type=payment |
GET /v3/payments/refunds | GET /v4/payments/transactions?type=refund |
GET /v3/payments/credit-notes | GET /v4/payments/transactions?type=credit_note |
GET /v3/payments/products | GET /v4/payments/items |
E-commerce API
| Feature | V3 | V4 |
|---|---|---|
| Payments & Refunds | Separate endpoints | Unified Transaction model with type filter |
| Products | Separate model, no variants | Items with embedded Variants (sizes, colors, pricing) |
| Orders | Basic structure | Embedded fulfillments, transactions, and addresses |
| Fulfillment Status | Limited states | Enhanced states: in_transit, delivered, returned |
| Inventory Status | Basic availability | in_stock, low_stock, out_of_stock, discontinued |
| Status Enums | Mixed case | Lowercase (e.g., active, archived) |
| V3 Endpoint | V4 Endpoint |
|---|---|
GET /v3/ecommerce/payments | GET /v4/ecommerce/transactions?type=payment |
GET /v3/ecommerce/refunds | GET /v4/ecommerce/transactions?type=refund |
GET /v3/ecommerce/products | GET /v4/ecommerce/items |
- Orders now include
fulfillments[]andtransactions[]arrays directly in the response - Items include
variants[]with individual SKUs, pricing, and inventory status - Use
expand=fulfillments,transactionsto get complete order data in a single call
Accounting API
| Feature | V3 | V4 |
|---|---|---|
| Invoice/Bill Status | Mixed values (e.g., OPEN, Paid) | Standardized: draft, submitted, partially_paid, paid, overdue, void |
| Contact Status | Limited tracking | Full lifecycle: active, inactive, suspended, archived |
| Contact Type | Basic | Clear enum: customer, vendor, both |
| Item Type | Limited | Standardized: inventory, non_inventory, service, digital |
| Account Category | Platform-specific | Unified: asset, liability, equity, income, expense |
| Expandable Attributes | Limited | Rich expansion: currency, line_items, contact, documents, payments |
| V3 Status | V4 Status |
|---|---|
OPEN / Open / Pending | submitted |
PAID / Paid | paid |
PARTIAL / PartiallyPaid | partially_paid |
OVERDUE / Overdue | overdue |
DRAFT / Draft | draft |
VOID / Voided / Cancelled | void |
- All status and type enums are lowercase for consistency
- Use
expandparameter to include related objects (e.g.,expand=contact,line_items) submittedreplaces various “open/pending” states across platformsunknownvalue available when platform data cannot be mapped
Cross-API Standardization
V4 ensures consistency across Payments, E-commerce, and Accounting:| Feature | Standardization |
|---|---|
| All Enums | Lowercase values (e.g., active, paid, pending) |
| Transaction Types | Unified: payment, refund, chargeback, credit_note, fee, payout, adjustment |
| Payment Methods | Unified: card, bank_transfer, wire_transfer, paypal, apple_pay, google_pay, cash, check, crypto |
| Contact/Customer Type | Unified: customer, vendor, both, unknown |
| Contact/Customer Status | Unified: active, inactive, suspended, archived, unknown |
| Item Type | Unified: inventory, non_inventory, service, digital, unknown |
| Address Type | Unified: billing, shipping, warehouse |
Backward Compatibility
V4 maintains backward compatibility through endpoint aliasing for 6 months:- Legacy V3 endpoints continue to work but return V3-formatted responses
- We recommend migrating to V4 endpoints for new integrations
- Deprecated endpoints are marked in the documentation with migration guides
Support
For questions or issues with the API:- Documentation: https://integrations.docs.commenda.io
- Support Email: support@commenda.io
- API Status: https://status.commenda.io