NutraSoft food manufacturing ERP software
Esc
  • GuideGetting startedThree steps to your first call and your first order, then the two shapes every response takes.
  • GuideAuthentication and keysBearer keys, test and live environments, rotation without an outage, and what each scope grants.
  • GuideTest modeA second NutraSoft account of your own, seeded with realistic data, that you can safely break.
  • PageErrorsEvery error code the API returns, what it means, what to do about it and whether to retry.
  • PageConventionsThe rules every operation follows: money, time, paging, sorting, nulls, PATCH and identifiers.
Menu

Operations

The operations a recipe's steps can reference, with their cost.

manufacturing:readmanufacturing:writehttps://public-api.nutrasoft.ca/v1

The Operation object

  • idinteger
  • codestring

    Unique within your account.

  • costnumbernullable

    Cost per qty. Requires cost:read; null means redacted, not zero.

  • namestring
  • qtynumbernullable

    The quantity cost is per, in the unit unit_of_measure_id.

  • unit_of_measure_idintegernullable

    Resolve with GET /units-of-measure/{uom_id}.

Operations

List operations

get/operationsmanufacturing:read

The operations recipe steps reference. cost requires cost:read.

Query parameters

  • searchstringnullable

    Free-text match on code or name.

  • codestringnullable

    Partial match on the code.

  • namestringnullable

    Partial match on the name.

  • sortstringnullable

    Comma-separated field:direction pairs, e.g. id:desc. Sortable: code, id, name. id is always added last, so paging is stable.

  • limitinteger

    Rows to return. Maximum 200.

    • >= 1
    • <= 200
    • default 50
  • offsetinteger

    Rows to skip. Maximum 10000: to read further, narrow the filters or page with updated_since.

    • >= 0
    • <= 10000
    • default 0
Returns
200 A page of Operation objects in data, with pagination.
Errors
400 401 403 429 500 503
GET /operations
curl "https://public-api.nutrasoft.ca/v1/operations?limit=50" \
  -H "Authorization: Bearer $NUTRASOFT_API_KEY"
Response200
{
  "data": [
    {
      "id": 123,
      "code": "SAMPLE-01",
      "cost": 12.5,
      "name": "Sample name",
      "qty": 12.5,
      "unit_of_measure_id": 123
    }
  ],
  "pagination": {
    "limit": 50,
    "offset": 0,
    "total": 1,
    "has_more": false
  },
  "order": "id:asc"
}

Retrieve an operation

get/operations/{operation_id}manufacturing:read

Path parameters

  • operation_idintegerrequired

    The operation's id.

    • > 0
Returns
200 One Operation object in data.
Errors
400 401 403 404 429 500 503
GET /operations/{operation_id}
curl "https://public-api.nutrasoft.ca/v1/operations/123" \
  -H "Authorization: Bearer $NUTRASOFT_API_KEY"
Response200
{
  "data": {
    "id": 123,
    "code": "SAMPLE-01",
    "cost": 12.5,
    "name": "Sample name",
    "qty": 12.5,
    "unit_of_measure_id": 123
  }
}

Create an operation

post/operationsmanufacturing:write

code is stored trimmed and upper-cased and is unique within your account; a duplicate is a 409.

Request body

  • codestringrequired

    Unique within your account. Stored trimmed and upper-cased.

    • min 1 chars
    • max 40 chars
  • namestringrequired
    • min 1 chars
    • max 50 chars
  • costnumbernullable

    Cost per qty. Returned only to keys holding cost:read.

    • >= 0
  • qtynumbernullable

    The quantity cost is per, in the unit unit_of_measure_id.

    • >= 0
  • unit_of_measure_idintegernullable

    One of your units of measure or a shared one.

    • > 0
Returns
201 One Operation object in data.
Errors
400 401 403 409 429 500 503
POST /operations
curl -X POST "https://public-api.nutrasoft.ca/v1/operations" \
  -H "Authorization: Bearer $NUTRASOFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "code": "SAMPLE-01",
  "name": "Sample name"
}'
Response201
{
  "data": {
    "id": 123,
    "code": "SAMPLE-01",
    "cost": 12.5,
    "name": "Sample name",
    "qty": 12.5,
    "unit_of_measure_id": 123
  }
}

Update an operation

patch/operations/{operation_id}manufacturing:write

Omitted fields are left unchanged.

Path parameters

  • operation_idintegerrequired

    The operation's id.

    • > 0

Request body

  • codestringnullable
    • min 1 chars
    • max 40 chars
  • costnumbernullable
    • >= 0
  • namestringnullable
    • min 1 chars
    • max 50 chars
  • qtynumbernullable
    • >= 0
  • unit_of_measure_idintegernullable
    • > 0
Returns
200 One Operation object in data.
Errors
400 401 403 404 409 429 500 503
PATCH /operations/{operation_id}
curl -X PATCH "https://public-api.nutrasoft.ca/v1/operations/123" \
  -H "Authorization: Bearer $NUTRASOFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "code": "SAMPLE-01"
}'
Response200
{
  "data": {
    "id": 123,
    "code": "SAMPLE-01",
    "cost": 12.5,
    "name": "Sample name",
    "qty": 12.5,
    "unit_of_measure_id": 123
  }
}

Delete an operation

delete/operations/{operation_id}manufacturing:write

Refused with 409 while a recipe step or a production run uses the operation. A HACCP process step that references it is unlinked.

Path parameters

  • operation_idintegerrequired

    The operation's id.

    • > 0
Returns
200 One Operation object in data.
Errors
400 401 403 404 409 429 500 503
DELETE /operations/{operation_id}
curl -X DELETE "https://public-api.nutrasoft.ca/v1/operations/123" \
  -H "Authorization: Bearer $NUTRASOFT_API_KEY"
Response200
{
  "data": {
    "id": 123,
    "code": "SAMPLE-01",
    "cost": 12.5,
    "name": "Sample name",
    "qty": 12.5,
    "unit_of_measure_id": 123
  }
}