Skip to content

REST API Reference

MicroPIM provides a RESTful API for integrating with external systems, importing data, and building custom workflows.

All API requests require an API key sent via the X-API-KEY header.

Terminal window
curl -H "X-API-KEY: your-api-key" https://app.micropim.net/api/products

Requests without a valid API key return 401 Unauthorized.

All endpoints return a consistent JSON envelope:

{
"status": 1,
"data": { ... },
"error": null
}

On error:

{
"status": 0,
"data": null,
"error": "Error description"
}

API requests are rate-limited per IP. Read endpoints have a higher limit than write endpoints. When exceeded, the API returns 429 Too Many Requests.


GET /api/products

Query Parameters:

ParameterTypeDescription
searchstringSearch in name, description, and SKU
statusstringFilter by status: draft, active, archived, out_of_stock
brandintegerFilter by brand ID
channelstringFilter by publishing channel: web, mobile, api, marketplace, social, email
pageintegerPage number (default: 1)
limitintegerItems per page, 1-100 (default: 20)

Example Response:

{
"status": 1,
"data": {
"products": [
{
"id": 1,
"sku": "PROD-001",
"slug": "product-name",
"name": "Product Name",
"description": "<p>Full description</p>",
"short_description": "Brief summary",
"product_type": "simple",
"price": "99.9900",
"sale_price": "79.9900",
"cost_price": "50.0000",
"currency": "EUR",
"status": "active",
"stock": 150,
"in_stock": true,
"ean": "1234567890123",
"vat_rate": {
"id": 1,
"name": "Standard Rate",
"rate": "19.0000",
"country_code": "RO"
},
"brand": {
"id": 1,
"name": "Brand Name"
},
"supplier": {
"id": 1,
"name": "Supplier Name"
},
"categories": [
{"id": 1, "name": "Electronics"}
],
"images": [
"https://cdn.example.com/image.webp"
],
"publishing_channels": ["web", "marketplace"],
"available_translations": ["en", "ro"],
"product_condition": "new",
"attributes": {}
}
],
"pagination": {
"current_page": 1,
"total_pages": 5,
"total_items": 100,
"items_per_page": 20
}
},
"error": null
}
GET /api/products/{id}

Returns the full product object as shown in the list response.

POST /api/products

Request Body:

{
"name": "New Product",
"sku": "SKU-001",
"description": "Product description",
"short_description": "Brief summary",
"price": "99.99",
"sale_price": "79.99",
"cost_price": "50.00",
"currency": "EUR",
"status": "draft",
"stock": 100,
"ean": "1234567890123",
"brand_id": 1,
"supplier_id": 1,
"category_ids": [1, 2],
"publishing_channels": ["web", "marketplace"],
"product_type": "simple"
}

Required fields: name, sku

Returns 201 Created with the full product object.

PATCH /api/products/{id}

Send only the fields you want to update:

{
"price": "89.99",
"description": "Updated description"
}

Returns 200 OK with the updated product.

DELETE /api/products/{id}

Sets the product status to archived. Returns 200 OK.

GET /api/products/barcode/{barcode}

Look up a product by EAN barcode. Returns the product with warehouse stock levels.

POST /api/products/image-search

Upload an image file to find matching products. Send as multipart/form-data with field name image.

Accepted formats: JPEG, PNG, WebP, GIF

POST /api/products/{id}/media

Attach media to a product via URL.

{
"file_url": "https://example.com/image.jpg",
"alt_text": "Product image description",
"position": 0
}

Returns 201 Created with the media details.


GET /api/products/{id}/variants

Example Response:

{
"status": 1,
"data": {
"product_id": 1,
"product_name": "T-Shirt",
"variants": [
{
"id": 10,
"sku": "TSHIRT-RED-M",
"name": "T-Shirt - Red, Medium",
"price": "29.9900",
"sale_price": null,
"cost": "15.0000",
"stock_quantity": 50,
"stock_status": "in_stock",
"weight": "0.2500",
"is_enabled": true,
"position": 0,
"image": "https://cdn.example.com/variant.webp",
"attributes": [
{"attribute_name": "Color", "value": "Red"},
{"attribute_name": "Size", "value": "M"}
]
}
],
"total": 1
},
"error": null
}
GET /api/products/{id}/variants/{variantId}

Returns a single variant object as shown above.


GET /api/channels

Returns the publishing channels configured for the authenticated user’s organization.

Example Response:

{
"status": 1,
"data": {
"channels": [
{
"value": "web",
"label": "Web Store",
"description": "Products visible on web storefront"
},
{
"value": "marketplace",
"label": "Marketplace",
"description": "Products published to external marketplaces"
}
],
"total": 2
},
"error": null
}

If no channels are configured, defaults to web and mobile.


GET /api/categories

Query Parameters:

ParameterTypeDescription
parent_idintegerFilter by parent category ID
GET /api/categories/tree

Returns the full category hierarchy as a nested tree.

POST /api/categories
{
"name": "Electronics",
"description": "Electronic products",
"parent_id": null
}

Required fields: name

PUT /api/categories/{id}
DELETE /api/categories/{id}
GET /api/categories/{id}/children

Returns direct child categories.

GET /api/categories/{id}/products

Returns products assigned to a category.

POST /api/categories/{id}/products
{
"product_ids": [1, 2, 3]
}
POST /api/categories/{id}/move
{
"parent_id": 5,
"position": 0
}

GET /api/product-attributes
GET /api/product-attributes/{id}
POST /api/product-attributes
PUT|PATCH /api/product-attributes/{id}
DELETE /api/product-attributes/{id}

CodeDescription
200Success
201Created (new resource)
400Bad request (validation error)
401Unauthorized (missing or invalid API key)
403Forbidden (no organization access)
404Resource not found
429Rate limit exceeded
500Server error