Developer Resources

QFlow API Documentation section title

Comprehensive REST API documentation for integrating QFlow with your systems.
Build custom workflows, automate processes, and extend QFlow's capabilities.

Quick Start

1
Get API Credentials

Generate API keys from your QFlow dashboard settings

2
Make Your First Request

Test authentication and fetch your account data

3
Build Your Integration

Use our SDKs or direct API calls to build features

Security

Authentication section title

QFlow API uses API keys for authentication. Include your API key in the Authorization header.

curl https://api.qflow.io/v1/branches \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
API Reference

Core Endpoints section title

Tickets

POST /v1/tickets

Create a new ticket for a customer in the queue.

Request Body:
{
  "branch_id": 123,
  "service_id": 456,
  "customer": {
    "name": "John Doe",
    "phone": "+1234567890",
    "email": "john@example.com"
  },
  "priority": "normal",
  "metadata": {
    "source": "mobile_app"
  }
}
Response:
{
  "success": true,
  "ticket": {
    "id": 789,
    "number": "A001",
    "status": "waiting",
    "position": 3,
    "estimated_wait": "15 minutes",
    "created_at": "2024-12-28T10:30:00Z"
  }
}
GET /v1/tickets/{ticket_id}

Retrieve details of a specific ticket.

Response:
{
  "success": true,
  "ticket": {
    "id": 789,
    "number": "A001",
    "status": "serving",
    "counter": 5,
    "service": {
      "id": 456,
      "name": "Account Opening"
    },
    "customer": {
      "name": "John Doe",
      "phone": "+1234567890"
    },
    "created_at": "2024-12-28T10:30:00Z",
    "called_at": "2024-12-28T10:45:00Z"
  }
}
PUT /v1/tickets/{ticket_id}/status

Update ticket status (call, serve, complete, cancel).

Request Body:
{
  "status": "completed",
  "counter_id": 5,
  "notes": "Service completed successfully"
}

Queues

GET /v1/branches/{branch_id}/queues

Get real-time queue status for a branch.

Response:
{
  "success": true,
  "queues": [
    {
      "service_id": 456,
      "service_name": "Account Opening",
      "total_waiting": 12,
      "average_wait_time": "18 minutes",
      "tickets_served_today": 45,
      "active_counters": 3
    },
    {
      "service_id": 457,
      "service_name": "Teller Services",
      "total_waiting": 8,
      "average_wait_time": "10 minutes",
      "tickets_served_today": 128,
      "active_counters": 5
    }
  ]
}

Analytics

GET /v1/analytics/performance

Retrieve performance metrics for specified date range.

Query Parameters:
Parameter Type Required Description
branch_id integer No Filter by specific branch (omit for all branches)
start_date date Yes Start date (YYYY-MM-DD)
end_date date Yes End date (YYYY-MM-DD)
Response:
{
  "success": true,
  "metrics": {
    "total_tickets": 1250,
    "average_wait_time": "12.5 minutes",
    "average_service_time": "8.2 minutes",
    "customer_satisfaction": 4.3,
    "peak_hours": ["10:00-11:00", "14:00-15:00"],
    "busiest_day": "Monday"
  }
}
Real-Time Events

Webhooks section title

Receive real-time notifications for important events in your QFlow system.

Available Webhook Events
Event Description Payload
ticket.created Fired when a new ticket is generated Ticket object with customer data
ticket.called Fired when a ticket is called to counter Ticket ID, counter ID, timestamp
ticket.serving Fired when service begins Ticket ID, staff member ID
ticket.completed Fired when service is completed Ticket ID, service duration, rating
ticket.cancelled Fired when ticket is cancelled Ticket ID, reason, timestamp
queue.sla_violation Fired when SLA threshold exceeded Queue ID, current wait time, threshold
Example Webhook Payload
{
  "event": "ticket.created",
  "timestamp": "2024-12-28T10:30:00Z",
  "data": {
    "ticket": {
      "id": 789,
      "number": "A001",
      "branch_id": 123,
      "service_id": 456,
      "customer": {
        "name": "John Doe",
        "phone": "+1234567890"
      },
      "status": "waiting",
      "position": 3,
      "estimated_wait": "15 minutes"
    }
  }
}
Developer Tools

SDKs & Libraries section title

Official SDKs to accelerate your integration development.

PHP SDK

Laravel-compatible PHP library with full API coverage

Contact us for SDK access
Python SDK

Type-hinted Python library for Django and Flask

Contact us for SDK access
Node.js SDK

JavaScript/TypeScript SDK for Node.js and Express

Contact us for SDK access
Ruby SDK

Ruby gem for Rails applications and microservices

Contact us for SDK access
Rate Limits
  • Standard: 1,000 requests/hour
  • Premium: 5,000 requests/hour
  • Enterprise: Custom limits
  • Rate limit headers included in responses
Best Practices
  • Use webhooks instead of polling
  • Implement exponential backoff for retries
  • Cache responses when appropriate
  • Use API versioning for stability

Need Help with Integration?

Our developer support team is here to help you succeed with your QFlow integration.