Oblio
v0.1.3Issue 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.
| Parameter | Type | Description |
|---|---|---|
number * | string | The document number as text, without its series: "0042" is not 42. |
series_name * | string | The document's series, exactly as list_series shows it. |
expect_total | string | The 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…
| Parameter | Type | Description |
|---|---|---|
amount * | string | The 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 * | string | The day it was paid, YYYY-MM-DD. |
number * | string | The document number as text, without its series: "0042" is not 42. |
series_name * | string | The document's series, exactly as list_series shows it. |
type * | string | How 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_number | string | The payment's own reference ("OP 7001"), required for every type but Chitanta. |
idempotency_key | string | Leave 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… |
mentions | string | |
receipt_series | string | For 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.
| Parameter | Type | Description |
|---|---|---|
client * | object | The buyer. |
products * | array | |
series_name * | string | A series from list_series, of the document's type. |
collect | object | Issue the invoice already paid. |
collect_date | string | Collection date, YYYY-MM-DD. |
contract_number | string | The contract reference, BT-12 on the e-Factura. |
currency | string | |
delivery_date | string | Delivery date, YYYY-MM-DD. |
due_date | string | Due date, YYYY-MM-DD. |
exchange_rate | string | Oblio's default: the rate in the company settings. |
idempotency_key | string | Oblio 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_note | string | Not shown to the client. |
issue_date | string | YYYY-MM-DD. Oblio's default: today. |
issuer_name | string | Intocmit de. |
language | string | Two letters; Oblio's default: "RO". |
mentions | string | Printed on the document. |
order_number | string | The buyer's order reference, BT-13 on the e-Factura. |
precision | integer | Decimals kept on prices, 2 to 4. |
send_email | boolean | Oblio emails the document to the client (client.email, else the one saved in Oblio); the answer's emailedTo says where. Default: no. |
use_stock | boolean | Take the goods out of stock, with stock enabled. |
work_station | string | Oblio'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.
| Parameter | Type | Description |
|---|---|---|
client * | object | The buyer. |
products * | array | |
series_name * | string | A series from list_series, of the document's type. |
contract_number | string | The contract reference, BT-12 on the e-Factura. |
currency | string | |
due_date | string | Due date, YYYY-MM-DD. |
exchange_rate | string | Oblio's default: the rate in the company settings. |
idempotency_key | string | Oblio 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_note | string | Not shown to the client. |
issue_date | string | YYYY-MM-DD. Oblio's default: today. |
issuer_name | string | Intocmit de. |
language | string | Two letters; Oblio's default: "RO". |
mentions | string | Printed on the document. |
order_number | string | The buyer's order reference, BT-13 on the e-Factura. |
precision | integer | Decimals kept on prices, 2 to 4. |
send_email | boolean | Oblio emails the document to the client (client.email, else the one saved in Oblio); the answer's emailedTo says where. Default: no. |
work_station | string | Oblio'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.
| Parameter | Type | Description |
|---|---|---|
number * | string | The document number as text, without its series: "0042" is not 42. |
series_name * | string | The document's series, exactly as list_series shows it. |
expect_total | string | The 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.
| Parameter | Type | Description |
|---|---|---|
number * | string | The document number as text, without its series: "0042" is not 42. |
series_name * | string | The document's series, exactly as list_series shows it. |
get_proforma Get a proforma
One proforma by series and number.
| Parameter | Type | Description |
|---|---|---|
number * | string | The document number as text, without its series: "0042" is not 42. |
series_name * | string | The 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.
| Parameter | Type | Description |
|---|---|---|
invoice_series * | string | The INVOICE series to issue into, from list_series. |
proforma_number * | string | The document number as text, without its series: "0042" is not 42. |
proforma_series * | string | The document's series, exactly as list_series shows it. |
idempotency_key | string | Oblio 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.
| Parameter | Type | Description |
|---|---|---|
client_cif | string | The client's CIF. |
limit | integer | Return at most this many rows of the page. |
name | string | Part of the client's name. |
offset | integer | Oblio 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.
| Parameter | Type | Description |
|---|---|---|
client_cif | string | The buyer's CIF as it is saved in Oblio (list_clients shows it). |
client_code | string | The buyer's code in Oblio's client list. |
client_email | string | The buyer's e-mail as it is saved in Oblio. |
cursor | string | The nextCursor of the previous page, with the same filters. Leave it out for the first page. |
efactura | array | Only 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_after | string | Start of the period, YYYY-MM-DD (Oblio's issuedAfter, its start date). |
issued_before | string | End of the period, YYYY-MM-DD (Oblio's issuedBefore, its end date). |
limit | integer | Invoices read per page, at most 100. |
order | string | By the order Oblio created the documents in. Default: newest first. |
series_name | string | The invoice series, exactly as list_series shows it. |
status | string | "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.
| Parameter | Type | Description |
|---|---|---|
code | string | The product's code. |
limit | integer | Return at most this many rows of the page. |
name | string | Part of the product's name. |
offset | integer | Oblio 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.
| Parameter | Type | Description |
|---|---|---|
number * | string | The document number as text, without its series: "0042" is not 42. |
series_name * | string | The document's series, exactly as list_series shows it. |
expect_total | string | The 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…
| Parameter | Type | Description |
|---|---|---|
number * | string | The document number as text, without its series: "0042" is not 42. |
series_name * | string | The document's series, exactly as list_series shows it. |
expect_total | string | The total the invoice must have ("121.00"); when it differs nothing is changed. Recommended: a number can name the wrong invoice. |
idempotency_key | string | Leave 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_payments | boolean | Remove the payments recorded on the reversed invoice (Oblio's refund). Default: keep them, as when the money is refunded separately. |
storno_series | string | The invoice series the reversing invoice is issued in, from list_series. Default: the reversed invoice's own series. |