Brands
Managing product brands and their catalog associations
Brands
Brands group products by manufacturer or label. Each brand has a unique code and bilingual names. Products reference brands by ID.
The Brand Object
{
"id": "brand_abc123",
"brand_code": "GSK",
"organization_id": "org_abc123",
"name_en": "GlaxoSmithKline",
"name_ar": "جلاكسو سميث كلاين",
"product_count": 250,
"created": "2024-01-15T10:30:00Z",
"updated": "2024-01-16T14:22:00Z"
}Fields
| Field | Type | Description |
|---|---|---|
id | string | Internal Linkit ID |
brand_code | string | Your unique identifier |
name_en | string | Brand name in English |
name_ar | string | Brand name in Arabic |
product_count | integer | Number of products with this brand |
List Brands
GET /api/v1/brandsQuery Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
limit | integer | 20 | Items per page (max 100) |
search | string | - | Search in brand names |
has_products | boolean | - | Filter brands with/without products |
Example Request
curl -X GET "https://linkit.works/api/v1/brands?search=glaxo&limit=25" \
-H "Authorization: Bearer your_token_here"const response = await fetch(
'https://linkit.works/api/v1/brands?search=glaxo&limit=25',
{ headers: { 'Authorization': 'Bearer your_token_here' } }
);
const brands = await response.json();import requests
response = requests.get(
'https://linkit.works/api/v1/brands',
params={'search': 'glaxo', 'limit': 25},
headers={'Authorization': 'Bearer your_token_here'}
)
brands = response.json()Get Single Brand
GET /api/v1/brands/code/{brandCode}Returns the full brand object.
Create Brand
POST /api/v1/brandsRequest Body
{
"brand_code": "PFIZER",
"name_en": "Pfizer",
"name_ar": "فايزر"
}Required Fields
| Field | Type | Constraints |
|---|---|---|
brand_code | string | Max 50 chars, unique per organization |
Optional Fields
| Field | Type | Constraints |
|---|---|---|
name_en | string | Max 255 chars |
name_ar | string | Max 255 chars |
Response (201 Created)
{
"success": true,
"message": "Brand created successfully",
"data": { "id": "brand_new123", "brand_code": "PFIZER" },
"timestamp": "2024-01-15T10:30:00Z"
}Update Brand
PUT /api/v1/brands/code/{brandCode}Full replacement. Include all fields you want to keep.
Delete Brand
DELETE /api/v1/brands/code/{brandCode}| Parameter | Type | Default | Description |
|---|---|---|---|
force | boolean | false | Delete even if the brand has associated products |
Deletion behavior
By default, brands with associated products cannot be deleted. With force=true, products are unassigned from the brand (not deleted).
Bulk Operations
POST /api/v1/brands/bulkRequest Body
{
"mode": "upsert",
"brands": [
{ "brand_code": "GSK", "name_en": "GlaxoSmithKline" },
{ "brand_code": "PFIZER", "name_en": "Pfizer" }
]
}Modes: create, update, upsert.
Error Responses
409 Conflict (Duplicate Code)
{
"code": 409,
"error": "Brand with this code already exists",
"details": { "brand_code": "GSK" }
}409 Conflict (Has Products)
{
"code": 409,
"error": "Brand has associated products",
"details": { "product_count": 250, "hint": "Use force=true to delete anyway" }
}