Modern eCommerce marketplaces require seamless communication between applications, mobile apps, external systems, and third-party services. This is where the Dokan REST API becomes extremely powerful.
Using the Dokan REST API, developers can:
- Create mobile marketplace apps
- Sync products automatically
- Manage vendors remotely
- Build custom dashboards
- Connect external platforms
- Automate marketplace operations
In this complete guide, you’ll learn how to integrate and use the Dokan REST API with WooCommerce and WordPress.
What is the Dokan REST API?
The Dokan REST API allows developers to communicate with marketplace data programmatically using HTTP requests.
You can:
- Create vendors
- Manage products
- Retrieve orders
- Update store information
- Access marketplace data remotely
The API uses JSON responses, making it ideal for:
- Mobile apps
- React frontends
- Vue applications
- Flutter apps
- External ERP systems
- Inventory management systems
Why Use Dokan REST API?
Key Benefits
Marketplace Automation
Automate repetitive marketplace tasks.
Mobile App Development
Build Android and iOS marketplace apps.
Third-Party Integrations
Connect:
- ERP systems
- CRM software
- Shipping providers
- Payment gateways
Custom Dashboard Development
Create advanced admin or vendor dashboards.
Dokan REST API Requirements
Before using the API, you need:
- WordPress installed
- WooCommerce activated
- Dokan installed
- REST API enabled
- API keys generated
Enable WooCommerce REST API
To enable the API:
Steps
- Go to:
WooCommerce → Settings → Advanced → REST API
- Click:
Add Key
- Enter:
- Description
- User permissions
- Read/Write access
- Generate API keys.
You’ll receive:
- Consumer Key
- Consumer Secret
These keys are required for API authentication.
Dokan REST API Base Endpoint
Example API endpoint:
https://yourwebsite.com/wp-json/dokan/v1/
Common endpoints include:
- Vendors
- Products
- Orders
- Withdrawals
- Store settings
Authentication Methods
1. Consumer Key & Secret
Most WooCommerce and Dokan APIs use:
- Consumer Key
- Consumer Secret
Example request:
https://yourwebsite.com/wp-json/dokan/v1/stores
2. JWT Authentication
JWT authentication is commonly used for mobile apps and headless applications.
Benefits:
- Secure authentication
- Token-based access
- Better mobile integration
Popular plugin:
- JWT Authentication for WP REST API
Fetch Vendor Stores Using API
Example request:
GET /wp-json/dokan/v1/stores
Example response:
[
{
"id": 1,
"store_name": "Demo Vendor",
"phone": "1234567890"
}
]
This endpoint retrieves marketplace vendor data.
Create Products Using REST API
Example product creation request:
POST /wp-json/wc/v3/products
Example payload:
{
"name": "Premium Hoodie",
"type": "simple",
"regular_price": "49",
"description": "Comfortable cotton hoodie"
}
This allows external applications to create WooCommerce products dynamically.
Assign Products to Vendors
You can assign products to vendors using vendor IDs.
Example:
{
"post_author": 15
}
This links the product to a specific Dokan vendor.
Retrieve Vendor Orders
Example request:
GET /wp-json/dokan/v1/orders
This helps vendors:
- View orders
- Manage fulfillment
- Update order status
- Track sales
Custom REST API Endpoints
You can create custom API endpoints using WordPress REST API functions.
Example:
add_action( 'rest_api_init', function () {
register_rest_route( 'custom/v1', '/vendor-products/', array(
'methods' => 'GET',
'callback' => 'custom_vendor_products'
) );
} );
Custom endpoints provide flexibility for advanced marketplace functionality.
Using Dokan API with Mobile Apps
The Dokan REST API is widely used for:
- Android apps
- iOS apps
- Flutter marketplaces
- React Native apps
Popular frontend technologies:
- React
- Vue.js
- Flutter
API Security Best Practices
Use HTTPS
Always secure API requests using SSL certificates.
Restrict API Permissions
Provide only necessary access levels.
Use Authentication Tokens
Avoid exposing API credentials publicly.
Implement Rate Limiting
Protect APIs from abuse and spam requests.
Performance Optimization for APIs
Large marketplaces may process thousands of API requests daily.
Optimization Tips
Use Object Caching
Improve database performance.
Optimize Hosting
Use high-performance hosting providers.
Use CDN Services
Reduce latency for global users.
Minimize API Calls
Cache responses whenever possible.
Recommended plugins:
- LiteSpeed Cache
- Redis Object Cache
Common Dokan API Use Cases
Marketplace Mobile Apps
Allow vendors and customers to manage stores through apps.
Inventory Synchronization
Sync stock from external systems.
Shipping Automation
Connect APIs with shipping providers.
Vendor Analytics Dashboards
Create custom sales dashboards using API data.
CRM & ERP Integration
Integrate with business management software.
Common REST API Mistakes
Exposing API Keys Publicly
Never hardcode credentials inside frontend code.
No Authentication Protection
Always secure sensitive endpoints.
Excessive API Requests
Too many requests can slow down servers.
Ignoring Caching
Caching significantly improves API performance.
Final Thoughts
The Dokan REST API provides developers with powerful tools for building scalable, automated, and highly customizable marketplace solutions.
By integrating the Dokan API with:
- Mobile apps
- Custom dashboards
- Third-party systems
- ERP platforms
- Shipping providers
- Headless frontends
you can create modern marketplace experiences that go far beyond traditional WordPress functionality.
Whether you are developing a marketplace mobile app, custom vendor dashboard, or advanced automation system, mastering Dokan REST API integration is an essential skill for modern WooCommerce marketplace development.