close-vat-month5.29 KB
View saved version →
---
name: close-vat-month
description: Close a month's VAT with Essentio — read the month's Reported VAT and Income from Essentio's own reports, find the Drafts left and the documents still awaiting payment, and say plainly what is and is not done. Use this whenever the person asks what VAT they owe for a month or quarter, wants to prepare or check a VAT return, asks how much they earned in a month, or says they are closing or wrapping up a month's books — even when they do not name Essentio.
---
# Close a month's VAT
The Essentio connector (`essentio_*` tools) reads one Business's reports as Essentio's dashboard
computes them. The figures that matter here are Essentio's, not yours: a VAT figure you add up yourself
from documents can differ by rounding, by currency or by which documents count, and the person may file
it. So every figure you state comes from a tool's answer, quoted as it is, with its currency.
Nothing in Essentio "closes" a month: no tool locks it, files a VAT return or sends anything to a tax
authority. What this workflow does is gather what Essentio knows about the month and tell the person
what is finished and what is still open.
## 1. Settle the period
Take the month the person means as its first and last day, `YYYY-MM-DD` (for a quarter, its first and
last day). Essentio dates documents by the day in UTC. If the person did not say which month, ask.
## 2. Read the month's figures
Call `essentio_get_report` twice, with the same `from` and `to`:
- `report: "vat"` — the Reported VAT: the VAT of the Invoices and Credit Notes issued in the period,
in full, paid or not, a Credit Note subtracting. It answers `net`, `vat` and `bands` (the same split
by VAT category and rate).
- `report: "income"` — Income: the net amounts of the documents issued in the period, paid or not, a
Credit Note subtracting and a Proforma Invoice never converted adding only what was paid on it;
its `vat` beside it.
Both are in the Business's reporting currency (`currency`). Each answers
`other_currency_documents`: how many documents issued in the period are in another currency and are
left out of every figure. Essentio never converts them. When that count is above zero, say so, and list
them (step 3) so the person can account for them.
A Proforma Invoice carries no VAT, so it is in no VAT figure, paid or not.
## 3. Find what is still open
Use `essentio_search_documents`. Each answer is one page: when it carries a `next_cursor`, call again
with it until there is none, or your list is incomplete.
- **Drafts left**: `status: "draft"`. A Draft has no issue date, so a period cannot narrow it; list
them all, with their Client, Total, `due_date` and `created_at`, so the person can see which belong
to the month. A Draft counts in no report. Issuing one now gives it today's issue date, so it counts
in the month it is issued, not in the month being closed — say so before the person decides to
issue it.
- **Awaiting payment**: `status: "awaiting_payment"` — every issued Invoice and Proforma Invoice that
still takes a Payment, Overdue ones included. This does not change the Reported VAT, which counts
documents on issue, paid or not; it tells the person what is still owed to them. For what is
Overdue today, by Client, `essentio_get_report` with `report: "overdue"` gives Essentio's own totals.
- **Documents in another currency** (when `other_currency_documents` is above zero): list the ones
the count counts. The VAT report counts the Invoices and Credit Notes issued in the period, not
cancelled: search the period (`issued_from`, `issued_to`) with `document_type: "invoice"` and again
with `document_type: "credit_note"`, leave out any whose `status` is `cancelled`, and keep those whose
`currency` differs from the report's. The Income report's count also takes the Proforma Invoices
issued in the period and never converted into an Invoice: search the period again with
`document_type: "proforma"` and keep the one
Preview of the first 4,000 characters. Read full instructions →
draft-and-send-invoice10.7 KB
View saved version →
---
name: draft-and-send-invoice
description: Draft, check, issue and send an Invoice in Essentio through the Essentio connector's tools, in that order, stopping at a refusal. Use this whenever the person asks to invoice or bill a Client, charge someone for work or products, prepare or send an Invoice, Proforma Invoice, Quote or Credit Note, or says things like "invoice ACME 500 euros and send it" — even when they do not name Essentio or say "draft".
---
# Draft, check, issue and send an Invoice
The Essentio connector (`essentio_*` tools) acts for one Business, the one the person chose when they
connected it, with the Role they gave it there. Every figure on a document is computed by Essentio when
the Draft is saved: your job is to put the right Client and Lines into a Draft, let the person see
what Essentio computed, and then issue and send only what they approved.
Work in this order. Each step says why, so you can adapt when the person asks for less (only a Draft,
or issue without sending).
## 1. Find the Client
Call `essentio_search_clients` with `search` set to the name, email, VAT number or account code the
person gave. Use the `id` of the Client that matches.
- Several match: show their names and emails and ask which one. Guessing would bill the wrong Client.
- None matches: ask whether to create one. `essentio_create_client` needs an `email`, a `country` and a
`name` or `legal_name`; a VAT number is optional and is checked with the EU's VIES service. Create it
only after the person confirms the details.
If you need the Client's currency or payment terms, `essentio_get_client` reads them.
## 2. Read the Business's setup
Call `essentio_get_business_setup` once. It gives the reporting currency, the active VAT rates (each
with the VAT category a Line takes at it) and the bank accounts. Take each Line's `vat_rate` and
`vat_category` from those rates rather than from memory: a rate the Business does not use is a
different document. A 0 rate in a category other than `S` and `Z` needs a `vat_exemption_code`
(a VATEX code) — ask the person for it rather than choosing one.
When the person names a Product or service they sell, `essentio_search_products` gives its name, unit,
price and VAT rate.
## 3. Create the Draft
Call `essentio_create_draft` with:
- `document_type`: `invoice` unless the person asked for a `proforma`, `quote` or `credit_note`;
- `client_id` from step 1;
- `currency`: the Client's currency if it has one, otherwise the Business's; ask if the person said
another;
- `due_date` (YYYY-MM-DD): today plus the Client's payment terms, unless the person gave a date;
- `lines`: each with `description`, `quantity`, `unit_price` (VAT excluded) and `vat_rate`, all as
decimal strings such as `"500.00"` and `"19"` — never as numbers;
- a Discount, only when the person asked for one: `discount_percent` (a percentage of the Subtotal,
such as `"10"`) or `discount_amount` (an amount in the document's currency, such as `"50.00"`), as a
decimal string — never both. It is taken off the whole document before VAT, and only a document whose
Lines all have the same VAT rate and category takes one: if they differ, the Draft is refused at
`discount`, so tell the person rather than splitting it yourself.
A Draft has no number and no issue date, is not sent and counts in no report, so creating it commits
the person to nothing. A second identical `essentio_create_draft` within about ten minutes is answered
with the first Draft, marked as a replay, and creates nothing new; if the person really wants two
identical Drafts, send a fresh `idempotency_key` with the second.
## 4. Check the figures with the person
The person is shown the Draft as a card with its Client, Lines, VAT and Total — and, when it carries a
Discount, the Discount and the Subtotal after discount. Read the same answer yourself and compare it with
what they asked for: the Client's name, each Line, `vat_groups`, `subtotal`, `discount_percent`,
`disc
Preview of the first 4,000 characters. Read full instructions →