Daftra MCP by usefulapi

v1.7.1
io.usefulapi/daftra Checked 2 days ago Published 1 day ago

Read clients, invoices, expenses and suppliers; create clients, invoices and expenses in Daftra.

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

daftra_get_site_info Get account info

The Daftra account this API key belongs to: id, business name, subdomain, country, timezone, date format, default currency and subscription expiry. Check the date format and currency here before creating records. GET /site_info.

daftra_list_clients List clients

List clients (customers), 20 per page by default. Search by name, number, email or phone with `keywords`. Each item is wrapped in a `Client` object. GET /clients.

ParameterTypeDescription
assign_staff_idintegerOnly clients assigned to this staff member.
keywordsstringSearch by id, client number, business name, first/last name, email or phone.
limitintegerResults per page, 1-100 (default 20).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.

daftra_get_client Get client

One client by id (contact details, balance settings, currency, address). GET /clients/{id}.

ParameterTypeDescription
client_id *integerDaftra client id.

daftra_list_invoices List invoices

List sales invoices (and debit notes), most recent first. Filter by client, payment status, dates or free text. By default each item has the header and client; set recursive=1 for line items, payments and taxes. GET /invoices.

ParameterTypeDescription
client_idintegerOnly invoices of this client.
currency_codestringOnly invoices in this currency, e.g. USD.
date_fromstringInvoice date from, yyyy-mm-dd.
date_tostringInvoice date to, yyyy-mm-dd.
directionstringSort direction (default DESC).
due_date_fromstringDue date from, yyyy-mm-dd.
due_date_tostringDue date to, yyyy-mm-dd.
keywordsstringSearch client name, client number, email, invoice number and order number.
limitintegerResults per page, 1-100 (default 20).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
payment_statusinteger0 unpaid, 1 partially paid, 2 paid, 4 overpaid, -1 draft, -2 due, -3 overdue, 3 subscriptions.
recursiveinteger-1 header only, 0 header + client (default), 1 also line items, payments, taxes.
sortstringField to sort by (default invoice date).
summary_total_fromnumberMinimum invoice total.
summary_total_tonumberMaximum invoice total.

daftra_get_invoice Get invoice

One standard invoice by id with line items, payments, taxes, custom fields and client. Other document types (estimate, credit note) answer 404. GET /invoices/{id}.

ParameterTypeDescription
invoice_id *integerDaftra invoice id.

daftra_list_estimates List estimates

List estimates (quotes), most recent first. Filter by client, status, dates or free text. GET /estimates.

ParameterTypeDescription
client_idintegerOnly estimates of this client.
currency_codestringOnly estimates in this currency.
date_fromstringEstimate date from, yyyy-mm-dd.
date_tostringEstimate date to, yyyy-mm-dd.
limitintegerResults per page, 1-100 (default 20).
namestringSearch client name, number, email and estimate number.
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
payment_statusintegerEstimate status id; -1 returns only drafts.

daftra_get_estimate Get estimate

One estimate (quote) by id with line items, taxes and client. GET /estimates/{id}.

ParameterTypeDescription
estimate_id *integerDaftra estimate id.

daftra_list_invoice_payments List invoice payments

List payments recorded against invoices, most recent first. Opening-balance and client-credit payments are excluded. GET /invoice_payments.

ParameterTypeDescription
amount_fromnumberMinimum amount.
amount_tonumberMaximum amount.
client_idintegerOnly payments of this client.
date_fromstringPayment date from (account date format).
date_tostringPayment date to (account date format).
directionstringSort direction (default desc).
limitintegerResults per page, 1-100 (default 20).
nostringOnly payments of the invoice with this number.
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
payment_methodstringPayment method, e.g. cash, bank, cheque, client_credit.
sortstringField to sort by, e.g. date, amount, id (default id).
statusinteger0 not completed, 1 completed (see Daftra for other values).

daftra_list_client_payments List client payments

List payments received from clients, most recent first. Opening-balance and client-credit payments are excluded. GET /client_payments.

ParameterTypeDescription
amount_fromnumberMinimum amount.
amount_tonumberMaximum amount.
client_idintegerOnly payments of this client.
date_fromstringPayment date from (account date format).
date_tostringPayment date to (account date format).
directionstringSort direction (default desc).
limitintegerResults per page, 1-100 (default 20).
nostringOnly payments of the invoice with this number.
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
payment_methodstringPayment method, e.g. cash, bank, cheque, client_credit.
sortstringField to sort by, e.g. date, amount, id (default id).
statusinteger0 not completed, 1 completed (see Daftra for other values).

daftra_list_products List products

List products and services (name, code, price, stock) ordered by name. Search by name, code, barcode or tag with `keywords`. Each item is a `Product` object. GET /products.

ParameterTypeDescription
categoryintegerOnly products in this category id.
keywordsstringSearch product name, code, barcode and tags.
limitintegerResults per page, 1-100 (default 20).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
product_codestringExact product code.
statusinteger1 available, 2 low stock, 3 out of stock, 4 inactive, 5 suspended.
supplier_idintegerOnly products of this supplier.

daftra_get_product Get product

One product by id with images and categories. GET /products/{id}.

ParameterTypeDescription
product_id *integerDaftra product id.

daftra_list_product_categories List product categories

List product categories with their parent category. GET /product_categories.

ParameterTypeDescription
limitintegerResults per page, 1-100 (default 20).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
parent_idintegerOnly subcategories of this category id.

daftra_list_stores List stores (warehouses)

List stores (warehouses) the key's user may view. Use the ids to filter stock transactions. GET /stores.

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

daftra_list_stock_transactions List stock transactions

List processed stock movements (in, out, transfers), most recent first. Filter by product, store or date range. GET /stock_transactions.

ParameterTypeDescription
date_fromstringReceived date from (account date format).
date_tostringReceived date to (account date format).
limitintegerResults per page, 1-100 (default 20).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
product_idintegerOnly movements of this product.
store_idintegerOnly movements in this store (warehouse).

daftra_list_treasuries List treasuries and bank accounts

List treasuries and bank accounts the key's user may view, with balances. Use the ids when recording expenses. GET /treasuries.

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

daftra_list_expenses List expenses

List expenses (money out), most recent first, with amount, vendor, category and treasury. Filter by dates, amount, category, vendor or status. GET /expenses.

ParameterTypeDescription
amount_fromnumberMinimum amount.
amount_tonumberMaximum amount.
date_fromstringDate from (account date format).
date_tostringDate to (account date format).
directionstringSort direction (default desc).
expense_category_idintegerOnly this category id.
limitintegerResults per page, 1-100 (default 20).
notestringWords in the description (all must match).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
sortstringField to sort by, e.g. date, amount, id.
statusstringissued (posted) or draft.
vendorstringExact vendor name.

daftra_get_expense Get expense

One expense by id. GET /expenses/{id}.

ParameterTypeDescription
expense_id *integerDaftra expense id.

daftra_list_incomes List incomes

List incomes (money in that is not an invoice payment), most recent first. Same filters as expenses. GET /incomes.

ParameterTypeDescription
amount_fromnumberMinimum amount.
amount_tonumberMaximum amount.
date_fromstringDate from (account date format).
date_tostringDate to (account date format).
directionstringSort direction (default desc).
expense_category_idintegerOnly this category id.
limitintegerResults per page, 1-100 (default 20).
notestringWords in the description (all must match).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
sortstringField to sort by, e.g. date, amount, id.
statusstringissued (posted) or draft.
vendorstringExact vendor name.

daftra_list_taxes List taxes

List the taxes configured for the account (name, rate, active). Use the ids as tax1/tax2 on invoice lines. All taxes come in one reply. GET /taxes.

ParameterTypeDescription
is_activebooleantrue only active taxes, false only inactive; omit for all.

daftra_list_purchase_invoices List purchase invoices

List purchase invoices (bills from suppliers), most recent first. Search by supplier or filter by payment status. GET /purchase_invoices.

ParameterTypeDescription
keywordsstringSearch supplier name, email and number.
limitintegerResults per page, 1-100 (default 20).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
payment_statusinteger-1 drafts only, 0 unpaid, 1 partially paid, 2 paid, 4 overpaid; omit for all non-drafts.

daftra_get_purchase_invoice Get purchase invoice

One purchase invoice by id with line items, supplier, taxes and payments. GET /purchase_invoices/{id}.

ParameterTypeDescription
purchase_invoice_id *integerDaftra purchase invoice id.

daftra_list_suppliers List suppliers

List suppliers. Filter by name, address, postal code, country or status. GET /suppliers.

ParameterTypeDescription
addressstringKeyword in the address fields.
country_codestringISO alpha-2 country code.
limitintegerResults per page, 1-100 (default 20).
namestringKeyword in first name, last name, business name or email.
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
postal_codestringPostal code.
statusinteger0 active, 1 suspended.

daftra_get_supplier Get supplier

One supplier by id. GET /suppliers/{id}.

ParameterTypeDescription
supplier_id *integerDaftra supplier id.

daftra_list_notes List notes

List notes recorded against clients, invoices, estimates, purchase invoices, staff, suppliers, products and work orders: text, the record it belongs to (item_type + item_id), author, follow-up status. GET /notes.

ParameterTypeDescription
fromstringOnly notes dated on or after this date (yyyy-mm-dd or date-time).
limitintegerResults per page, 1-100 (default 20).
pageintegerPage number, from 1 (default 1). Pass the previous reply's next_page.
tostringOnly notes dated on or before this date (yyyy-mm-dd or date-time).

daftra_create_client Create client

WRITE: create a client (customer). Only business_name is required. Without an email the client is created as offline (no email sending). Returns the new client's id and client_number. POST /clients.

ParameterTypeDescription
business_name *stringThe client's business or full name (required).
address1stringAddress line 1.
address2stringAddress line 2.
citystringCity.
client_numberstringOwn client code; generated when omitted.
country_codestringISO 3166-1 alpha-2 country code, e.g. EG.
default_currency_codestringDefault currency, ISO 4217, e.g. USD.
emailstringEmail address.
first_namestringFirst name.
last_namestringLast name.
notesstringFree-text notes.
phone1stringPrimary phone number.
phone2stringSecondary / mobile phone number.
postal_codestringPostal code.
statestringState / province.
type2 individual, 3 business.

daftra_update_client Update client

WRITE: change fields of an existing client. Partial update: only the fields you pass change; business_name cannot be emptied. PUT /clients/{id}.

ParameterTypeDescription
client_id *integerDaftra client id.
address1stringAddress line 1.
address2stringAddress line 2.
business_namestringNew business or full name.
citystringCity.
country_codestringISO 3166-1 alpha-2 country code, e.g. EG.
default_currency_codestringDefault currency, ISO 4217, e.g. USD.
emailstringEmail address.
first_namestringFirst name.
last_namestringLast name.
notesstringFree-text notes.
phone1stringPrimary phone number.
phone2stringSecondary / mobile phone number.
postal_codestringPostal code.
statestringState / province.
type2 individual, 3 business.

daftra_create_supplier Create supplier

WRITE: create a supplier. business_name is required; email is required unless is_offline is true. Returns the new supplier's id. POST /suppliers.

ParameterTypeDescription
business_name *stringThe supplier's business name (required).
address1stringAddress line 1.
address2stringAddress line 2.
citystringCity.
country_codestringISO 3166-1 alpha-2 country code, e.g. EG.
default_currency_codestringDefault currency, ISO 4217, e.g. USD.
emailstringEmail address.
first_namestringFirst name.
is_offlinebooleantrue for a supplier without an email address.
last_namestringLast name.
notesstringFree-text notes.
phone1stringPrimary phone number.
phone2stringSecondary / mobile phone number.
postal_codestringPostal code.
statestringState / province.

daftra_create_expense Create expense

WRITE: record an expense (money out of a treasury). amount and date are required; the treasury defaults to the primary one and the currency to the account currency. Pass unique_id so a retry cannot create it twice. Returns the new expense id and number. POST /expenses.

ParameterTypeDescription
amount *numberGross amount, positive.
date *stringExpense date (account date format, usually yyyy-mm-dd); it must fall in an open financial period.
categorystringCategory name; created if it does not exist.
client_idintegerLinked client id.
currency_codestringISO 4217 code; defaults to the account currency.
expense_category_idintegerExisting category id (instead of category).
expense_numberstringOwn reference number; generated when omitted.
notestringDescription.
supplier_idintegerLinked supplier id.
treasury_idintegerTreasury to withdraw from (see daftra_list_treasuries).
unique_idstringIdempotency key: reusing it returns the original expense instead of creating another.
vendorstringVendor name.

daftra_create_invoice Create invoice

WRITE: create a sales invoice for a client with line items. It is saved as a DRAFT unless you pass draft=false; a final invoice posts to the books and stock. Returns the new invoice id. POST /invoices.

ParameterTypeDescription
client_id *integerClient id (daftra_list_clients).
items *arrayInvoice lines.
currency_codestringISO 4217 code; defaults to the account currency.
datestringInvoice date, yyyy-mm-dd; must fall in an open financial period (default today).
discountnumberPercentage discount on the whole invoice.
draftbooleantrue (default) saves a draft; false creates the final invoice.
nostringInvoice number; generated when omitted.
notesstringNotes shown to the client.
po_numberstringPurchase order number.

daftra_add_note Add note

WRITE: add a note to a client, invoice, estimate, purchase invoice, supplier, product, staff member or work order. The note is private unless share_with_partner is true. POST /notes/{type}/{id}.

ParameterTypeDescription
body *stringNote text.
id *integerId of that record.
type *stringKind of record (purchase_order = purchase invoice).
datestringNote date, yyyy-mm-dd (default today, UTC).
share_with_partnerbooleantrue shares the note with the client or supplier (default private).