AccuMix

AccuMix®

API DOCUMENTATION
v1.0 · Enterprise Only

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.

Enterprise Only — API access is available exclusively to AccuMix Enterprise tier customers.

What you can do

Read ingredientsGet your full ingredient database with nutrients and prices
Read formulasRetrieve saved formulas with full composition details
Update pricesPush price changes from your ERP into AccuMix
Add ingredientsAdd new ingredients programmatically
WebhooksGet 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
Keep your API key secret. Never expose it in client-side code, public repos, or browser JavaScript. Treat it like a password.

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.

PlanRate 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 CodeMeaning
200Success
201Created (new resource)
400Bad request (missing fields)
401Authentication failed or rate limit exceeded
403Insufficient permissions
404Resource not found
405Method not allowed
500Server error

Ingredients

GET /v1/ingredients List all 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"
}
GET /v1/ingredients/:name Get single ingredient

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
POST /v1/ingredients Add new ingredient

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
  }
}
FieldTypeRequiredDescription
namestringYesIngredient name (must be unique)
categorystringNoCategory/pool (default: "General")
pricenumberNoPrice per ton (default: 0)
inStockbooleanNoAvailability (default: true)
nutrientsobjectNoNutrient key-value pairs
PUT /v1/ingredients/:name Update ingredient price

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

GET /v1/formulas List saved 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"
}
GET /v1/formulas/:id Get formula details

Returns full formula details including nutrient values, ingredient composition, and constraints.

Formulas are read-only via API. You cannot create or modify formulas through the API.

Prices

GET /v1/prices Get all ingredient 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
}
PUT /v1/prices/:name Update ingredient price

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

GET /v1/health Check API status

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

  1. You register a webhook URL with the AccuMix admin team
  2. When a matching event occurs, AccuMix sends a POST to your URL
  3. Your server processes the payload and returns a 2xx response
  4. Failed deliveries are logged and can be retried

Webhook Events

EventFires WhenPayload
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