Oblio

v0.1.3
com.foreverworks/oblio Checked 1 day ago Published 5 days ago

Issue and track a Romanian company's invoices on Oblio, with totals computed as ANAF checks them.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

cancel_invoice Cancel an invoice

Mark an invoice cancelled. Reversible with restore_invoice, and the number stays in the series, which is what a tax authority expects of an issued document. Prefer this over delete_invoice. The invoice is read first: the answer says what it totalled (before), and with expect_total a call whose number names an invoice of another total changes nothing. Moves money or makes a legal document: the client asks the user to approve each call.

ParameterTypeDescription
number *stringThe document number as text, without its series: "0042" is not 42.
series_name *stringThe document's series, exactly as list_series shows it.
expect_totalstringThe total the invoice must have ("121.00"); when it differs nothing is changed. Recommended: a number can name the wrong invoice.

collect_invoice Record a payment on an invoice

Record a payment received against an issued invoice: how it was paid, the amount in the invoice's currency (a decimal STRING), the day, and the payment's own reference. The invoice is read first: a cancelled one, one paid in full, or an amount over what it still owes is refused with nothing recorded, and a payment already on it with the same type, reference, amount and date is not recorded again (the answer says alreadyRecorded). The answer carries the balance before and after. list_invoices with status unpaid finds what is owed. Moves money or makes a legal document: the client asks the user…

ParameterTypeDescription
amount *stringThe amount paid, in the invoice's currency, as a decimal STRING ("1210.00"), at most two decimals and at most what the invoice still owes.
date *stringThe day it was paid, YYYY-MM-DD.
number *stringThe document number as text, without its series: "0042" is not 42.
series_name *stringThe document's series, exactly as list_series shows it.
type *stringHow it was paid, in Oblio's words: "Ordin de plata" for a bank transfer, "Card", "Chitanta" for cash with a receipt, and so on.
document_numberstringThe payment's own reference ("OP 7001"), required for every type but Chitanta.
idempotency_keystringLeave it out: a retry with the same arguments then finds the payment if it landed and records nothing. Give a key of your own only to record a second payment identical in type, reference, amount and d…
mentionsstring
receipt_seriesstringFor a Chitanta: the receipt series from list_series. Oblio numbers the receipt.

create_invoice Issue an invoice

Issue a new invoice. A real fiscal document: it takes the next number in the series, and in Romania it is what gets reported to ANAF. Prices, quantities and rates are decimal STRINGS. Every line states vat_included. The buyer's CIF or CNP and IBAN are checked by their control digits. The company is the one in app.json; the input has no field for it. The answer carries computedTotal (exact, EN 16931 rounding), oblioTotal (the document read back, which must match) and the idempotency_key it was sent with. Moves money or makes a legal document: the client asks the user to approve each call.

ParameterTypeDescription
client *objectThe buyer.
products *array
series_name *stringA series from list_series, of the document's type.
collectobjectIssue the invoice already paid.
collect_datestringCollection date, YYYY-MM-DD.
contract_numberstringThe contract reference, BT-12 on the e-Factura.
currencystring
delivery_datestringDelivery date, YYYY-MM-DD.
due_datestringDue date, YYYY-MM-DD.
exchange_ratestringOblio's default: the rate in the company settings.
idempotency_keystringOblio refuses a second document with the same key. Leave it out: the key is then derived from the document's content and issue date, so an identical retry cannot issue twice. Give one only to issue a…
internal_notestringNot shown to the client.
issue_datestringYYYY-MM-DD. Oblio's default: today.
issuer_namestringIntocmit de.
languagestringTwo letters; Oblio's default: "RO".
mentionsstringPrinted on the document.
order_numberstringThe buyer's order reference, BT-13 on the e-Factura.
precisionintegerDecimals kept on prices, 2 to 4.
send_emailbooleanOblio emails the document to the client (client.email, else the one saved in Oblio); the answer's emailedTo says where. Default: no.
use_stockbooleanTake the goods out of stock, with stock enabled.
work_stationstringOblio's default: "Sediu".

create_proforma Issue a proforma

Issue a new proforma, which is not a fiscal document but takes a number in its series. Prices, quantities and rates are decimal STRINGS. Every line states vat_included. The buyer's CIF or CNP and IBAN are checked by their control digits. The company is the one in app.json; the input has no field for it. The answer carries computedTotal (exact, EN 16931 rounding), oblioTotal (the document read back, which must match) and the idempotency_key it was sent with.

ParameterTypeDescription
client *objectThe buyer.
products *array
series_name *stringA series from list_series, of the document's type.
contract_numberstringThe contract reference, BT-12 on the e-Factura.
currencystring
due_datestringDue date, YYYY-MM-DD.
exchange_ratestringOblio's default: the rate in the company settings.
idempotency_keystringOblio refuses a second document with the same key. Leave it out: the key is then derived from the document's content and issue date, so an identical retry cannot issue twice. Give one only to issue a…
internal_notestringNot shown to the client.
issue_datestringYYYY-MM-DD. Oblio's default: today.
issuer_namestringIntocmit de.
languagestringTwo letters; Oblio's default: "RO".
mentionsstringPrinted on the document.
order_numberstringThe buyer's order reference, BT-13 on the e-Factura.
precisionintegerDecimals kept on prices, 2 to 4.
send_emailbooleanOblio emails the document to the client (client.email, else the one saved in Oblio); the answer's emailedTo says where. Default: no.
work_stationstringOblio's default: "Sediu".

delete_invoice Delete an invoice permanently

Remove an invoice from Oblio for good. NO INVERSE. Oblio allows it only for the last number in a series, and anything already sent to ANAF stays there, so the two can end up out of step. cancel_invoice is almost always the right call instead. The invoice is read first: the answer says what it totalled (before), and with expect_total a call whose number names an invoice of another total changes nothing. Moves money or makes a legal document: the client asks the user to approve each call.

ParameterTypeDescription
number *stringThe document number as text, without its series: "0042" is not 42.
series_name *stringThe document's series, exactly as list_series shows it.
expect_totalstringThe total the invoice must have ("121.00"); when it differs nothing is changed. Recommended: a number can name the wrong invoice.

get_invoice Get an invoice

One invoice by series and number: its PDF and e-Factura links, and the payments recorded against it.

ParameterTypeDescription
number *stringThe document number as text, without its series: "0042" is not 42.
series_name *stringThe document's series, exactly as list_series shows it.

get_proforma Get a proforma

One proforma by series and number.

ParameterTypeDescription
number *stringThe document number as text, without its series: "0042" is not 42.
series_name *stringThe document's series, exactly as list_series shows it.

health Health

Check that the integration is alive and say so in detail: the Oblio account, the company CIF every call acts on, whether that CIF is one this account can actually reach, and the companies it can. Always asks Oblio, never the cache. Run this before concluding the MCP is broken.

invoice_from_proforma Invoice an existing proforma

Issue an invoice that references an existing proforma, so the two are linked in Oblio. Client, lines and total are the proforma's; nothing is retyped. The proforma is read first and returned as fromProforma, and the new invoice's total is held to it. Moves money or makes a legal document: the client asks the user to approve each call.

ParameterTypeDescription
invoice_series *stringThe INVOICE series to issue into, from list_series.
proforma_number *stringThe document number as text, without its series: "0042" is not 42.
proforma_series *stringThe document's series, exactly as list_series shows it.
idempotency_keystringOblio refuses a second document with the same key. Leave it out: the key is then derived from the document's content and issue date, so an identical retry cannot issue twice. Give one only to issue a…

list_clients List clients

The company's saved clients, optionally filtered by name or by the client's own CIF. Never cached.

ParameterTypeDescription
client_cifstringThe client's CIF.
limitintegerReturn at most this many rows of the page.
namestringPart of the client's name.
offsetintegerOblio answers 250 rows a page; pass the nextOffset a full page reports to read the next.

list_companies List companies

The companies this Oblio account is attached to. Only the one whose CIF is in app.json is acted on; this is how you check that the right one is configured. Remembered for 10 minutes; `asOf` says when it was read from Oblio.

list_invoices List issued invoices

The company's issued invoices, newest first, filtered by issue date, series, buyer (CIF, e-mail or code; list_clients finds them by name), status ("unpaid", "paid", "cancelled") and e-Factura state. Each row: series and number, dates, currency, total with VAT as Oblio wrote it, whether it is cancelled, the buyer, the payments recorded against it, its e-Factura state and its PDF link. Drafts are never listed. Pass nextCursor back, with the same filters, for the next page; get_invoice reads one invoice.

ParameterTypeDescription
client_cifstringThe buyer's CIF as it is saved in Oblio (list_clients shows it).
client_codestringThe buyer's code in Oblio's client list.
client_emailstringThe buyer's e-mail as it is saved in Oblio.
cursorstringThe nextCursor of the previous page, with the same filters. Leave it out for the first page.
efacturaarrayOnly invoices in these e-Factura states: "not_sent", "processing" (in SPV, not yet answered), "sent", "errors" (not sent because of errors). Checked page by page after Oblio answers; scanned says how…
issued_afterstringStart of the period, YYYY-MM-DD (Oblio's issuedAfter, its start date).
issued_beforestringEnd of the period, YYYY-MM-DD (Oblio's issuedBefore, its end date).
limitintegerInvoices read per page, at most 100.
orderstringBy the order Oblio created the documents in. Default: newest first.
series_namestringThe invoice series, exactly as list_series shows it.
statusstring"unpaid" or "paid" (collected in Oblio), both without cancelled invoices, or "cancelled". Leave it out for all.

list_products List products

The company's saved products and services, optionally filtered by name or code. Never cached.

ParameterTypeDescription
codestringThe product's code.
limitintegerReturn at most this many rows of the page.
namestringPart of the product's name.
offsetintegerOblio answers 250 rows a page; pass the nextOffset a full page reports to read the next.

list_series List document series

The document series configured for the company, with the number each will issue next. Every issuing tool needs one of these names. Forgotten after any document this server issues or deletes. Remembered for 10 minutes; `asOf` says when it was read from Oblio.

list_vat_rates List VAT rates

The VAT rates available to the company: a line's vat_name and vat_percentage come from here. Remembered for 10 minutes; `asOf` says when it was read from Oblio.

restore_invoice Restore a cancelled invoice

Undo cancel_invoice. The invoice is read first: the answer says what it totalled (before), and with expect_total a call whose number names an invoice of another total changes nothing. Moves money or makes a legal document: the client asks the user to approve each call.

ParameterTypeDescription
number *stringThe document number as text, without its series: "0042" is not 42.
series_name *stringThe document's series, exactly as list_series shows it.
expect_totalstringThe total the invoice must have ("121.00"); when it differs nothing is changed. Recommended: a number can name the wrong invoice.

reverse_invoice Reverse an invoice (storno)

Issue a reversing invoice (storno) for an issued invoice, through Oblio's reference flow: a new invoice that references it, every line negated, its total exactly the reversed invoice's total negated. A real fiscal document, reported to ANAF like any invoice; the reversed invoice stays issued. Use it for an invoice already sent to the client or to ANAF; cancel_invoice is for one nobody has received. The invoice is read first: a cancelled one, or one that is itself a reversal, is refused. The answer carries computedTotal and oblioTotal (the storno read back, which must match) and the idempotency…

ParameterTypeDescription
number *stringThe document number as text, without its series: "0042" is not 42.
series_name *stringThe document's series, exactly as list_series shows it.
expect_totalstringThe total the invoice must have ("121.00"); when it differs nothing is changed. Recommended: a number can name the wrong invoice.
idempotency_keystringLeave it out: the key is derived from the invoice being reversed, so no retry can reverse it twice. Give one only to reverse the same invoice again on purpose, after the first reversal was cancelled.
remove_paymentsbooleanRemove the payments recorded on the reversed invoice (Oblio's refund). Default: keep them, as when the money is refunded separately.
storno_seriesstringThe invoice series the reversing invoice is issued in, from list_series. Default: the reversed invoice's own series.