Daftra MCP by usefulapi
v1.7.1Read 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.
| Parameter | Type | Description |
|---|---|---|
assign_staff_id | integer | Only clients assigned to this staff member. |
keywords | string | Search by id, client number, business name, first/last name, email or phone. |
limit | integer | Results per page, 1-100 (default 20). |
page | integer | Page 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}.
| Parameter | Type | Description |
|---|---|---|
client_id * | integer | Daftra 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.
| Parameter | Type | Description |
|---|---|---|
client_id | integer | Only invoices of this client. |
currency_code | string | Only invoices in this currency, e.g. USD. |
date_from | string | Invoice date from, yyyy-mm-dd. |
date_to | string | Invoice date to, yyyy-mm-dd. |
direction | string | Sort direction (default DESC). |
due_date_from | string | Due date from, yyyy-mm-dd. |
due_date_to | string | Due date to, yyyy-mm-dd. |
keywords | string | Search client name, client number, email, invoice number and order number. |
limit | integer | Results per page, 1-100 (default 20). |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
payment_status | integer | 0 unpaid, 1 partially paid, 2 paid, 4 overpaid, -1 draft, -2 due, -3 overdue, 3 subscriptions. |
recursive | integer | -1 header only, 0 header + client (default), 1 also line items, payments, taxes. |
sort | string | Field to sort by (default invoice date). |
summary_total_from | number | Minimum invoice total. |
summary_total_to | number | Maximum 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}.
| Parameter | Type | Description |
|---|---|---|
invoice_id * | integer | Daftra invoice id. |
daftra_list_estimates List estimates
List estimates (quotes), most recent first. Filter by client, status, dates or free text. GET /estimates.
| Parameter | Type | Description |
|---|---|---|
client_id | integer | Only estimates of this client. |
currency_code | string | Only estimates in this currency. |
date_from | string | Estimate date from, yyyy-mm-dd. |
date_to | string | Estimate date to, yyyy-mm-dd. |
limit | integer | Results per page, 1-100 (default 20). |
name | string | Search client name, number, email and estimate number. |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
payment_status | integer | Estimate 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}.
| Parameter | Type | Description |
|---|---|---|
estimate_id * | integer | Daftra 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.
| Parameter | Type | Description |
|---|---|---|
amount_from | number | Minimum amount. |
amount_to | number | Maximum amount. |
client_id | integer | Only payments of this client. |
date_from | string | Payment date from (account date format). |
date_to | string | Payment date to (account date format). |
direction | string | Sort direction (default desc). |
limit | integer | Results per page, 1-100 (default 20). |
no | string | Only payments of the invoice with this number. |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
payment_method | string | Payment method, e.g. cash, bank, cheque, client_credit. |
sort | string | Field to sort by, e.g. date, amount, id (default id). |
status | integer | 0 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.
| Parameter | Type | Description |
|---|---|---|
amount_from | number | Minimum amount. |
amount_to | number | Maximum amount. |
client_id | integer | Only payments of this client. |
date_from | string | Payment date from (account date format). |
date_to | string | Payment date to (account date format). |
direction | string | Sort direction (default desc). |
limit | integer | Results per page, 1-100 (default 20). |
no | string | Only payments of the invoice with this number. |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
payment_method | string | Payment method, e.g. cash, bank, cheque, client_credit. |
sort | string | Field to sort by, e.g. date, amount, id (default id). |
status | integer | 0 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.
| Parameter | Type | Description |
|---|---|---|
category | integer | Only products in this category id. |
keywords | string | Search product name, code, barcode and tags. |
limit | integer | Results per page, 1-100 (default 20). |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
product_code | string | Exact product code. |
status | integer | 1 available, 2 low stock, 3 out of stock, 4 inactive, 5 suspended. |
supplier_id | integer | Only products of this supplier. |
daftra_get_product Get product
One product by id with images and categories. GET /products/{id}.
| Parameter | Type | Description |
|---|---|---|
product_id * | integer | Daftra product id. |
daftra_list_product_categories List product categories
List product categories with their parent category. GET /product_categories.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Results per page, 1-100 (default 20). |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
parent_id | integer | Only 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.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Results per page, 1-100 (default 20). |
page | integer | Page 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.
| Parameter | Type | Description |
|---|---|---|
date_from | string | Received date from (account date format). |
date_to | string | Received date to (account date format). |
limit | integer | Results per page, 1-100 (default 20). |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
product_id | integer | Only movements of this product. |
store_id | integer | Only 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.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Results per page, 1-100 (default 20). |
page | integer | Page 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.
| Parameter | Type | Description |
|---|---|---|
amount_from | number | Minimum amount. |
amount_to | number | Maximum amount. |
date_from | string | Date from (account date format). |
date_to | string | Date to (account date format). |
direction | string | Sort direction (default desc). |
expense_category_id | integer | Only this category id. |
limit | integer | Results per page, 1-100 (default 20). |
note | string | Words in the description (all must match). |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
sort | string | Field to sort by, e.g. date, amount, id. |
status | string | issued (posted) or draft. |
vendor | string | Exact vendor name. |
daftra_get_expense Get expense
One expense by id. GET /expenses/{id}.
| Parameter | Type | Description |
|---|---|---|
expense_id * | integer | Daftra 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.
| Parameter | Type | Description |
|---|---|---|
amount_from | number | Minimum amount. |
amount_to | number | Maximum amount. |
date_from | string | Date from (account date format). |
date_to | string | Date to (account date format). |
direction | string | Sort direction (default desc). |
expense_category_id | integer | Only this category id. |
limit | integer | Results per page, 1-100 (default 20). |
note | string | Words in the description (all must match). |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
sort | string | Field to sort by, e.g. date, amount, id. |
status | string | issued (posted) or draft. |
vendor | string | Exact 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.
| Parameter | Type | Description |
|---|---|---|
is_active | boolean | true 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.
| Parameter | Type | Description |
|---|---|---|
keywords | string | Search supplier name, email and number. |
limit | integer | Results per page, 1-100 (default 20). |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
payment_status | integer | -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}.
| Parameter | Type | Description |
|---|---|---|
purchase_invoice_id * | integer | Daftra purchase invoice id. |
daftra_list_suppliers List suppliers
List suppliers. Filter by name, address, postal code, country or status. GET /suppliers.
| Parameter | Type | Description |
|---|---|---|
address | string | Keyword in the address fields. |
country_code | string | ISO alpha-2 country code. |
limit | integer | Results per page, 1-100 (default 20). |
name | string | Keyword in first name, last name, business name or email. |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
postal_code | string | Postal code. |
status | integer | 0 active, 1 suspended. |
daftra_get_supplier Get supplier
One supplier by id. GET /suppliers/{id}.
| Parameter | Type | Description |
|---|---|---|
supplier_id * | integer | Daftra 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.
| Parameter | Type | Description |
|---|---|---|
from | string | Only notes dated on or after this date (yyyy-mm-dd or date-time). |
limit | integer | Results per page, 1-100 (default 20). |
page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
to | string | Only 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.
| Parameter | Type | Description |
|---|---|---|
business_name * | string | The client's business or full name (required). |
address1 | string | Address line 1. |
address2 | string | Address line 2. |
city | string | City. |
client_number | string | Own client code; generated when omitted. |
country_code | string | ISO 3166-1 alpha-2 country code, e.g. EG. |
default_currency_code | string | Default currency, ISO 4217, e.g. USD. |
email | string | Email address. |
first_name | string | First name. |
last_name | string | Last name. |
notes | string | Free-text notes. |
phone1 | string | Primary phone number. |
phone2 | string | Secondary / mobile phone number. |
postal_code | string | Postal code. |
state | string | State / province. |
type | 2 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}.
| Parameter | Type | Description |
|---|---|---|
client_id * | integer | Daftra client id. |
address1 | string | Address line 1. |
address2 | string | Address line 2. |
business_name | string | New business or full name. |
city | string | City. |
country_code | string | ISO 3166-1 alpha-2 country code, e.g. EG. |
default_currency_code | string | Default currency, ISO 4217, e.g. USD. |
email | string | Email address. |
first_name | string | First name. |
last_name | string | Last name. |
notes | string | Free-text notes. |
phone1 | string | Primary phone number. |
phone2 | string | Secondary / mobile phone number. |
postal_code | string | Postal code. |
state | string | State / province. |
type | 2 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.
| Parameter | Type | Description |
|---|---|---|
business_name * | string | The supplier's business name (required). |
address1 | string | Address line 1. |
address2 | string | Address line 2. |
city | string | City. |
country_code | string | ISO 3166-1 alpha-2 country code, e.g. EG. |
default_currency_code | string | Default currency, ISO 4217, e.g. USD. |
email | string | Email address. |
first_name | string | First name. |
is_offline | boolean | true for a supplier without an email address. |
last_name | string | Last name. |
notes | string | Free-text notes. |
phone1 | string | Primary phone number. |
phone2 | string | Secondary / mobile phone number. |
postal_code | string | Postal code. |
state | string | State / 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.
| Parameter | Type | Description |
|---|---|---|
amount * | number | Gross amount, positive. |
date * | string | Expense date (account date format, usually yyyy-mm-dd); it must fall in an open financial period. |
category | string | Category name; created if it does not exist. |
client_id | integer | Linked client id. |
currency_code | string | ISO 4217 code; defaults to the account currency. |
expense_category_id | integer | Existing category id (instead of category). |
expense_number | string | Own reference number; generated when omitted. |
note | string | Description. |
supplier_id | integer | Linked supplier id. |
treasury_id | integer | Treasury to withdraw from (see daftra_list_treasuries). |
unique_id | string | Idempotency key: reusing it returns the original expense instead of creating another. |
vendor | string | Vendor 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.
| Parameter | Type | Description |
|---|---|---|
client_id * | integer | Client id (daftra_list_clients). |
items * | array | Invoice lines. |
currency_code | string | ISO 4217 code; defaults to the account currency. |
date | string | Invoice date, yyyy-mm-dd; must fall in an open financial period (default today). |
discount | number | Percentage discount on the whole invoice. |
draft | boolean | true (default) saves a draft; false creates the final invoice. |
no | string | Invoice number; generated when omitted. |
notes | string | Notes shown to the client. |
po_number | string | Purchase 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}.
| Parameter | Type | Description |
|---|---|---|
body * | string | Note text. |
id * | integer | Id of that record. |
type * | string | Kind of record (purchase_order = purchase invoice). |
date | string | Note date, yyyy-mm-dd (default today, UTC). |
share_with_partner | boolean | true shares the note with the client or supplier (default private). |