Skip to main content

Dukaan Public APIs

This document outlines all the necessary details to interact with your store APIs

🔖 How to get your store API token

  1. 1 Visit web.mydukaan.io and select the settings tab
  2. 2 Click on developer settings, you will find an option to generate a store authentication token
  3. 3 Click on generate an authentication token

Available Functionality

You will be able to find detailed documentation for the following Dukaan functionalities:

Orders
Customers
Products
Search
Discounts
Modifications

Important Keys

Store UUID

Each store for a seller will have a unique id which is required for certain endpoints to get store specific data, as a single seller can have multiple stores.

Authorization Token

Format: Bearer {store_authentication_token}

Product UUID

Required for product-related operations. Can be obtained from product listing or search endpoints.

For more detailed information about specific endpoints and their usage, please refer to the respective sections in the documentation.

Authentication

Store authentication token is required for accessing the Dukaan API endpoints

Important Keys

Store UUID

Each store for a seller will have a unique id which is required for certain endpoints to get store specific data, as a single seller can have multiple stores, making this key mandatory

Authorization Token

Bearer {store_authentication_token}

Product UUID

Required for product-related operations, can be obtained from product listing or search endpoints

Token Generation Steps

1

Visit web.mydukaan.io and select the settings tab

2

Navigate to developer settings

3

Click on generate an authentication token

Example Authentication Header

headers: {
  'authorization': 'Bearer {store_authentication_token}',
  'authority': 'api.mydukaan.io'
}

Make sure to keep your authentication token secure and never expose it in client-side code.

Products API

All APIs related to Products and related product operations can be found under this collection.

GET /product-list

Retrieve a list of products for a specific seller with support for ordering, pagination, and field selection.

Endpoint

https://api.mydukaan.io/api/seller-front//product-list/

Query Parameters

Key Accepted Value
page value of the page
ordering created_at, modified_at
page_size 1-99 (max 99 results per page)
pop_fields variants_data

Example Request

curl --location -g 'https://api.mydukaan.io/api/seller-front//product-list/?ordering=-created_at&page=1&page_size=30&pop_fields=variants_data' \
--header 'authority: api.mydukaan.io' \
--header 'authorization: Bearer 

      
      

      
      
   
      

Example Response

{
  "status_code": 200,
  "count": 255,
  "results": [
    {
      "id": 42933263,
      "uuid": "05ad8798-2ee0-410a-a42f-91fe3e001c57",
      "name": "Product Name",
      "image": "product_image_url",
      "in_stock": true,
      "selling_price": 2600,
      ...
    }
  ]
}

The product UUID is required for product-related operations and can be obtained from the product listing or search endpoints.

Categories API

Access and manage product categories through the Dukaan API.

GET /categories

Retrieve a list of categories available in the store.

Endpoint

GET https://api.mydukaan.io/api/seller-front//categories/

Headers

Key Value
authority api.mydukaan.io
authorization Bearer {store_authentication_token}

Example Response

{
  "status_code": 200,
  "results": [
    {
      "id": 12355144,
      "name": "Accessory",
      "slug": "accessory",
      "uuid": "9d1cf4d3-556f-4f1d-82e5-2869616402ff",
      "image": "https://example.com/image.jpg",
      "in_stock": true,
      "position": 100000
    }
  ]
}

GET /categories/{category_uuid}

Retrieve details for a specific category using its UUID.

Path Parameters

Parameter Description
category_uuid Unique identifier for the category

Category UUIDs are required for category-specific operations. You can obtain them from the categories list endpoint.

Orders API Documentation

Access and manage orders through Dukaan's robust Orders API endpoints.

Authentication

Authorization: Bearer {your_store_token}

Required for all API calls. Generate from store settings.

Order Status Codes

Status Code
ABANDONED / DRAFT -1
PENDING 0
ACCEPTED 1
REJECTED 2
SHIPPED 3
CANCELLED 4
DELIVERED 5
FAILED 6
CANCELLED BY CUSTOMER 7
RETURNED 10

Important Keys

Store UUID

Unique identifier for each store. Required for store-specific operations.

Order UUID

Unique identifier for each order. Used for order-specific operations.

Customer UUID

Unique identifier for each customer. Used for customer-specific operations.

Discounts API Documentation

Manage product and store-wide discounts through Dukaan's Discounts API endpoints.

Authentication Requirements

Authorization: Bearer {store_authentication_token}

Required for all discount-related API calls

Required Parameters

Store UUID

Unique identifier for the store where discount will be applied

Discount Type

Percentage or Fixed amount

Discount Value

Amount or percentage of discount to be applied

Optional Parameters

Minimum Purchase Amount

Minimum cart value required for discount

Maximum Discount Amount

Cap on maximum discount value

Valid From

Start date and time for discount

Valid Until

End date and time for discount

Example Request

curl --location -g 'https://api.mydukaan.io/api/seller-front//discounts/create' \
--header 'authorization: Bearer 

      
      

      
      
   
 \
--header 'Content-Type: application/json' \
--data '{
    "discount_type": "percentage",
    "discount_value": 10,
    "min_purchase_amount": 1000,
    "max_discount_amount": 200
}'
            

Audience API Documentation

Access and manage customer data through Dukaan's Audience API endpoints.

Customer Data Endpoints

GET /api/seller-front//customers

Retrieve list of customers for your store

GET /api/seller-front//customers/

Get details for a specific customer

Authentication Requirements

Headers:
authorization: Bearer {store_authentication_token}
Content-Type: application/json
            

Query Parameters

Parameter Type Description
page integer Page number for pagination
page_size integer Number of results per page (max: 100)
search string Search customers by name or email

Response Format

{
  "status_code": 200,
  "count": integer,
  "results": [
    {
      "uuid": "string",
      "name": "string",
      "email": "string",
      "phone": "string",
      "created_at": "datetime",
      "total_orders": integer,
      "total_spent": number
    }
  ]
}
            

Example Request

curl --location -g 'https://api.mydukaan.io/api/seller-front//customers?page=1&page_size=30' \
--header 'authorization: Bearer 

      
      

      
      
   
 \
--header 'Content-Type: application/json'
            

Inventory API Documentation

Manage product inventory through Dukaan's Inventory API endpoints.

Base Endpoint

https://api.mydukaan.io/api/seller-front//inventory/

Required Headers

authorization: Bearer {store_authentication_token}
Content-Type: application/json
            

Available Endpoints

GET /inventory/status

Get inventory status for all products

PATCH /inventory/update

Update inventory quantities for specified products

GET /inventory/low-stock

Get list of products with low stock

Query Parameters

Parameter Type Description Required
product_uuid string Unique identifier for the product Yes
quantity integer New inventory quantity Yes (for update)
threshold integer Low stock threshold value No

Example Requests

Update Inventory

curl --location -g 'https://api.mydukaan.io/api/seller-front//inventory/update' \
--header 'authorization: Bearer 

      
      

      
      
   
 \
--header 'Content-Type: application/json' \
--data '{
    "product_uuid": "product_uuid",
    "quantity": 100
}'
              

Response Format

{
  "status_code": 200,
  "message": "Success",
  "data": {
    "product_uuid": "string",
    "inventory_quantity": integer,
    "updated_at": "datetime"
  }
}
            

API Reference

Complete reference for all Dukaan APIs

Base URL

https://api.mydukaan.io/api/seller-front/

Authentication

Store Token

Authorization: Bearer {store_authentication_token}

Store UUID

/api/seller-front/{store_uuid}/

Available Endpoints

Endpoint Method Description
/product-list/ GET Get list of products
/orders/ GET Get orders list
/categories/ GET Get categories list
/inventory/ GET Get inventory status

Common Parameters

Parameter Type Description Required
page integer Page number No
page_size integer Results per page No
ordering string Sort order No

Response Format

{
  "status_code": 200,
  "count": integer,
  "results": [
    {
      "id": integer,
      "uuid": "string",
      "name": "string",
      ...
    }
  ]
}