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

# Cuentica API

The Cuentica API exposes the Spanish online accounting platform aimed at freelancers and small businesses (autonomos and pymes). It covers the core accounting entities of company profile and invoicing series, bank accounts, providers, customers, invoices, and expenses. The API is REST-style with JSON bodies and uses an X-AUTH-TOKEN header for authentication. Agents can read company configuration, manage CRM-style provider and customer records, and create or update invoices and expenses to keep books in sync with operational systems.

## For AI agents

Manage Spanish accounting records - providers, customers, invoices, and expenses - on the Cuentica platform. Useful for AI agents that automate freelancer or small-business bookkeeping.

## Scope

Does not handle payment processing, payroll, or tax filing - use for Cuentica invoices, expenses, customers, and providers only.

## Capabilities

- Read company profile and invoicing series via GET /company and GET `/company/serie`
- Create, update, and delete provider records via /provider operations
- Create, update, and delete customer records via /customer operations
- Issue and update invoices via the /invoice endpoints
- Record and categorise business expenses via the /expense endpoints
- List bank accounts attached to the Cuentica company

## Use cases

### Automated Invoice Issuance from a CRM

An agent can listen for closed-won deals in a CRM and create the matching invoice in Cuentica. It looks up or creates the customer record via /customer, then posts the invoice via the /invoice endpoint with the right invoicing series from `/company/serie.` The result is books that stay in sync with sales without a human re-entering data.

Example prompt: Look up the customer with GET /customer filtered by NIF, then POST /invoice with the deal value and the correct invoicing series.

### Receipt-to-Expense Capture

A bookkeeping agent can ingest receipts from email or a mobile app, extract the supplier, amount, and VAT with an LLM, then create or match the provider via /provider and post the expense via the /expense endpoints. This keeps expense records up to date without manual data entry, which is often the bottleneck for autonomos using Cuentica.

Example prompt: Match the supplier with GET /provider by name, create the provider via POST /provider if missing, then POST /expense with amount, date, and VAT.

### Customer and Provider Master Data Sync

An agent can keep Cuentica's customer and provider lists in sync with another system of record such as a CRM or e-commerce platform. By calling GET /customer and GET /provider on a schedule and reconciling against the source system, the agent prevents duplicate records and broken invoices caused by mismatched NIFs.

Example prompt: Reconcile customers between the source CRM and Cuentica by calling GET /customer, comparing on NIF, and updating diffs via PUT `/customer/{id}.`

### AI Agent Integration via Jentic

A bookkeeping agent can use Jentic to discover Cuentica operations rather than hand-coding twenty endpoints. It searches for an intent like 'create an invoice in Cuentica', loads the /invoice schema, and executes the call with the auth token managed by Jentic so the freelancer's accounting credentials never enter the agent context.

Example prompt: Use Jentic search for 'create an invoice in Cuentica' and execute the matching POST /invoice operation with the customer ID and line items.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/company` | Retrieve company business data |
| GET | `/company/serie` | Retrieve invoicing series |
| GET | `/customer` | List customers |
| GET | `/provider` | List providers |
| POST | `/provider` | Create a provider |
| PUT | `/provider/{id}` | Update a provider |
| DELETE | `/provider/{id}` | Delete a provider |

## Key resources

- **Company** — Read the configured company and invoicing series.
- **Customers** — Manage customer records used for invoicing.
- **Providers** — Manage supplier records used for expenses.
- **Invoices** — Issue and update invoices on a chosen series.
- **Expenses** — Record and categorise business expenses.
- **Accounts** — List bank accounts attached to the company.

## Why Jentic

- **Setup:** Wiring the Cuentica API by hand means setting the X-AUTH-TOKEN header on every call, targeting the api.cuentica.com host, and handling retries across invoice, expense, and customer routes yourself. Through Jentic you install once, import the Cuentica API from the API Directory, store the token once, and your agent calls it.
- **Permission scoping:** Cuentica puts the resource id in the URL path (`/provider/{id}`), so a rule can pin your agent to one provider: it can read and update that provider and nothing else. You choose the operations it may call, so destructive ones like deleting a provider are not included unless you add them.
- **Credential handling:** Your Cuentica X-AUTH-TOKEN is stored once, encrypted, by your own Jentic One instance and injected into the request header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create an invoice in Cuentica' or 'list customers', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Xero Accounting API** — Xero is an international accounting alternative covering similar invoice and expense flows.
- **Sage Business Cloud Accounting API** — Sage covers accounting for small businesses in many regions, overlapping with Cuentica's scope.
- **Stripe API** — Stripe processes the payments that Cuentica then records as invoiced and paid.

## FAQ

### What authentication does the Cuentica API use?

Cuentica uses an API key sent in the X-AUTH-TOKEN header on every request. Through Jentic the token is held in your encrypted Jentic One instance and injected at request time, so a bookkeeping agent never sees the raw key.

### Can I create an invoice with the Cuentica API?

Yes. POST /invoice creates a new invoice tied to a customer and an invoicing series. Look up the series with GET `/company/serie` and the customer with GET /customer first so the invoice attaches to the right entities.

### What are the rate limits for the Cuentica API?

Cuentica does not publish specific rate limits in the OpenAPI spec. Cap automated batches at a few requests per second per token and back off on 429 responses to avoid being throttled.

### How do I record a business expense with the Cuentica API through Jentic?

Run pip install jentic, search Jentic for 'record a business expense in Cuentica', load the schema for POST /expense, and execute it with the supplier ID, amount, and VAT. Jentic handles the X-AUTH-TOKEN header from your stored credentials.

### How do I keep customer records in sync with Cuentica?

Call GET /customer to list current records, compare against your source system on NIF, and use POST /customer or PUT `/customer/{id}` to add or update entries. Avoid duplicate NIFs because invoices reference the customer ID.

### Is the Cuentica API free?

The API is included with a paid Cuentica subscription. Cuentica plans are aimed at autonomos and small businesses in Spain, with pricing on cuentica.com rather than in the OpenAPI spec.

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

Yes. Because you run Jentic One yourself, your own rules decide which Cuentica operations the agent may call and which stored credentials it may use. Cuentica puts the resource id in the URL path, such as `/provider/{id}`, so a rule can pin the agent to a single provider or customer and let it read and update only that record. You can also grant just the operations you intend, so destructive calls like DELETE `/provider/{id}` are excluded unless you add them.
