anything.solutions

Inventory API

Stock, SKUs, barcodes, labels, scanning, and returns in Anything Inventory.

Anything Inventory is the stock system for the Anything suite. It owns items, SKUs and barcodes, locations, an append-only stock ledger, counts, transfers, physical returns, printable QR/Code128 labels, and phone scanning. It runs standalone or alongside Anything Invoicing for the same workspace.

The API is workspace-scoped: every request reads and writes only the workspace that owns the key. The base URL is https://inventory.anything.solutions/api/v1 and request and response bodies are JSON.

Organizations, workspaces, and seats

Anything uses an Organization → Workspace model. An organization groups people and workspaces; a workspace is the data and billing tenant. Each workspace has its own members, roles, subscription, seats, and billing owner.

  • A workspace seat includes both Invoicing and Inventory, whichever app it was bought through. There is no separate Inventory SKU and no double billing inside a workspace.
  • A seat is per workspace. One person in two workspaces uses two seats; one person in 30 workspaces means 30 workspace seats and 30 separate workspace bills, each charged to that workspace's billing owner.
  • Seats are $9/seat/month for seats 1–8 and $30/seat/month for each additional seat, per workspace. Membership and billing are managed in Anything Workspace, not in the Inventory database.
  • An organization role (owner, admin, member) manages the roster and workspace list. It does not grant app data access or consume a seat. A workspace role (owner, admin, manager, accountant, sales, staff, viewer) grants app permissions and consumes a seat.

Authentication and API keys

API keys are managed in Anything Workspace, not in Inventory. A workspace owner creates a key for the workspace and gives the token to the agent. The full token is shown once; the app stores only a SHA-256 hash plus its prefix and last four characters. Store the token in the agent's secret store.

Authorization: Bearer inv_<token>

X-API-Key is accepted as an alternative header. Keys are workspace-scoped and can be read-only or read/write.

  • A read-only key can call GET and HEAD endpoints. Writes return 403 with code read_only_key.
  • If the workspace is read-only because billing is past due, writes are rejected until the billing owner resolves it.
  • Revoking a key takes effect immediately. Use a separate key per agent.
  • The default limit is 120 requests per minute; excess requests return 429.

Request and response conventions

Successful responses wrap records in a data member. List responses also include pagination metadata. Items use offset pagination (page, per_page, maximum 100); movements use an opaque cursor plus limit.

ValueFormat
MoneyInteger cents in *_cents fields, with a decimal string in the matching field (cost_cents and cost). Amounts are non-negative except valuation totals.
QuantitiesInteger e4 (four decimal places) in *_e4 fields, with a decimal string in the matching field (quantity_e4 and quantity). One unit is 10000.
Dates and timesYYYY-MM-DD for dates; UTC ISO 8601 with Z for timestamps.
IDsOpaque public IDs such as ITM-…, LOC-…, and MOV-…. Never use a sequential database id.
CachingReads are private with a 15 second cache and an ETag; send If-None-Match to receive 304.
RetriesSend Idempotency-Key on writes. A duplicate returns the original response for 24 hours and adds Idempotent-Replay: true.

Errors

Errors use one shape:

{"error": {"code": "validation_error",
           "message": "sku is required"}}
StatusCodeMeaning
400bad_requestThe request could not be parsed.
401unauthorizedThe key is missing, revoked, or not valid.
403read_only_keyThe key is read-only and the request tried to write.
404item_not_found / not_foundThe record does not exist, or belongs to another workspace.
409conflictThe record is in a state that forbids the change, or an idempotency key was reused with a different body.
415unsupported_media_typeThe body is not a JSON object.
422validation_errorA field is missing, malformed, or out of range.
429rate_limitedToo many requests. Back off before retrying.
500internal_errorThe server failed. Reuse the same idempotency key when retrying a write.

Endpoints

Method and pathPurpose
GET /organizationLocal organization projection, currency, timezone, and workspace list.
GET /workspaceActive workspace, plan, seats, billing owner, billing status, and app access.
GET /summaryItem, location, movement, low-stock, and stock-value counters.
GET|POST /itemsList/search items or create one with name, SKU, barcodes, unit, kind, cost, price, reorder point, and tracking.
GET|PATCH|DELETE /items/{public_id}Read, update, or archive an item. Archive keeps history; it is not a hard delete.
POST /items/{public_id}/archiveArchive or restore an item.
GET /items/{public_id}/stockOn-hand by location plus total.
GET /items/{public_id}/movementsCursor-paginated ledger rows for one item.
GET|POST /locationsList or create locations. is_default is unique per workspace.
GET|PATCH /locations/{public_id}Read or edit a location.
GET|POST /categoriesList or create item categories.
POST /movementsApply a receipt, issue, adjustment, transfer, or count. Writes are append-only and idempotent.
GET /movementsCursor-paginated ledger filtered by item, location, kind, reference, and date.
GET|POST /returnsList or create a physical return/RMA. A return is independent of a refund.
GET /returns/{return_id}Return lines, expected/received quantities, dispositions, and movement links.
POST /returns/{return_id}/receiveReceive quantities into restock, quarantine, writeoff, or no_return. Replay-safe.
POST /returns/{return_id}/cancelCancel a pending RMA without moving stock.
POST /scan/resolveResolve a barcode, SKU, or item code to an item and on-hand. Unknown codes return a generic 404.
GET|POST /label-templatesList system/template copies or create a workspace template with exact mm geometry.
POST /labels/renderQueue a PDF batch for items and copies. Large batches render on the worker.
GET /labels/batches/{id}Batch status, counts, and a signed download URL when ready.
GET /reports/valuationStock value by location, category, or item.
GET /reports/low-stockItems at or below their reorder point with suggested reorder quantities.
GET /reports/cogsIssue cost of goods sold for a period, including return reversals.
GET /connectionsThe automatic Anything Invoicing connection, status, and last sync.
GET /openapi.jsonOpenAPI 3.1 description of the public API.

Movements and stock

POST /movements accepts an item public ID (or SKU/code), a location public ID, a kind, and a quantity. Quantities are signed by kind; sending a positive quantity for an outbound kind is normal and the server stores the correct sign.

{"kind": "receipt",
 "item_id": "ITM-7K3M9Q2X4A",
 "location_id": "LOC-MAIN0001",
 "quantity": "24",
 "unit_cost": "4.50",
 "reference": "PO-1042",
 "idempotency_key": "po-1042-receive-1"}

Receipts update the item's weighted-average cost. Issues value the movement at the current average cost. Transfers create paired transfer_out/transfer_in rows in one transaction. A count posts a count movement for the variance, so final on-hand equals the counted quantity. Corrections never edit or delete a ledger row; they create a new movement with a reason.

Workspace policy decides whether negative stock is allowed. When it is blocked, an issue that would go below zero returns a validation error with the available quantity. Pass idempotency_key in the body or an Idempotency-Key header; a replay returns the original movement.

Returns are not refunds

A refund is money; a return is physical. Anything Inventory owns the physical side and Invoicing owns refunds and payments. A refund never automatically restocks a SKU, and a return never automatically issues a refund. The wizard or API asks for an explicit quantity and disposition:

  • restock — return to sellable stock at the original issue cost.
  • quarantine — receive into a quarantine location for inspection.
  • writeoff — receive and immediately write off; the value leaves inventory.
  • no_return — money may move, but no stock moves.

Cumulative receipts cannot exceed the expected return quantity. Replaying a receive with the same return line and quantity is idempotent. Return lines carry the original unit cost so COGS is credited once and never at today's weighted-average cost.

Labels and scanning

Every item gets an opaque ITM-… code. The primary label can carry a QR code to /s/{public_id}, a Code128 barcode of the SKU or item code, and human-readable name/SKU/location/price. Items with a real GTIN can use EAN-13 or UPC-A after checksum validation; internal labels always include a scannable Code128.

The API renders vector PDF batches from exact millimetre templates. System templates include 57×32 mm and 102×152 mm thermal, and Avery 5160, 5163, and 22806 sheets. Calibration offsets are stored per workspace template. Print at 100% / actual size with no headers or footers.

POST /scan/resolve is the same resolver used by the phone scanner. It is workspace-scoped and returns not-found for a code from another workspace. The in-app scanner uses the browser BarcodeDetector where available and falls back to manual entry; Bluetooth/USB scanners work as keyboard input.

Anything Invoicing link

When a workspace has both apps enabled, Anything Workspace provisions the link automatically with a per-workspace sync secret. There is no “Connect” click. After linking:

  • An invoice line can reference an Inventory item; issuing the invoice writes a stock issue target.
  • Editing an issued invoice asks for a stock-impact decision. Price or tax edits do not move stock; a quantity increase issues only the delta; a decrease can reverse the unshipped quantity or leave stock alone.
  • Voiding or reverting to draft never silently returns goods. The user chooses keep stock issued, return all/some, or write off.
  • An expense can add stock (a purchase) or consume stock (job costing); amount-only edits revalue cost without changing on-hand.
  • A refund is separate from a return. A supplier credit is a separate financial document and only moves stock when goods actually go back.

Sync uses a transactional outbox in Invoicing, monotonic per-document versions, and confirmed targets rather than fragile add/subtract deltas. Duplicate or out-of-order events are acknowledged without a second movement, and a nightly reconcile repairs anything a lost event missed. The connection is automatic; there is nothing to configure in Inventory.

Examples

Resolve a scanned code:

curl -s https://inventory.anything.solutions/api/v1/scan/resolve \
  -H "Authorization: Bearer $INVENTORY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code":"WID-001"}'

Receive stock:

curl -s https://inventory.anything.solutions/api/v1/movements \
  -H "Authorization: Bearer $INVENTORY_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: receive-po-1042" \
  -d '{"kind":"receipt","item_id":"ITM-7K3M9Q2X4A","quantity":"24","unit_cost":"4.50"}'

Read low stock:

curl -s "https://inventory.anything.solutions/api/v1/reports/low-stock?limit=50" \
  -H "Authorization: Bearer $INVENTORY_KEY"

Send an Idempotency-Key on every write. After a timeout or server error, retry with the same key rather than creating a second movement.

The Invoicing API guide covers clients, invoices, estimates, expenses, payments, and credits. The Managed overview explains how the workspace, members, and seats fit together.