Back to site

Admin API রেফারেন্স

আমাদের শক্তিশালী Admin REST API দিয়ে আপনার স্টোর পরিচালনা করুন।

📋 Base URL

https://api.iws-commerce.com/v1

অথেনটিকেশন

আপনার Authorization হেডারে API কী অন্তর্ভুক্ত করে রিকোয়েস্ট অথেনটিকেট করুন।

Authorization: Bearer YOUR_API_KEY

You can generate API keys from your dashboard under Settings → API Keys.

Products API

List All Products

Retrieve a paginated list of all products in your store.

GET /products

Query Parameters

ParameterTypeDescription
page integer Page number (default: 1)
limit integer Items per page (default: 50, max: 250)
status string Filter by status: active, draft, archived

উদাহরণ রিকোয়েস্ট

curl -X GET "https://api.iws-commerce.com/v1/products?page=1&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"

উদাহরণ রেসপন্স

{
  "data": [
    {
      "id": "prod_123abc",
      "title": "Organic Cotton T-Shirt",
      "description": "Comfortable and sustainable",
      "price": 2500,
      "currency": "BDT",
      "status": "active",
      "inventory": {
        "quantity": 150,
        "sku": "TSHIRT-ORG-001"
      },
      "images": [
        {
          "url": "https://cdn.iws-commerce.com/products/tshirt-001.jpg",
          "alt": "Organic Cotton T-Shirt"
        }
      ],
      "created_at": "2023-12-01T10:30:00Z",
      "updated_at": "2023-12-05T14:20:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 245,
    "pages": 25
  }
}

Create a Product

Add a new product to your store.

POST /products

উদাহরণ রিকোয়েস্ট

curl -X POST "https://api.iws-commerce.com/v1/products" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Eco-Friendly Water Bottle",
    "description": "Reusable stainless steel water bottle",
    "price": 2500,
    "currency": "BDT",
    "inventory": {
      "quantity": 100,
      "sku": "BOTTLE-ECO-001"
    }
  }'

Orders API

List All Orders

Retrieve all orders from your store.

GET /orders

উদাহরণ রেসপন্স

{
  "data": [
    {
      "id": "order_456def",
      "order_number": "IWS-1001",
      "customer": {
        "id": "cust_789ghi",
        "email": "customer@example.com",
        "name": "John Doe"
      },
      "items": [
        {
          "product_id": "prod_123abc",
          "title": "Organic Cotton T-Shirt",
          "quantity": 2,
          "price": 2500
        }
      ],
      "subtotal": 5000,
      "tax": 500,
      "shipping": 100,
      "total": 5600,
      "status": "processing",
      "payment_status": "paid",
      "created_at": "2023-12-07T09:15:00Z"
    }
  ]
}

রেট লিমিটিং

প্ল্যাটফর্মের স্থায়িত্ব নিশ্চিত করতে আমাদের API-তে রেট লিমিট রয়েছে।

X-RateLimit-Limit Total requests allowed per hour
X-RateLimit-Remaining Requests remaining in current window
X-RateLimit-Reset Time when the rate limit resets (Unix timestamp)

এরর হ্যান্ডলিং

সফলতা বা ব্যর্থতা নির্দেশ করতে API স্ট্যান্ডার্ড HTTP স্ট্যাটাস কোড ব্যবহার করে।

{
  "error": {
    "code": "invalid_request",
    "message": "The 'price' field is required",
    "details": {
      "field": "price",
      "type": "required"
    }
  }
}

⚠️ নিরাপত্তা সতর্কতা

আপনার Admin API কী কখনো শেয়ার করবেন না বা ক্লায়েন্ট-সাইড কোডে ব্যবহার করবেন না।