Skip to main content
POST
/
api
/
products
/
create
{
  "product_id": "<string>"
}

Overview

Create a new product in your store using API key authentication. Perfect for bulk imports or automated product creation from your inventory system.
Rate Limit: 20 requests per minute

Endpoint

POST https://api.tribemade.in/api/products/create

Authentication

X-API-Key
string
required
Your TribeMade API key (format: tb-xxxx-xxx-xxxx)

Request Body

Required Fields

name
string
required
Product name (3-30 characters)
price
number
required
Original/MRP price in INR (must be > 0)
description
string
required
Detailed product description (0-500 characters)
stock
integer
required
Available quantity (must be >= 0)

Optional Fields

current_price
number
default:"price"
Sale price in INR (must be >= 0). Defaults to the original price if not provided.
short_description
string
default:"First 100 chars of description"
Short description for listings (0-50 characters)
shipping_cost
number
default:0
Shipping cost in INR (must be >= 0)
primary_image
string
Primary product image URL or base64 encoded image (max 5MB)
images
array
Additional product images (max 10 images, each max 5MB)
variations
array
Product variations (max 20 items). Example: [“Regular Fit”, “Slim Fit”]
size
array
Available sizes (max 20 items). Example: [“S”, “M”, “L”, “XL”]
colors
array
Available colors (max 20 items). Example: [“White”, “Black”, “Navy Blue”]
categories
array
Product categories (max 20, must exist in your store). Create categories in your dashboard first.
is_sale
boolean
default:false
Mark product as on sale
is_active
boolean
default:true
Product visibility to customers
custom_questions
array
Custom questions for customers (max 5 questions). Each question must have:
  • question: Question text (1-200 characters)
  • type: Either “text” or “image”
internal_note
string
default:""
Private seller-only notes (0-500 characters). Not visible to customers.
metadata
object
Custom key-value pairs for additional product information

Response

product_id
string
UUID of the newly created product

Examples

Minimal Example

Create a basic product with only required fields:
curl -X POST https://api.tribemade.in/api/products/create \
  -H "X-API-Key: tb-a1b2-c3d-e4f5" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Simple T-Shirt",
    "price": 499,
    "description": "Basic cotton t-shirt",
    "stock": 50
  }'

Success Response

{
  "product_id": "660e8400-e29b-41d4-a716-446655440123"
}

Full Example with All Options

Create a product with all available fields:
{
  "name": "Premium Cotton T-Shirt",
  "price": 1299,
  "current_price": 999,
  "description": "High-quality 100% cotton t-shirt with premium finish and comfortable fit",
  "short_description": "Premium cotton tee",
  "stock": 100,
  "shipping_cost": 50,
  "primary_image": "https://cdn.example.com/tshirt.jpg",
  "images": [
    "https://cdn.example.com/tshirt-2.jpg",
    "https://cdn.example.com/tshirt-3.jpg"
  ],
  "variations": ["Regular Fit", "Slim Fit"],
  "size": ["S", "M", "L", "XL", "XXL"],
  "colors": ["White", "Black", "Navy Blue"],
  "categories": ["Fashion", "Men's Wear"],
  "is_sale": true,
  "is_active": true,
  "custom_questions": [
    {
      "question": "Do you want your name printed?",
      "type": "text"
    },
    {
      "question": "Upload your design",
      "type": "image"
    }
  ],
  "internal_note": "Supplier: ABC Corp, Cost: ₹500, MOQ: 50, Lead time: 3 days",
  "metadata": {
    "material": "100% Cotton",
    "care": "Machine wash cold",
    "origin": "India"
  }
}

Error Responses

400 Bad Request - Missing Required Fields

{
  "error": "name, price, description, and stock are required"
}

400 Bad Request - Invalid Name Length

{
  "error": "Name must be between 3 and 30 characters"
}

400 Bad Request - Invalid Price

{
  "error": "price must be > 0"
}

400 Bad Request - Invalid Description

{
  "error": "Description must be between 0 and 500 characters"
}

400 Bad Request - Invalid Stock

{
  "error": "stock must be >= 0"
}

400 Bad Request - Invalid Short Description

{
  "error": "short_description must be between 0 and 50 characters"
}

400 Bad Request - Invalid Categories

{
  "error": "All categories must be in store categories",
  "invalid": ["InvalidCategory"]
}
Categories must be created in your store first via the Dashboard. Use exact category names (case-sensitive).

400 Bad Request - Too Many Images

{
  "error": "Maximum 10 images allowed"
}

400 Bad Request - Image Too Large

{
  "error": "Primary image base64 size must be <= 5MB"
}

400 Bad Request - Too Many Array Items

{
  "error": "variations cannot have more than 20 items"
}
This error also applies to: size, colors, categories arrays (max 20 items each)

400 Bad Request - Too Many Custom Questions

{
  "error": "Maximum 5 custom questions allowed"
}

400 Bad Request - Invalid Custom Question Type

{
  "error": "custom_questions[0].type must be 'text' or 'image'"
}

401 Unauthorized

{
  "error": "Missing API key"
}
or
{
  "error": "Invalid API key"
}

429 Too Many Requests

{
  "error": "Rate limit exceeded",
  "retry_after": 60
}

Custom Questions

Custom questions allow you to collect additional information from customers during checkout.

Question Format

{
  "question": "Your question text here (1-200 characters)",
  "type": "text"  // or "image"
}

Question Types

TypeDescriptionCustomer Input
textText questionCustomer provides text answer
imageImage uploadCustomer uploads an image

Examples

{
  "custom_questions": [
    {
      "question": "Do you want your name printed?",
      "type": "text"
    },
    {
      "question": "Upload your design for customization",
      "type": "image"
    },
    {
      "question": "Any special instructions?",
      "type": "text"
    }
  ]
}

Internal Notes

Use internal_note to store private information visible only to you:
{
  "internal_note": "Supplier: ABC Corp, Cost: ₹500, MOQ: 50, Lead time: 3 days, Contact: [email protected]"
}
Common uses:
  • Supplier information
  • Cost price and margins
  • Minimum order quantities
  • Lead times
  • Internal SKU codes
  • Warehouse locations
Internal notes are never shown to customers - they’re only visible in your dashboard and API responses.

Bulk Import Example

Import multiple products efficiently:
import requests
import time

url = "https://api.tribemade.in/api/products/create"
headers = {
    "X-API-Key": "tb-a1b2-c3d-e4f5",
    "Content-Type": "application/json"
}

products = [
    {
        "name": "Product 1",
        "price": 499,
        "description": "Description 1",
        "stock": 50
    },
    {
        "name": "Product 2",
        "price": 699,
        "description": "Description 2",
        "stock": 30
    },
    # ... more products
]

# Import in batches to respect rate limits (20 req/min)
batch_size = 15
for i in range(0, len(products), batch_size):
    batch = products[i:i + batch_size]
    
    for product in batch:
        try:
            response = requests.post(url, headers=headers, json=product)
            if response.status_code == 201:
                result = response.json()
                print(f"Created: {product['name']} -> {result['product_id']}")
            else:
                print(f"Failed: {product['name']} -> {response.json()['error']}")
        except Exception as e:
            print(f"Error: {product['name']} -> {str(e)}")
    
    # Wait before next batch to avoid rate limit
    if i + batch_size < len(products):
        print(f"Batch complete. Waiting 60s...")
        time.sleep(60)

print("Import complete!")

Best Practices

Validate all fields client-side before making API requests to reduce errors:
  • Check name length (3-30 characters)
  • Ensure price > 0
  • Verify categories exist in your store
  • Confirm image sizes ≤ 5MB
Instead of base64-encoding images, host them on a CDN and provide URLs:✅ Recommended:
{
  "primary_image": "https://cdn.example.com/product.jpg"
}
❌ Less efficient:
{
  "primary_image": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
}
Maximum limits for arrays:
  • Images: 10
  • Variations, sizes, colors, categories: 20 each
  • Custom questions: 5
  • Maximum 20 requests per minute
  • For bulk imports, batch requests with 60-second pauses
  • See Rate Limits for details
Store useful internal information:
  • Supplier details and contact info
  • Cost price and profit margins
  • SKU codes and barcodes
  • Warehouse locations
  • Reorder information

Next Steps