Products API
Manage your store's products programmatically via the Ta3i API.
The Products Object
The products API allows you to create, read, update, and delete products in your store. Each product belongs to a store and can have multiple variants, images, and categories.
List All Products
/v1/productsReturns a paginated list of all products in your store.
Query Parameters
limitoptionalNumber of products per page (max 100)
10pageoptionalPage number
1statusoptionalFilter: active, draft, or all
allcategory_idoptionalFilter by category ID
searchoptionalSearch products by name
{
"data": [
{
"id": "prod_01h2x3abc",
"name": "T-Shirt Classic",
"slug": "t-shirt-classic",
"description": "A comfortable cotton t-shirt",
"price": 2500.00,
"compare_price": 3000.00,
"cost_price": 1500.00,
"sku": "TS-001",
"barcode": "1234567890123",
"stock": 150,
"track_stock": true,
"status": "active",
"is_digital": false,
"weight": 0.3,
"images": ["https://cdn.ta3i.com/prod_01h2x3abc/main.jpg"],
"categories": [
{"id": "cat_01h2x3xyz", "name": "Clothing"}
],
"variants": [
{
"id": "var_01h2x3def",
"name": "Size: Large",
"price": 2700.00,
"stock": 50,
"sku": "TS-001-L"
}
],
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-06-01T15:30:00Z"
}
],
"meta": {
"total": 45,
"page": 1,
"limit": 10,
"total_pages": 5
}
}Get a Single Product
/v1/products/:ididrequiredThe product ID (starts with prod_)
Create a Product
/v1/productsRequest Body
namerequiredProduct name
pricerequiredProduct price in DZD
descriptionoptionalProduct description
stockoptionalInitial stock quantity
0imagesoptionalArray of image URLs
[]curl -X POST https://api.ta3i.com/v1/products \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "New Product",
"price": 1500,
"description": "A great product",
"stock": 100
}'The API key must be kept secret. Never expose it in client-side code or share it publicly.
Update a Product
/v1/products/:idUpdates an existing product. Only send the fields you want to update.
Delete a Product
/v1/products/:idPermanently deletes a product. This action cannot be undone.
{
"success": true,
"message": "Product deleted successfully"
}