canonical: https://jentic.com/apis/barbrain.com/barbrain

# BarBrain Inventory API

The BarBrain Inventory API retrieves detailed bar and beverage inventory records for a company, filtered by a date range, so external systems can sync stock counts on a schedule. It also manages the API tokens that authorize that access, letting admins list, create, rotate, and revoke company-specific tokens. Inventory reads use a bearer API token, while token management requires a Firebase ID token for admin users.

## For AI agents

Retrieve a company's bar inventory over a date range and manage the API tokens that grant access, including creating, rotating, and revoking them.

## Scope

Does not handle point-of-sale sales, purchasing, or supplier orders. Use for reading company beverage inventory and managing API access tokens only.

## Capabilities

- Pull a company's full beverage inventory for daily sync into accounting or reporting systems
- Filter inventory records by a start and end date using the dateFrom and dateTo query parameters
- Issue new company-specific API tokens for external integrations
- Rotate an existing API token when a credential needs replacing
- Revoke an API token to cut off a retired integration's access

## Use cases

### Agent-Driven Inventory Sync

An AI agent connected through Jentic pulls a bar's beverage inventory on a schedule and writes it into downstream accounting or analytics tools. The BarBrain Inventory API returns each company's stock records for a chosen date range, so the agent can run nightly exports without a human logging into the dashboard. Because inventory reads and token management are separate operations, the agent can be limited to read-only inventory access.

Example prompt: Fetch the company inventory for the previous day using dateFrom and dateTo and post the stock counts to the accounting system

### Daily Inventory Reporting

Operations teams pull beverage stock levels each morning to feed dashboards and reorder decisions. The BarBrain Inventory API exposes inventory retrieval filtered by dateFrom and dateTo, returning per-item counts a reporting pipeline can chart without manual data entry.

Example prompt: Retrieve inventory for the last seven days and generate a stock-movement summary report

### API Token Lifecycle Management

Integrations need scoped, rotating credentials. The BarBrain Inventory API lets an admin list, create, rotate, and revoke company-specific tokens, so a team can provision a token for a new integration and retire it cleanly when the integration is decommissioned. Token management operations require a Firebase ID token.

Example prompt: Create a new API token for a reporting tool, then revoke the token previously issued to a retired integration

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/fetchInventories` | Fetch company inventory records |
| GET | `/companies/{companyId}/api-tokens` | List API tokens for a company |
| POST | `/companies/{companyId}/api-tokens` | Create an API token |
| POST | `/companies/{companyId}/api-tokens/{tokenId}/rotate` | Rotate an API token |
| DELETE | `/companies/{companyId}/api-tokens/{tokenId}` | Revoke an API token |

## Key resources

- **Inventory** — Retrieve a company's beverage inventory records filtered by a date range
- **API Tokens** — List, create, rotate, and revoke company-specific API tokens

## Why Jentic

- **Setup:** Wiring BarBrain by hand means handling its bearer API token for inventory reads and a separate Firebase ID token for token management, plus the date-range parameters on each fetch. Through Jentic you install once, import BarBrain from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** BarBrain puts the company id in the URL path for token management (`/companies/{companyId}/api-tokens`), so a rule can pin your agent to one company. You choose the operations it may call, so you can allow the inventory fetch and leave token creation, rotation, and revocation out unless you add them.
- **Credential handling:** Your BarBrain API token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'sync bar inventory data', and Jentic returns the matching BarBrain operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **SOS Inventory API** — SOS Inventory offers broader inventory, order, and manufacturing management, where BarBrain focuses on bar and beverage stock.
- **Megaventory API** — Megaventory tracks stock across multiple locations with purchase and sales orders, a wider scope than BarBrain's single-company inventory read.
- **Square Connect API** — Square Connect handles point-of-sale sales and product data that pairs with BarBrain's beverage inventory records.

## FAQ

### What authentication does the BarBrain Inventory API use?

The BarBrain Inventory API authenticates inventory reads with a bearer API token in the Authorization header, per its OpenAPI spec. Token management operations such as listing, creating, rotating, and revoking tokens require a Firebase ID token for an authenticated admin user. Through Jentic the token is stored encrypted by your own Jentic One instance and injected when your agent calls the API.

### Is there a BarBrain Inventory API MCP server?

You don't need an MCP server to give your agent the BarBrain Inventory API. Jentic connects it directly from the API Directory: import it, store your API token once, and your agent calls the inventory and token operations it needs. Nothing extra is loaded into the agent's context until a call is made.

### Can I limit what my agent is allowed to do with the BarBrain Inventory API?

Yes. You choose the operations your agent may call, so you can allow only the inventory fetch and leave the token create, rotate, and revoke operations out. Every call the agent makes is logged, so you can see exactly what it retrieved.

### Can I export a company's inventory for a specific date range with the BarBrain Inventory API?

Yes. The inventory fetch accepts dateFrom and dateTo query parameters, returning the company's beverage stock records for that window so an agent can run scheduled exports into accounting or analytics tools.

### Can the BarBrain Inventory API manage the tokens my integrations use?

Yes. Admins can list existing tokens, create a new company-specific token, rotate a token when it needs replacing, and revoke a token to cut off access. These token management operations require a Firebase ID token rather than the standard API token.

### How do I sync BarBrain inventory through Jentic?

Search Jentic for 'sync bar inventory data', which returns the inventory fetch operation with its input schema. Add the BarBrain Inventory API from the Jentic API Directory, store your API token once, and your agent can pull stock records on a schedule. To run it on your own infrastructure, install Jentic One from its GitHub repo.
