inv.bg MCP by usefulapi

v1.20.1
io.usefulapi/inv-bg Checked 2 days ago Published 1 day ago

Read inv.bg invoices, clients, items, payments and banking; create clients, items, invoices.

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

invbg_get_account Get account

The company (id, name, subdomain) and the user the API token belongs to. GET /account.

invbg_get_firm Get company

The issuing company's details: name, Bulstat, VAT registration and VAT number, address, MOL, contact email, custom properties. GET /firm.

invbg_list_invoices List invoices

List documents (tax invoices, proformas, debit and credit notes) with filters: type, number, issue-date range, amount ranges, payment status, client, draft/annulled, sent status, currency. Each row has number, client, totals, balance_paid, balance_due and dates. GET /invoices.

ParameterTypeDescription
amount_due_gtnumberOnly documents with an outstanding balance of at least this amount.
amount_due_ltnumberOnly documents with an outstanding balance of at most this amount.
amount_gtnumberOnly documents with a total of at least this amount.
amount_ltnumberOnly documents with a total of at most this amount.
client_idintegerOnly documents issued to this client (invbg_list_clients).
client_namestringClient name filter; % matches any run of characters, _ one character.
currencystringOnly documents in this currency.
date_fromstringOnly documents dated on or after this date, yyyy-mm-dd.
date_tostringOnly documents dated on or before this date, yyyy-mm-dd.
is_annulledbooleantrue = only annulled documents, false = none.
is_draftbooleantrue = only drafts, false = no drafts.
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.
numberstringDocument number (as printed, e.g. 0000000024).
orderstringSort direction (default desc).
order_bystringField to sort by (for example id, date or name; see the vendor reference).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
per_pageintegerResults per page, 1-100 (default 25).
searchstringFree-text search over the results.
send_statusarrayEmail status(es) to include.
statusarrayPayment statuses to include. Use ["unpaid", "partially-paid"] to find open receivables.
typearrayDocument types: dan = tax invoice, prof = proforma, deb = debit note, cred = credit note.

invbg_get_invoice Get invoice

One document by id: number, type, issuer and recipient, line items, VAT, totals, balance_paid and balance_due, dates, bank accounts, sent/confirmation status. Optionally with its comments. GET /invoices/{id}.

ParameterTypeDescription
invoice_id *integerinv.bg document id (the id field of invbg_list_invoices, not the printed number).
include_commentsbooleanAlso return the document's comments.
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.

invbg_list_invoice_types List document types

All document types of this company (tax invoice, proforma, debit/credit note and any custom types) with their codes. GET /invoices/types.

invbg_get_next_invoice_number Get next invoice number

The next free document number of the default number set for a document type. Read-only: it does not reserve the number. GET /invoices/free-number.

ParameterTypeDescription
typestringDocument type (default: tax invoice).

invbg_list_number_sets List number sets

The company's invoice number sets (separate numbering series) with ids; pass an id as number_set to invbg_create_invoice. GET /invoices/number-sets.

ParameterTypeDescription
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
per_pageintegerResults per page, 1-100 (default 25).

invbg_list_payment_methods List payment methods

The payment method codes a document accepts (cash, bank, card, ...) with their names. GET /invoices/payment-methods.

ParameterTypeDescription
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.

invbg_list_vat_exemption_reasons List VAT exemption reasons

The legal reasons for issuing a document without VAT (use one as vat_exemption_reason in invbg_create_invoice). GET /invoices/without-vat-reasons.

ParameterTypeDescription
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.

invbg_list_clients List clients

List or search clients (customers): name, Bulstat, VAT number, address, MOL, whether it is a person. GET /clients.

ParameterTypeDescription
bulstatstringFilter by EIK/Bulstat.
codestringFilter by the client code.
is_personbooleantrue = individuals only, false = companies only.
is_reg_vatbooleantrue = VAT-registered clients only.
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.
namestringFilter by client name.
orderstringSort direction (default desc).
order_bystringField to sort by (for example id, date or name; see the vendor reference).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
per_pageintegerResults per page, 1-100 (default 25).
searchstringFree-text search over the results.
vat_numberstringFilter by VAT number.

invbg_get_client Get client

One client by id with all stored details (names in both languages, Bulstat, VAT, address, MOL, code, custom properties). GET /clients/{id}.

ParameterTypeDescription
client_id *integerinv.bg client id (invbg_list_clients).
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.

invbg_list_client_contacts List client contacts

Contact people of a client (or of all clients) with their names and roles. GET /client-contacts.

ParameterTypeDescription
client_idintegerOnly the contacts of this client.
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
per_pageintegerResults per page, 1-100 (default 25).
searchstringFree-text search over the results.

invbg_list_items List items

The product/service catalogue: name, price, currency, unit, tags. GET /items.

ParameterTypeDescription
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.
orderstringSort direction (default desc).
order_bystringField to sort by (for example id, date or name; see the vendor reference).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
per_pageintegerResults per page, 1-100 (default 25).
searchstringFree-text search over the results.
tag_namestringOnly items with this tag.

invbg_get_item Get item

One catalogue item by id. GET /items/{id}.

ParameterTypeDescription
item_id *integerinv.bg item id (invbg_list_items).
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.

invbg_list_item_units List units of measure

Units of measure accepted as quantity_unit on items and invoice lines. GET /items/units.

ParameterTypeDescription
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.

invbg_list_payments List payments

Recorded payments (income and expense) with amount, method, date, counterparty, how much is allocated to invoices (amount_used) and what is left (amount_left). GET /payments.

ParameterTypeDescription
amount_gtnumberAmount of at least this value.
amount_ltnumberAmount of at most this value.
contragentstringCounterparty name; % matches any run of characters.
contragent_idintegerCounterparty (client) id.
is_expensebooleantrue = expenses only, false = income only.
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.
orderstringSort direction (default desc).
order_bystringField to sort by (for example id, date or name; see the vendor reference).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
paid_fromstringPaid on or after this date.
paid_tostringPaid on or before this date.
payment_processorarrayHow the payment was received.
per_pageintegerResults per page, 1-100 (default 25).
searchstringFree-text search over the results.

invbg_get_payment Get payment

One payment by id with its allocations to invoices (invoice_payments). GET /payments/{id}.

ParameterTypeDescription
payment_id *integerinv.bg payment id (invbg_list_payments).

invbg_list_bank_accounts List bank accounts

The company's bank accounts (alias, bank, IBAN, BIC, currency). GET /bank/accounts.

ParameterTypeDescription
languagestringLanguage of names in the reply: bg (default) or en, where the record has both.
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
per_pageintegerResults per page, 1-100 (default 25).

invbg_list_bank_transactions List bank transactions

Imported bank transactions with amount, date, counterparty, and whether they are linked to a document. Useful for reconciliation (linked=false = unmatched). GET /bank/transactions.

ParameterTypeDescription
amount_gtnumberAmount of at least this value.
amount_ltnumberAmount of at most this value.
bank_account_idarrayOnly these bank accounts (invbg_list_bank_accounts).
date_fromstringOn or after this date, yyyy-mm-dd.
date_tostringOn or before this date, yyyy-mm-dd.
linkedbooleantrue = only transactions linked to documents, false = only unlinked ones.
orderstringSort direction (default desc).
order_bystringField to sort by (for example id, date or name; see the vendor reference).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
per_pageintegerResults per page, 1-100 (default 25).
searchstringFree-text search over the results.
typestringdeb = debit (money out), cred = credit (money in).

invbg_list_cashboxes List cashboxes

The company's cash registers (cashboxes) with names and balances. GET /cashboxes.

ParameterTypeDescription
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
per_pageintegerResults per page, 1-100 (default 25).
searchstringFree-text search over the results.

invbg_get_exchange_rate Get exchange rate

The exchange rate of a currency to BGN on a date (default: today), as inv.bg uses it for documents. GET /currency/rates/{currency}.

ParameterTypeDescription
currency *stringCurrency, ISO 4217 code such as BGN or EUR.
datestringRate date, yyyy-mm-dd (default today).

invbg_create_client Create client

WRITE: add a company client (name, Bulstat, VAT, address, MOL). Check invbg_list_clients first to avoid a duplicate. For an individual (EGN) issue the document with invbg_create_invoice and is_to_person instead. POST /clients.

ParameterTypeDescription
bulstat *stringEIK/Bulstat of the company.
name *stringCompany name.
addressstring
codestringYour own unique client code.
countrystringCountry name or code as inv.bg stores it, e.g. BG.
delivery_addressstring
is_reg_vatbooleanWhether the company is VAT-registered (default false).
molstringAccountable person (MOL).
townstring
vat_numberstringVAT number; required when is_reg_vat is true.

invbg_update_client Update client

WRITE: change fields of an existing client (only the fields you pass are changed). PATCH /clients/{id}.

ParameterTypeDescription
client_id *integerinv.bg client id.
addressstring
bulstatstring
codestring
countrystring
delivery_addressstring
is_reg_vatboolean
molstring
namestring
townstring
vat_numberstring

invbg_create_item Create item

WRITE: add a product or service to the catalogue (name, price, unit). POST /items.

ParameterTypeDescription
name *stringItem name.
price *numberPrice per unit.
quantity_unit *stringUnit of measure (invbg_list_item_units).
currencystringPrice currency (default BGN).
name_enstringItem name in English.
tagsarrayTags to attach.

invbg_create_invoice Create invoice

WRITE: create a document (tax invoice by default; proforma, debit/credit note via type). It is saved as a DRAFT unless draft is false: an issued document takes the next legal number and cannot be undone through this tool. Address it to an existing client_id, or give to_name + to_address (+ to_mol and to_bulstat for a company, to_egn for a person) and inv.bg matches or creates the client from those details (an existing client matched by Bulstat or VAT number is UPDATED with the address, MOL and other details you pass). VAT: set vat_percent on the document, or on every item. POST /invoices.

ParameterTypeDescription
items *arrayLine items.
client_idintegerExisting client id (invbg_list_clients). Then the to_* fields are ignored.
currencystringDocument currency (default BGN).
currency_ratenumberExchange rate to BGN (BGN/XXX). Required when currency is not BGN: take it from invbg_get_exchange_rate.
date_createstringIssue date (default now).
date_eventstringTax event date (default: issue date).
date_maturestringDue date.
draftbooleanSave as a draft (default true). Pass false to issue the document and consume its number.
is_to_personbooleantrue when the recipient is an individual (then to_egn is needed).
items_with_vatbooleantrue if item prices already include VAT (default false).
notesstringNotes printed on the document.
number_setintegerNumber set id to take the number from (invbg_list_number_sets); omit unless you use several series.
payment_methodstringHow the client pays.
po_numberstringThe buyer's purchase order number.
reduction_percentnumberDiscount on the whole document in percent.
to_addressstringRecipient address (required when no client_id).
to_bulstatstringRecipient EIK/Bulstat (companies).
to_countrystringRecipient country, ISO 3166-1 alpha-2.
to_egnstringRecipient EGN, 10 digits (individuals), as text so leading zeros survive.
to_is_reg_vatbooleanWhether the recipient company is VAT-registered.
to_molstringRecipient accountable person (MOL); required for companies when no client_id.
to_namestringRecipient name (when no client_id).
to_townstring
to_vat_numberstringRecipient VAT number (needed when to_is_reg_vat is true).
typestringdan = tax invoice (default), prof = proforma, deb = debit note, cred = credit note.
vat_exemption_reasonstringWhy no VAT is charged (when VAT is 0); see invbg_list_vat_exemption_reasons.
vat_percentnumberVAT rate for the whole document in percent; ignored where items carry their own vat_percent.

invbg_send_invoice_email Email invoice

WRITE: email a document to a recipient (as a download link or an attached file). The email goes out immediately and cannot be recalled. POST /invoices/{id}/emails.

ParameterTypeDescription
email *stringRecipient email address.
invoice_id *integerinv.bg document id.
deliverystringlink = a download link (default), file = attached PDF.
languagestringLanguage of the document (default: the document's own).
messagestringMessage text placed in the email.
namestringRecipient name used in the text.
subjectstringEmail subject (default: the document number).

invbg_record_invoice_payment Record invoice payment

WRITE: record a payment received for a document and allocate it, which updates the document's balance_paid/balance_due and payment status. Two calls: POST /payments, then POST /payments/{id}/invoices. If the allocation fails the payment stays recorded: the error names its id (see invbg_get_payment).

ParameterTypeDescription
amount *numberAmount received and allocated to this document.
currency *stringCurrency of the payment (required by inv.bg), e.g. BGN or EUR.
currency_rate *numberExchange rate to BGN (required by inv.bg): 1 for BGN; otherwise the rate from invbg_get_exchange_rate.
invoice_id *integerinv.bg document id the payment is for.
payment_processor *stringHow the money was received.
contragent_idintegerThe paying client's id.
notestringNote stored on the payment.
paid_atstringWhen it was paid (default now).