canonical: https://jentic.com/apis/swaggerhub.eco-solutions/agrocura-commodity-api

# Eco Solutions Agrocura Commodity API

API Documentation for Agrocura Commodity system. The API exposes 18 endpoints secured with bearer authentication.

## For AI agents

Programmatically request otp code for customer to login, login to the customer profile. Covers 18 operations with bearer authentication.

## Scope

Does not handle payments, communications, or crm - use for developer tools only.

## Capabilities

- Request OTP code for customer to login
- Login to the customer profile
- Fetches the currently logged in user from the token
- Update empty field data by the given year
- Fetch commodity profiles for customerId

## Use cases

### Developer Tools Operations

Use the Agrocura Commodity API to perform developer tools operations programmatically. The API provides 18 endpoints covering core functionality including request otp code for customer to login, login to the customer profile, fetches the currently logged in user from the token.

Example prompt: Call POST /customer-auth/request-otp to request otp code for customer to login

### Automated Customer Auth Management

Automate customer auth operations by combining multiple Agrocura Commodity API endpoints. Agents can login to the customer profile and then fetches the currently logged in user from the token in a single workflow.

Example prompt: Call POST /customer-auth/login to login to the customer profile, then verify the result

### AI Agent Integration via Jentic

AI agents discover and call Agrocura Commodity API endpoints through Jentic without managing credentials directly. An agent searches for the required operation by intent, receives the matching endpoint schema, and executes the call with Jentic-managed authentication. This eliminates the need to read API documentation or handle bearer tokens manually.

Example prompt: Search Jentic for 'request otp code for customer to login', load the operation schema, and execute with Jentic-managed credentials

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /customer-auth/request-otp | Request OTP code for customer to login |
| POST | /customer-auth/login | Login to the customer profile |
| GET | /customer-auth/current | Fetches the currently logged in user from the token |
| POST | /commodity-profile/{commodityProfileId}/fields/{year}/refresh | Update empty field data by the given year |
| GET | /commodity-profile/{customerId}/profiles | Fetch commodity profiles for customerId |
| GET | /commodity-profile/{commodityProfileId}/crops | Fetch commodity profile aggregated field data of crops by year |
| GET | /commodity-profile/{commodityProfileId}/crops/{cropId} | Fetch aggregated data grouped by crop type (Afgroede) |
| PUT | /commodity-profile/{commodityProfileId}/fields/{fieldId} | Update field data for a specific field |

## Key resources

- **Customer Auth** — Operations related to Customer Auth
- **Commodity Profile** — Operations related to Commodity Profile
- **Commodity Crop/Field** — Operations related to Commodity Crop/Field
- **Commodity Company** — Operations related to Commodity Company
- **Commodity Sale Contract** — Operations related to Commodity Sale Contract

## Why Jentic

- **Setup:** Wiring the Agrocura Commodity API by hand means learning its bearer token auth, choosing between the crm.agrocura.dk and ngrok dev hosts, and hand-coding each commodity-profile call and its retries yourself. Through Jentic you install once, import the Agrocura Commodity API from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** The Agrocura Commodity API puts the commodity-profile id in the URL path (/commodity-profile/{commodityProfileId}/...), so a rule can pin your agent to one profile: it can read that profile's crops and sale contracts and nothing else. You choose the operations it may call, so writes like refreshing fields or updating a field are not included unless you add them.
- **Credential handling:** Your Agrocura Commodity 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 'request an OTP login code' or 'list a commodity profile's crops', and Jentic returns the matching Agrocura Commodity API operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Github** — Alternative developer tools API
- **Gitlab** — Alternative developer tools API

## FAQ

### What authentication does the Agrocura Commodity API use?

The Agrocura Commodity API uses a Bearer token in the Authorization header. Through Jentic, these credentials are stored encrypted in your Jentic One instance and injected at execution time, so raw secrets never enter the agent context.

### Can I request otp code for customer to login with the Agrocura Commodity API?

Yes. Use the POST /customer-auth/request-otp endpoint. The API returns structured JSON responses that agents can parse and act on directly.

### What are the rate limits for the Agrocura Commodity API?

Rate limits are not specified in the OpenAPI spec. Check the vendor documentation for current limits. Through Jentic, rate limiting is handled automatically with retry logic built into the execution layer.

### How do I request otp code for customer to login through Jentic?

Install the Jentic SDK with pip install jentic, authenticate through Jentic One, the self-hosted execution layer, then search for 'request otp code for customer to login'. Jentic returns the matching Agrocura Commodity API operation with its input schema. Load the schema and execute the call - credentials are injected automatically.

### How many endpoints does the Agrocura Commodity API have?

The Agrocura Commodity API exposes 18 endpoints covering customer auth, commodity profile, commodity crop/field operations.

### Can I limit what my agent is allowed to do with the Agrocura Commodity API?

Yes. Because Jentic One is self-hosted, your own rules decide which Agrocura Commodity API operations and credentials the agent may use. The commodity-profile id sits in the URL path (/commodity-profile/{commodityProfileId}/...), so you can pin the agent to a single profile and let it read only that profile's crops and sale contracts. You also choose the exact operations it may call, so write actions like refreshing field data or updating a field stay off unless you add them.
