Skip to main content

The AGR Public API

The AGR Public API: A Guide for Integrators

Overview

The AGR Public API lets you connect your own systems directly to your AGR tenant. In practice it covers two jobs: pulling data out of AGR (items, forecasts, demand history, orders, locations, settings) so you can report on it or feed it into another system, and pushing custom data in — either through custom columns you define yourself, or through raw item and vendor attributes that feed AGR's own calculations.

It's built on OpenAPI 3.0, versioned as v1.0, and the interactive reference (Swagger UI) lives at https://api.agrinventory.net/index.html, with the underlying spec at https://api.agrinventory.net/swagger/1.0/swagger.json. AGR notes that the API is in active development and endpoints may change — check the changelog (linked from the docs page) before building anything that depends on exact response shapes.

Authentication

Every request needs a bearer token: an Authorization: Bearer <token> header carrying an AGR access token (JWT). The reference doesn't document how a tenant obtains that token — worth confirming with AGR Support or engineering before this goes out, so the article can tell customers the actual first step rather than assuming they already have one.

Versioning

Requests can carry an api-version header (pattern like 1.0) on every endpoint. If you omit it, you get whatever version the current page defaults to — currently 1.0. This is how AGR plans to let the API evolve without breaking existing integrations: pin the header once you've built against a version, rather than relying on the default.

Rate limits

Limits are applied per tenant, not per user or per token:

Scope

Limit

Overall, across all endpoints

60 requests/minute

"Heavy" export/stream endpoints in general

10 requests/minute

A handful of the heaviest endpoints specifically (see below)

2 requests/minute

Exceeding any of these returns HTTP 429. The endpoints called out with the stricter 2/minute limit are:

  • GET /api/Item/stream

  • GET /api/Item/salehistory/all/stream

  • GET /api/Item/estimated-stock-with-purchase-plan/stream

  • GET /api/Item/estimated-stock-with-purchase-plan/itemNo/{itemNo}/locationNo/{locationNo}

If you're building a sync job against any of these, batch or schedule your calls accordingly rather than polling frequently.

How responses are shaped

Two patterns show up repeatedly across the API, and recognizing them makes the rest of the reference much easier to read.

Streamed exports. Endpoints with /stream in the path return the full result set — items, demand values, forecast values, and so on — as one JSON array, intended for bulk export rather than interactive querying. Several of these cap out at 2 million records per call and silently skip zero values to keep the payload smaller, which matters if you're reconstructing a complete time series and need to backfill the zeros yourself.

Paginated fetch endpoints. A second group of endpoints — mostly the PUT .../fetch ones — take a request body (typically an array of item IDs or customer group IDs) and support Limit/Offset query parameters, with Start/End for date filtering where relevant. Two of them (/api/Forecast/logs/all/monthly and /api/Item/history/fetch) wrap their results in a pagination envelope with data, limit, offset, and count fields rather than returning a bare array — useful for knowing whether you've reached the end of a result set.

Error handling

A validation failure (HTTP 400) returns an array of error objects, each with a code and a description — for example, when a custom column create or update request doesn't pass validation. A rate-limit breach returns HTTP 429 with no custom body beyond the standard status.

Endpoint reference

Endpoints are grouped by resource, matching how they're organized in the Swagger UI.

Custom Columns

Lets you define your own fields on items and populate them — useful for surfacing data that lives outside AGR (a third-party rating, an internal classification) alongside native item fields.

Method

Path

What it does

GET

/api/CustomColumn/types

Lists the data types available for a custom column (boolean, currency, date, decimal, int, string).

POST

/api/CustomColumn

Creates a new custom column (key, name, and type).

GET

/api/CustomColumn

Lists all custom columns already created.

PATCH

/api/CustomColumn/{columnId}

Renames a custom column.

DELETE

/api/CustomColumn/{columnId}

Deletes a custom column.

PUT

/api/CustomColumn/{columnId}/entries

Sets the value of a custom column for a batch of items (by item number + location number). Optional validateItemExists query flag checks the item/location combination is real before writing.

DELETE

/api/CustomColumn/{columnId}/entries

Clears all entries for a given custom column.

Customer Groups

Method

Path

What it does

GET

/api/CustomerGroup

Lists all customer groups configured in the tenant.

Demand

Historical demand data, as recorded by AGR — distinct from forecast data below.

Method

Path

What it does

GET

/api/Demand/values/all-daily/stream

Daily demand values for every item (up to 2M records; zero values omitted).

GET

/api/Demand/values/all-monthly/stream

Monthly (summed) demand values for every item.

GET

/api/Demand/values/bom-demand/stream

Demand values split by BOM parent item — requires the BOM Demand premium feature.

GET

/api/Demand/values/distribution-demand/stream

Demand values split by location.

Forecast

AGR's generated forecasts, any manual overrides applied to them, and the underlying model logs.

Method

Path

What it does

PUT

/api/Forecast/values/fetch

Monthly forecast values for a specified set of item IDs.

GET

/api/Forecast/values/all/stream

Monthly forecast values for every item.

GET

/api/Forecast/values/all-daily/stream

Daily forecast values for every item.

PUT

/api/Forecast/overrides/fetch

Monthly forecast overrides for a specified set of items.

GET

/api/Forecast/overrides/all/stream

Monthly forecast overrides for every item.

PUT

/api/Forecast/values/customer-groups/fetch

Monthly forecast values broken down by customer group, for a specified set of groups.

GET

/api/Forecast/values/customer-groups/all/stream

Monthly forecast values by customer group, for all groups.

PUT

/api/Forecast/overrides/customer-groups/fetch

Monthly forecast overrides by customer group, for a specified set of groups.

GET

/api/Forecast/overrides/customer-groups/all/stream

Monthly forecast overrides by customer group, for all groups.

GET

/api/Forecast/logs/item/{itemId}/monthly

All monthly forecast model logs for one item (model family, confidence factor, seasonality, MAPE, RMSE, etc.).

GET

/api/Forecast/log/{logId}/monthly

A single forecast log by its ID.

GET

/api/Forecast/logs/all/monthly

All monthly forecast logs, paginated.

Items

The largest and most detailed resource — the full item master plus sales history, stock projections, and delivery estimates.

Method

Path

What it does

GET

/api/Item/stream

Every item, every column, unfiltered — the full item view. Rate-limited to 2/minute given its size.

GET

/api/Item/minimal/stream

Every item, but just the identifying fields (ID, name, item number, location).

GET

/api/Item/history/stream

Historical, datestamped snapshots of item data over time, streamed.

GET

/api/Item/history/fetch

The same historical data, paginated instead of streamed. Retained for 2 years.

PUT

/api/Item/salehistory/fetch

Sale history for a specified set of item IDs.

GET

/api/Item/salehistory/all/stream

Sale history for all items. Paginated internally (max 5,000 per page) and rate-limited to 2/minute.

GET

/api/Item/estimated-stock-with-purchase-plan/itemNo/{itemNo}/locationNo/{locationNo}

Projected stock level over time for one item/location, factoring in the purchase plan. Rate-limited to 2/minute.

GET

/api/Item/estimated-stock-with-purchase-plan/stream

The same projection for all items. Rate-limited to 2/minute.

GET

/api/Item/estimated-future-deliveries/itemNo/{itemNo}/locationNo/{locationNo}

Expected future deliveries for one item/location.

GET

/api/Item/estimated-future-deliveries/stream

Expected future deliveries for all items.

GET

/api/Item/undelivered-orders/stream

Orders placed but not yet delivered, with reference numbers.

GET

/api/Item/undelievered-orders/stream

Deprecated — kept only for backward compatibility due to the typo in the path. Won't receive new fields and will eventually be removed; use undelivered-orders above.

Locations

Method

Path

What it does

GET

/api/Location

Lists all locations, including hierarchy (parent location) and whether a location is virtual.

Orders

Method

Path

What it does

GET

/api/Order/{id}

Full detail on a single order, including its lines. Optional ignoreZeroQuantity filter.

PUT

/api/Order/{id}/status/{status}

Moves an order through its review workflow — status is either unconfirm or transfer.

GET

/api/Order/status/{status}

Bulk-fetches all orders (with lines) sitting in a given status: unconfirmed, confirmed, or transferred. Added specifically to avoid having to list order IDs and fetch each one individually.

GET

/api/Order/status/{status}/ids

Just the order IDs for a given status, without the full line detail.

Raw Data

Write endpoints for feeding external attributes into AGR's own item and vendor records — things like lead time, weight, or cost price that may originate outside AGR.

Method

Path

What it does

PUT

/api/RawData/items

Inserts or updates raw item attributes (matched on item number + location number); new item/location pairs are inserted, existing ones updated.

DELETE

/api/RawData/items

Deletes all raw item data for the tenant. Irreversible.

PUT

/api/RawData/vendors

Inserts or updates raw vendor attributes (lead time, exclusion flag).

DELETE

/api/RawData/vendors

Deletes all raw vendor data for the tenant. Irreversible.

Settings

Method

Path

What it does

GET

/api/Settings

Lists all tenant settings, with their current value, default value, data type, and description.

What's changed recently

As of the August 2026 changelog:

GET /api/order/status/{status} was added — the bulk order-by-status endpoint described above, meant to replace the pattern of listing order IDs and then fetching each one individually. The two BOM- and distribution-demand streaming endpoints were also added around the same time, and GET /api/item/undelivered-orders/stream gained a referenceNo field on each line. The misspelled undelievered-orders path was formally deprecated in the same release.

Because the API is explicitly called out as still evolving, it's worth linking customers to the changelog directly rather than trying to keep this article in sync with every future change by hand.

Getting help

Questions about the API go to AGR Support ([email protected]), which is also the contact listed in the API's own documentation.


A note before this goes out: it's written from the published OpenAPI spec, so the endpoint paths, parameters, and schemas are accurate as of today. The one real gap is how a customer actually obtains their bearer token — that's not in the spec, so it needs a sentence from someone who knows the provisioning flow before this is customer-facing. Worth a second pass from someone on the API/engineering side given it's technical, external-facing content.

Did this answer your question?