Daftra API
DocsAll EndpointsDaftra Partners
DocsAll EndpointsDaftra Partners
  1. API v2 Endpoints
  • Welcome
  • Getting Started
  • Authorization
  • Validation Errors
  • API v1 Endpoints
    • Auth
      • Generate Access Token
    • Invoices
      • GET All Invoices
      • GET Single Invoice
      • Edit Invoices
      • Delete Invoices
      • Add New Invoice
    • Estimates
      • GET All Estimates
      • GET Single Estimate
      • Edit Estimates
      • Delete Estimates
      • Add New Estimate
    • Credit Notes
      • GET All Credit Notes
      • GET Single Credit Note
      • Edit Credit Notes
      • Delete Credit Notes
      • Add New Credit Note
    • Refund Receipts
      • GET All Refund Receipts
      • GET Single Refund Receipt
      • Edit Refund Receipts
      • Delete Refund Receipts
      • Add New Refund Receipt
    • Clients
      • GET All Clients
      • GET Single Client
      • Edit Clients
      • Delete Clients
      • Add New Client
    • Suppliers
      • GET All Suppliers
      • GET Single Supplier
      • Edit Suppliers
      • Delete Suppliers
      • Add New Supplier
    • Work Orders
      • GET Single Work Order
      • Edit Work Orders
      • Delete Work Orders
      • GET All Work Orders
      • Add New Work Order
    • Client Appointments
      • GET All Client Appointments
      • GET Single Client Appointment
      • Edit Client Appointments
      • Delete Client Appointments
      • Add New Client Appointment
    • Invoice Appointments
      • GET All Invoice Appointments
      • GET Single Invoice Appointment
      • Edit Invoice Appointments
      • Delete Invoice Appointments
      • Add New Invoice Appointment
    • Estimate Appointments
      • GET All Estimate Appointments
      • GET Single Estimate Appointment
      • Edit Estimate Appointments
      • Delete Estimate Appointments
      • Add New Estimate Appointment
    • Work Order Appointments
      • GET All Work Order Appointments
      • GET Single Work Order Appointment
      • Edit Work Order Appointments
      • Delete Work Order Appointments
      • Add New Work Order Appointment
    • Notes
      • GET All Notes
      • GET Single Note
      • Edit Notes
      • Delete Notes
      • Add New Note
    • Time Tracking
      • GET All Time Tracking
      • GET Single Time Tracking
      • Edit Time Tracking
      • Delete Time Tracking
      • Add New Time Tracking
    • Invoice Payments
      • GET All Invoice Payments
      • GET Single Invoice Payment
      • Edit Invoice Payments
      • Delete Invoice Payments
      • Add New Invoice Payment
    • Client Payments
      • GET All Client Payments
      • GET Single Client Payment
      • Edit Client Payments
      • Delete Client Payments
      • Add New Client Payment
    • Products
      • GET All Products
      • GET Single Product
      • Edit Products
      • Delete Products
      • Add New Product
    • Journals
      • GET All Journals
      • GET Single Journal
      • Edit Journals
      • Delete Journals
      • Add New Journal
    • Journal Accounts
      • GET All Journal Accounts
      • GET Single Journal Account
      • Edit Journal Accounts
      • Delete Journal Accounts
      • Add New Journal Account
    • Journal Cats
      • GET All Journal Cats
      • GET Single Journal Cat
      • Edit Journal Cats
      • Delete Journal Cats
      • Add New Journal Cat
    • Expenses
      • GET All Expenses
      • GET Single Expens
      • Edit Expenses
      • Delete Expenses
      • Add New Expens
    • Incomes
      • GET All Incomes
      • GET Single Income
      • Edit Incomes
      • Delete Incomes
      • Add New Income
    • Taxes
      • GET All Taxes
      • GET Single Taxe
      • Edit Taxes
      • Delete Taxes
      • Add New Taxe
    • Purchase Invoices
      • GET All Purchase Invoices
      • GET Single Purchase Invoice
      • Edit Purchase Invoices
      • Delete Purchase Invoices
      • Add New Purchase Invoice
    • Purchase Refunds
      • GET All Purchase Refunds
      • GET Single Purchase Refund
      • Edit Purchase Refunds
      • Delete Purchase Refunds
      • Add New Purchase Refund
    • Stock Transactions
      • GET All Stock Transactions
      • GET Single Stock Transaction
      • Edit Stock Transactions
      • Delete Stock Transactions
      • Add New Stock Transaction
    • Stores
      • GET All Stores
      • GET Single Store
      • Edit Stores
      • Delete Stores
      • Add New Store
    • Treasuries
      • GET All Treasuries
      • GET Single Treasury
      • Edit Treasuries
      • Delete Treasuries
      • Add New Treasury
    • Product Categories
      • GET All Product Categories
      • GET Single Product Category
    • Staff
      • GET All Staff
      • GET Single Staff
    • Client-attendance-log
      • Add New Client-attendance-log
    • Follow Up Actions
      • GET All Follow Up Actions
      • GET Single Follow Up Action
      • Delete Follow Up Action
    • Follow Up Statuses
      • GET All Follow Up Statuses
      • GET Single Follow Up Status
      • Delete Follow Up Status
    • General Listing
      • GET General Listing
    • Site
      • GET Site Info
    • Requsitions
      • GET All Requisitions
      • GET single Requisition
      • Edit Requisitions
      • Delete Requisitions
      • Add New Requisition
    • Purchase Debit Note
      • Purchase Debit Note
      • Purchase Debit Note
    • Product Bundles
      • Add Product bundle
  • API v2 Endpoints
    • API v2
    • Filtering
    • How to Use v2
    • API v2
      GET
  1. API v2 Endpoints

API v2

Welcome to Daftra API V2, the next-generation API designed for enhanced flexibility, precision, and control over your business data. This upgraded version introduces advanced filtering capabilities, multi-level data access, and optimized performance for modern integrations.

What's New in V2#

Discover the key improvements that make API V2 more powerful, scalable, and data-rich than ever before.
Enhanced Data Retrieval for accessing richer, more detailed, and relational information across entities.
Advanced filtering system with dynamic query capabilities
Multi-level data access (up to 4 levels of related data)
Expanded data scope with comprehensive record relationships
Better data structuring to reduce API calls

Base URL#

Understand how to access the API and securely authenticate each request.
Base URL: https://your-domain.daftra.com/v2/api
For more details on how to authenticate your API requests, please refer to the Authentication guide.

Core Endpoints Structure#

Learn how to list, fetch, and explore core entities using consistent URL patterns.

List Entities#

Retrieve lists of records with a specified level of detail:

Get Single Entity#

Fetch a specific record by its ID with level-based detail:

Common Entities#

Explore the most commonly used entities, their endpoints, and supported levels.
EntityEntity NameLevelsDescription
Invoices/invoice1-4Sales invoices with items, clients, payments
Clients/client1-3Customer records with contacts, addresses
Products/product1-3Product catalog with categories, pricing
Orders/sales_order1-4Sales orders with items and fulfillment
Payments/invoice_payment1-3Payment records with invoices, methods
Expenses/expense1-3Expense tracking with categories, receipts
Quotes/estimate1-4Price quotes with items, conversions

Multi-Level Data Access#

Daftra V2 introduces a 4-level tiered data structure allowing you to control the depth of related data in your responses.

Level Structure#

Understand what each level of data includes and when to use it.
LevelDescriptionUse Case
Level 1Basic entity data onlyQuick listings, minimal data
Level 2+ Directly related dataStandard operations
Level 3+ Nested relationshipsDetailed views
Level 4+ Deep context & connectionsFull data analysis

Examples#

Pagination & Sorting#

Manage large datasets with page-based navigation and sorting options.

Pagination Parameters#

Sorting#

Response with Pagination#

{
  "data": [...],
  "meta": {
    "current_page": 1,
    "total": 250,
    "last_page": 5,
    "from": 1,
    "to": 50
  },
  "links": {
    "first": "/.../list/2?page=1",
    "last": "/.../list/2?page=5",
    "prev": null,
    "next": "/.../list/2?page=2"
  }
}

Performance Best Practices#

1. Choose Appropriate Levels#

Use Level 1 for listings and quick data
Use Level 3-4 only when you need the related data
Higher levels = more processing time

2. Pagination#

Always use pagination for large datasets
Use total count to determine if more pages exist

Previous
Add Product bundle
Next
Filtering