Dukene API Documentation
Integrate your platform with Dukene to sync products, manage inventory, and receive real-time M-Pesa & WhatsApp order updates.
Overview
The Dukene Supplier API lets external suppliers and merchants sync catalog data, manage live inventory, and automate fulfillment inside the Kenyan commerce ecosystem.
RESTful API
Standard HTTP methods with predictable JSON payloads.
OAuth 2.0
Secure authorization with granular access tokens.
Real-time Webhooks
Instant notifications for M-Pesa payments and orders.
https://api.dukene.co.ke/api/v1Authentication
All API requests must be authenticated using OAuth 2.0 access tokens passed in the authorization header.
Authorization: Bearer YOUR_ACCESS_TOKEN
X-Supplier-ID: your-supplier-id
Content-Type: application/jsonSecurity Note: Never expose access tokens or client secrets in client-side code or public repositories.
OAuth 2.0 Flow
Dukene uses the authorization code flow to securely grant access to merchant stores.
Step 1: Authorization URL
GET https://your-platform.com/oauth/authorize?
client_id=DUKENE_CLIENT_ID
&redirect_uri=https://api.dukene.co.ke/api/v1/oauth/callback
&state=RANDOM_STATE_STRING
&scope=products.read products.write orders.read inventory.write
&response_type=codeStep 2: Exchange Code for Token
POST https://your-platform.com/oauth/token
Content-Type: application/json
{
"grant_type": "authorization_code",
"code": "AUTHORIZATION_CODE",
"client_id": "DUKENE_CLIENT_ID",
"client_secret": "DUKENE_CLIENT_SECRET",
"redirect_uri": "https://api.dukene.co.ke/api/v1/oauth/callback"
}Available Scopes
API Endpoints
/productsFetch products and catalog data from Dukene.
/ordersCreate a new order or submit fulfillment updates.
/inventory/:idUpdate stock counts and variant availability.
Webhooks
Dukene sends event notifications to your server whenever important actions occur (e.g., M-Pesa confirmation).
{
"event": "order.created",
"order_id": "ord_12345",
"store_id": "store_67890",
"total": 2499,
"currency": "KES"
}Pro Tip: Validate webhook signatures using your client secret before processing payloads.
Best Practices
Ready to integrate?
Start with authentication, then connect your catalog and webhook endpoint.