List materials
Try itLists raw materials with their stock on hand and cost, filtered by name or by low stock.
https:/ / tablebuddy.radioworkflow.com/ api/ v1/ inventory/ materialsPaged in id order, archived materials included (is_active false). q matches the name or the code, in any case; below_reorder=true lists what is at or below its low-stock line. A cursor holds only with the same filters. Quantities are milli-units of the material's unit (1.5 kg is 1500), and cost_per_unit is the weighted average for one whole unit. See Money and time.
Authentication
Authorization: Bearer <key>, or the same key in x-api-key. A key acts as the person who made it, cut down to this endpoint’s scope, and never as an owner. How keys workinventory.view)Request headers
AuthorizationrequiredBearer <key>. x-api-key: <key> works too; Authorization wins when both are sent.Idempotency-KeyignoredQuery parameters
limitinteger1–100optionalDefault 50.
cursorstringidoptionalnext_cursor from the previous page.qstring1–80 charsoptionalNot blank; no NUL character or unpaired surrogate.
below_reorderenumoptionaltrue for materials at or below their low-stock line, false for the rest.truefalseAny other parameter, or one sent twice, is answered 422 invalid_request naming it. A list pages by cursor: see Pagination.
Response
In id order. A cursor holds only with the same filters.
currencystringISO 4217minor_digitsinteger0–3dataarray of objectdata[].idstringiddata[].namestringdata[].codestringnullabledata[].categorystringnullabledata[].unitstring_milli figure is thousandths of it.data[].stock_milliintegermilli-unitsdata[].reorder_milliintegermilli-unitsdata[].cost_per_unitintegerminor unitsdata[].is_activebooleanhas_morebooleannext_cursorstringidnullablecursor. Null on the last page.An answer may gain fields within v1: ignore the ones you do not know. Versioning
Response headers
request-idalwaysCache-Controlalwaysno-store: an answer is never cached.RateLimit-Limit, RateLimit-Remaining, RateLimit-Resetonce the key is knownx-error-codeon an errorerror.code in the body.Retry-Afteron a 429WWW-Authenticateon a 401, and a 403 insufficient_scopeErrors
insufficient_scopeFix: Scopes are fixed when a key is made: make a new key with the scope.
issuer_access_endedFix: Make a new key from an active account.
issuer_permission_changedFix: Ask an owner to restore the permission, or make a new key from an account that holds it.
permission_requiredFix: Use a key with the named scope, from a creator who holds the named permission.
invalid_requestq blank or over 80 characters, or below_reorder other than true or false.Fix: Fix the named fields. Nothing was done, and an Idempotency-Key is not used up.
invalid_cursorFix: Start without cursor, keeping the same filters.
missing_api_keyNo Authorization: Bearer header and no x-api-key header.invalid_api_keyThe key is unknown, revoked or expired (answered alike).rate_limitedOver the key's 60 units a minute, or over 30 unknown keys a minute from one network (an address; an IPv6 caller's /64).internal_errorSomething failed on our side. Nothing kept the Idempotency-Key.curl -X GET "$TABLEBUDDY_URL/api/v1/inventory/materials?below_reorder=true" \ -H "Authorization: Bearer $TABLEBUDDY_API_KEY"
{
"currency": "USD",
"minor_digits": 2,
"data": [
{
"id": "cmg5x4d2e0001tb2jh7p3k5sa",
"name": "Atlantic salmon fillet",
"code": "SAL-1",
"category": "Seafood",
"unit": "lb",
"stock_milli": 18500,
"reorder_milli": 10000,
"cost_per_unit": 1150,
"is_active": true
}
],
"has_more": false,
"next_cursor": null
}