Overview
The AccuMix API allows enterprise customers to integrate their feed formulation data with external software such as ERP systems, accounting tools, IoT-enabled mills, and custom dashboards.
What you can do
| Read ingredients | Get your full ingredient database with nutrients and prices |
| Read formulas | Retrieve saved formulas with full composition details |
| Update prices | Push price changes from your ERP into AccuMix |
| Add ingredients | Add new ingredients programmatically |
| Webhooks | Get notified in real-time when prices or ingredients change |
Authentication
All API requests must include your API key in the X-API-Key header.
curl -H "X-API-Key: acc_your_api_key_here" \
https://qdhoqvjkhqhggmnmpjtk.supabase.co/functions/v1/api-gateway/v1/health
Getting your API key
Your API key is generated by the AccuMix admin team. Contact support@accumixfeed.com to request API access. You will receive a key starting with acc_.
Base URL
All endpoints are relative to this base URL:
https://qdhoqvjkhqhggmnmpjtk.supabase.co/functions/v1/api-gateway/v1
Rate Limits
API requests are rate-limited per API key. The default limit is 100 requests per hour. If you exceed the limit, you'll receive a 401 response with an error message.
| Plan | Rate Limit |
|---|---|
| Enterprise (default) | 100 req/hr |
| Enterprise (custom) | Up to 1,000 req/hr |
Error Handling
All errors return a JSON object with a status and message field.
{
"status": "error",
"message": "Invalid or inactive API key"
}
| Status Code | Meaning |
|---|---|
200 | Success |
201 | Created (new resource) |
400 | Bad request (missing fields) |
401 | Authentication failed or rate limit exceeded |
403 | Insufficient permissions |
404 | Resource not found |
405 | Method not allowed |
500 | Server error |
Ingredients
Returns all ingredients in your workspace with name, category, price, and stock status.
Example Request
curl -H "X-API-Key: acc_your_key" \
https://qdhoqvjkhqhggmnmpjtk.supabase.co/functions/v1/api-gateway/v1/ingredients
Example Response
{
"status": "ok",
"data": [
{
"name": "Corn",
"category": "Energy",
"price": 280,
"inStock": true,
"nutrients": 15
},
{
"name": "Soybean Meal 46%",
"category": "Protein",
"price": 520,
"inStock": true,
"nutrients": 18
}
],
"count": 2,
"pools": ["Energy", "Protein", "General"],
"timestamp": "2026-04-27T04:00:00.000Z"
}
Returns the full detail (including all nutrients) for a single ingredient by name. URL-encode the name if it contains spaces.
curl -H "X-API-Key: acc_your_key" \
https://...api-gateway/v1/ingredients/Soybean%20Meal%2046%25
Add a new ingredient to your workspace. Requires write permission.
Request Body
{
"name": "Rice Bran",
"category": "Energy",
"price": 180,
"inStock": true,
"nutrients": {
"ME_poultry": 2980,
"CP": 13.5,
"CF": 11.4
}
}
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Ingredient name (must be unique) |
category | string | No | Category/pool (default: "General") |
price | number | No | Price per ton (default: 0) |
inStock | boolean | No | Availability (default: true) |
nutrients | object | No | Nutrient key-value pairs |
Update the price of an existing ingredient. Requires write permission. Fires a price.updated webhook.
curl -X PUT -H "X-API-Key: acc_your_key" \
-H "Content-Type: application/json" \
-d '{"price": 295, "inStock": true}' \
https://...api-gateway/v1/ingredients/Corn
Formulas
Returns a list of all saved formulas with summary info.
{
"status": "ok",
"data": [
{
"id": "f1a2b3c4",
"name": "Broiler Starter 23%",
"species": "poultry",
"subcategory": "broiler_starter",
"batchSize": 1000,
"totalCost": 385.50,
"createdAt": "2026-04-15T10:30:00.000Z"
}
],
"count": 1,
"timestamp": "2026-04-27T04:00:00.000Z"
}
Returns full formula details including nutrient values, ingredient composition, and constraints.
Prices
Returns a simplified list of all ingredients with just price and stock info. Useful for ERP price sync.
{
"status": "ok",
"data": [
{ "name": "Corn", "price": 280, "inStock": true, "category": "Energy" },
{ "name": "Soybean Meal 46%", "price": 520, "inStock": true, "category": "Protein" }
],
"count": 2
}
Same as PUT /v1/ingredients/:name. Updates the price and optionally stock status.
curl -X PUT -H "X-API-Key: acc_your_key" \
-H "Content-Type: application/json" \
-d '{"price": 295}' \
https://...api-gateway/v1/prices/Corn
Health Check
Returns API status and version. Useful for monitoring.
{
"status": "ok",
"version": "1.0.0",
"timestamp": "2026-04-27T04:00:00.000Z"
}
Webhooks
Webhooks let you receive real-time notifications when certain events happen in AccuMix. When an event fires, AccuMix sends an HTTP POST request to your configured URL.
How it works
- You register a webhook URL with the AccuMix admin team
- When a matching event occurs, AccuMix sends a POST to your URL
- Your server processes the payload and returns a 2xx response
- Failed deliveries are logged and can be retried
Webhook Events
| Event | Fires When | Payload |
|---|---|---|
price.updated |
An ingredient price is changed via API | { ingredient, old_price, new_price, timestamp } |
ingredient.added |
A new ingredient is added via API | { ingredient, category, price, timestamp } |
Example Webhook Payload
POST https://your-server.com/webhook
Content-Type: application/json
X-Webhook-Signature: a1b2c3d4e5...
X-Webhook-Event: price.updated
{
"ingredient": "Corn",
"old_price": 280,
"new_price": 295,
"timestamp": "2026-04-27T04:00:00.000Z"
}
Webhook Verification
Every webhook includes an X-Webhook-Signature header containing an HMAC-SHA256 signature of the payload. Verify this to ensure the request came from AccuMix.
// Node.js verification example
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return expected === signature;
}
app.post('/webhook', (req, res) => {
const sig = req.headers['x-webhook-signature'];
if (!verifyWebhook(req.body, sig, 'your_webhook_secret')) {
return res.status(401).send('Invalid signature');
}
// Process the event
console.log('Event:', req.headers['x-webhook-event']);
console.log('Data:', req.body);
res.status(200).send('OK');
});
© 2026 AccuMix International. All rights reserved.
Need help? Contact support@accumixfeed.com