Daftra MCP by usefulapi is an MCP server published by io.usefulapi, hosted at daftra.usefulapi.io. When last checked on 2026-11-21 it was working: it answers and lists its tools. It declares 30 tools, including daftra_get_site_info, daftra_list_clients, daftra_get_client, daftra_list_invoices, daftra_get_invoice.
Read clients, invoices, expenses and suppliers; create clients, invoices and expenses in Daftra.
4,217 connections through 5 shared values. Tap any node.
Squares are this server's values; dots are other servers sharing them. A shared address or publisher is a lead, not proof of a common operator.
Inferred from the host name and headers: what a server runs on, not who runs it.
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.
No parameters.
{
"name": "daftra_get_site_info",
"title": "Get account info",
"description": "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.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {}
},
"annotations": {
"title": "Get account info",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}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 |
|---|---|---|
| page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
| limit | integer | Results per page, 1-100 (default 20). |
| keywords | string | Search by id, client number, business name, first/last name, email or phone. |
| assign_staff_id | integer | Only clients assigned to this staff member. |
{
"name": "daftra_list_clients",
"title": "List clients",
"description": "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.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"keywords": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Search by id, client number, business name, first/last name, email or phone."
},
"assign_staff_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only clients assigned to this staff member.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "List clients",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}One client by id (contact details, balance settings, currency, address). GET /clients/{id}.
| Parameter | Type | Description |
|---|---|---|
| client_id * | integer | Daftra client id. |
{
"name": "daftra_get_client",
"title": "Get client",
"description": "One client by id (contact details, balance settings, currency, address). GET /clients/{id}.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"client_id"
],
"properties": {
"client_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Daftra client id.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "Get client",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}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 |
|---|---|---|
| page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
| sort | string | Field to sort by (default invoice date). |
| limit | integer | Results per page, 1-100 (default 20). |
| date_to | string | Invoice date to, yyyy-mm-dd. |
| keywords | string | Search client name, client number, email, invoice number and order number. |
| client_id | integer | Only invoices of this client. |
| date_from | string | Invoice date from, yyyy-mm-dd. |
| direction | string | Sort direction (default DESC). |
| recursive | integer | -1 header only, 0 header + client (default), 1 also line items, payments, taxes. |
| due_date_to | string | Due date to, yyyy-mm-dd. |
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. |
{
"name": "daftra_get_invoice",
"title": "Get invoice",
"description": "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}.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"invoice_id"
],
"properties": {
"invoice_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Daftra invoice id.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "Get invoice",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}List estimates (quotes), most recent first. Filter by client, status, dates or free text. GET /estimates.
| Parameter | Type | Description |
|---|---|---|
| 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. |
| limit | integer | Results per page, 1-100 (default 20). |
| date_to | string | Estimate date to, yyyy-mm-dd. |
| client_id | integer | Only estimates of this client. |
| date_from | string | Estimate date from, yyyy-mm-dd. |
| currency_code | string | Only estimates in this currency. |
| payment_status | integer | Estimate status id; -1 returns only drafts. |
{
"name": "daftra_list_estimates",
"title": "List estimates",
"description": "List estimates (quotes), most recent first. Filter by client, status, dates or free text. GET /estimates.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"name": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Search client name, number, email and estimate number."
},
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"date_to": {
"type": "string",
"pattern": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"description": "Estimate date to, yyyy-mm-dd."
},
"client_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only estimates of this client.",
"exclusiveMinimum": 0
},
"date_from": {
"type": "string",
"pattern": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"description": "Estimate date from, yyyy-mm-dd."
},
"currency_code": {
"type": "string",
"maxLength": 3,
"minLength": 3,
"description": "Only estimates in this currency."
},
"payment_status": {
"type": "integer",
"maximum": 20,
"minimum": -1,
"description": "Estimate status id; -1 returns only drafts."
}
}
},
"annotations": {
"title": "List estimates",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}One estimate (quote) by id with line items, taxes and client. GET /estimates/{id}.
| Parameter | Type | Description |
|---|---|---|
| estimate_id * | integer | Daftra estimate id. |
{
"name": "daftra_get_estimate",
"title": "Get estimate",
"description": "One estimate (quote) by id with line items, taxes and client. GET /estimates/{id}.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"estimate_id"
],
"properties": {
"estimate_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Daftra estimate id.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "Get estimate",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}List payments recorded against invoices, most recent first. Opening-balance and client-credit payments are excluded. GET /invoice_payments.
| Parameter | Type | Description |
|---|---|---|
| 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. |
| sort | string | Field to sort by, e.g. date, amount, id (default id). |
| limit | integer | Results per page, 1-100 (default 20). |
| status | integer | 0 not completed, 1 completed (see Daftra for other values). |
| date_to | string | Payment date to (account date format). |
| amount_to | number | Maximum amount. |
| client_id | integer | Only payments of this client. |
| date_from | string | Payment date from (account date format). |
| direction | string | Sort direction (default desc). |
| amount_from |
List payments received from clients, most recent first. Opening-balance and client-credit payments are excluded. GET /client_payments.
| Parameter | Type | Description |
|---|---|---|
| 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. |
| sort | string | Field to sort by, e.g. date, amount, id (default id). |
| limit | integer | Results per page, 1-100 (default 20). |
| status | integer | 0 not completed, 1 completed (see Daftra for other values). |
| date_to | string | Payment date to (account date format). |
| amount_to | number | Maximum amount. |
| client_id | integer | Only payments of this client. |
| date_from | string | Payment date from (account date format). |
| direction | string | Sort direction (default desc). |
| amount_from |
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 |
|---|---|---|
| page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
| limit | integer | Results per page, 1-100 (default 20). |
| status | integer | 1 available, 2 low stock, 3 out of stock, 4 inactive, 5 suspended. |
| category | integer | Only products in this category id. |
| keywords | string | Search product name, code, barcode and tags. |
| supplier_id | integer | Only products of this supplier. |
| product_code | string | Exact product code. |
{
"name": "daftra_list_products",
"title": "List products",
"description": "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.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"status": {
"type": "integer",
"maximum": 5,
"minimum": 1,
"description": "1 available, 2 low stock, 3 out of stock, 4 inactive, 5 suspended."
},
"category": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only products in this category id.",
"exclusiveMinimum": 0
},
"keywords": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Search product name, code, barcode and tags."
},
"supplier_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only products of this supplier.",
"exclusiveMinimum": 0
},
"product_code": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "Exact product code."
}
}
},
"annotations": {
"title": "List products",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}One product by id with images and categories. GET /products/{id}.
| Parameter | Type | Description |
|---|---|---|
| product_id * | integer | Daftra product id. |
{
"name": "daftra_get_product",
"title": "Get product",
"description": "One product by id with images and categories. GET /products/{id}.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"product_id"
],
"properties": {
"product_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Daftra product id.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "Get product",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}List product categories with their parent category. GET /product_categories.
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
| limit | integer | Results per page, 1-100 (default 20). |
| parent_id | integer | Only subcategories of this category id. |
{
"name": "daftra_list_product_categories",
"title": "List product categories",
"description": "List product categories with their parent category. GET /product_categories.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"parent_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only subcategories of this category id.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "List product categories",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}List stores (warehouses) the key's user may view. Use the ids to filter stock transactions. GET /stores.
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
| limit | integer | Results per page, 1-100 (default 20). |
{
"name": "daftra_list_stores",
"title": "List stores (warehouses)",
"description": "List stores (warehouses) the key's user may view. Use the ids to filter stock transactions. GET /stores.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "List stores",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}List processed stock movements (in, out, transfers), most recent first. Filter by product, store or date range. GET /stock_transactions.
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
| limit | integer | Results per page, 1-100 (default 20). |
| date_to | string | Received date to (account date format). |
| store_id | integer | Only movements in this store (warehouse). |
| date_from | string | Received date from (account date format). |
| product_id | integer | Only movements of this product. |
{
"name": "daftra_list_stock_transactions",
"title": "List stock transactions",
"description": "List processed stock movements (in, out, transfers), most recent first. Filter by product, store or date range. GET /stock_transactions.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"date_to": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Received date to (account date format)."
},
"store_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only movements in this store (warehouse).",
"exclusiveMinimum": 0
},
"date_from": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Received date from (account date format)."
},
"product_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only movements of this product.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "List stock transactions",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}List treasuries and bank accounts the key's user may view, with balances. Use the ids when recording expenses. GET /treasuries.
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
| limit | integer | Results per page, 1-100 (default 20). |
{
"name": "daftra_list_treasuries",
"title": "List treasuries and bank accounts",
"description": "List treasuries and bank accounts the key's user may view, with balances. Use the ids when recording expenses. GET /treasuries.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "List treasuries",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}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 |
|---|---|---|
| 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. |
| limit | integer | Results per page, 1-100 (default 20). |
| status | string | issued (posted) or draft. |
| vendor | string | Exact vendor name. |
| date_to | string | Date to (account date format). |
| amount_to | number | Maximum amount. |
| date_from | string | Date from (account date format). |
| direction | string | Sort direction (default desc). |
| amount_from | number |
One expense by id. GET /expenses/{id}.
| Parameter | Type | Description |
|---|---|---|
| expense_id * | integer | Daftra expense id. |
{
"name": "daftra_get_expense",
"title": "Get expense",
"description": "One expense by id. GET /expenses/{id}.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"expense_id"
],
"properties": {
"expense_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Daftra expense id.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "Get expense",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}List incomes (money in that is not an invoice payment), most recent first. Same filters as expenses. GET /incomes.
| Parameter | Type | Description |
|---|---|---|
| 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. |
| limit | integer | Results per page, 1-100 (default 20). |
| status | string | issued (posted) or draft. |
| vendor | string | Exact vendor name. |
| date_to | string | Date to (account date format). |
| amount_to | number | Maximum amount. |
| date_from | string | Date from (account date format). |
| direction | string | Sort direction (default desc). |
| amount_from | number | Minimum amount. |
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. |
{
"name": "daftra_list_taxes",
"title": "List taxes",
"description": "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.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"is_active": {
"type": "boolean",
"description": "true only active taxes, false only inactive; omit for all."
}
}
},
"annotations": {
"title": "List taxes",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}List purchase invoices (bills from suppliers), most recent first. Search by supplier or filter by payment status. GET /purchase_invoices.
| Parameter | Type | Description |
|---|---|---|
| page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
| limit | integer | Results per page, 1-100 (default 20). |
| keywords | string | Search supplier name, email and number. |
| payment_status | integer | -1 drafts only, 0 unpaid, 1 partially paid, 2 paid, 4 overpaid; omit for all non-drafts. |
{
"name": "daftra_list_purchase_invoices",
"title": "List purchase invoices",
"description": "List purchase invoices (bills from suppliers), most recent first. Search by supplier or filter by payment status. GET /purchase_invoices.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"keywords": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Search supplier name, email and number."
},
"payment_status": {
"type": "integer",
"maximum": 4,
"minimum": -1,
"description": "-1 drafts only, 0 unpaid, 1 partially paid, 2 paid, 4 overpaid; omit for all non-drafts."
}
}
},
"annotations": {
"title": "List purchase invoices",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}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. |
{
"name": "daftra_get_purchase_invoice",
"title": "Get purchase invoice",
"description": "One purchase invoice by id with line items, supplier, taxes and payments. GET /purchase_invoices/{id}.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"purchase_invoice_id"
],
"properties": {
"purchase_invoice_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Daftra purchase invoice id.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "Get purchase invoice",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}List suppliers. Filter by name, address, postal code, country or status. GET /suppliers.
| Parameter | Type | Description |
|---|---|---|
| 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. |
| limit | integer | Results per page, 1-100 (default 20). |
| status | integer | 0 active, 1 suspended. |
| address | string | Keyword in the address fields. |
| postal_code | string | Postal code. |
| country_code | string | ISO alpha-2 country code. |
{
"name": "daftra_list_suppliers",
"title": "List suppliers",
"description": "List suppliers. Filter by name, address, postal code, country or status. GET /suppliers.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"name": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Keyword in first name, last name, business name or email."
},
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"status": {
"type": "integer",
"maximum": 1,
"minimum": 0,
"description": "0 active, 1 suspended."
},
"address": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Keyword in the address fields."
},
"postal_code": {
"type": "string",
"maxLength": 20,
"minLength": 1,
"description": "Postal code."
},
"country_code": {
"type": "string",
"maxLength": 2,
"minLength": 2,
"description": "ISO alpha-2 country code."
}
}
},
"annotations": {
"title": "List suppliers",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}One supplier by id. GET /suppliers/{id}.
| Parameter | Type | Description |
|---|---|---|
| supplier_id * | integer | Daftra supplier id. |
{
"name": "daftra_get_supplier",
"title": "Get supplier",
"description": "One supplier by id. GET /suppliers/{id}.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"supplier_id"
],
"properties": {
"supplier_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Daftra supplier id.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "Get supplier",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}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 |
|---|---|---|
| to | string | Only notes dated on or before this date (yyyy-mm-dd or date-time). |
| from | string | Only notes dated on or after this date (yyyy-mm-dd or date-time). |
| page | integer | Page number, from 1 (default 1). Pass the previous reply's next_page. |
| limit | integer | Results per page, 1-100 (default 20). |
{
"name": "daftra_list_notes",
"title": "List notes",
"description": "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.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"to": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "Only notes dated on or before this date (yyyy-mm-dd or date-time)."
},
"from": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "Only notes dated on or after this date (yyyy-mm-dd or date-time)."
},
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "List notes",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}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 |
|---|---|---|
| city | string | City. |
| type | any | 2 individual, 3 business. |
| string | Email address. | |
| notes | string | Free-text notes. |
| state | string | State / province. |
| phone1 | string | Primary phone number. |
| phone2 | string | Secondary / mobile phone number. |
| address1 | string | Address line 1. |
| address2 | string | Address line 2. |
| last_name | string | Last name. |
| first_name | string | First name. |
| postal_code | string |
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 |
|---|---|---|
| city | string | City. |
| type | any | 2 individual, 3 business. |
| string | Email address. | |
| notes | string | Free-text notes. |
| state | string | State / province. |
| phone1 | string | Primary phone number. |
| phone2 | string | Secondary / mobile phone number. |
| address1 | string | Address line 1. |
| address2 | string | Address line 2. |
| client_id * | integer | Daftra client id. |
| last_name | string | Last name. |
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 |
|---|---|---|
| city | string | City. |
| string | Email address. | |
| notes | string | Free-text notes. |
| state | string | State / province. |
| phone1 | string | Primary phone number. |
| phone2 | string | Secondary / mobile phone number. |
| address1 | string | Address line 1. |
| address2 | string | Address line 2. |
| last_name | string | Last name. |
| first_name | string | First name. |
| is_offline | boolean | true for a supplier without an email address. |
| postal_code | string |
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 |
|---|---|---|
| date * | string | Expense date (account date format, usually yyyy-mm-dd); it must fall in an open financial period. |
| note | string | Description. |
| amount * | number | Gross amount, positive. |
| vendor | string | Vendor name. |
| category | string | Category name; created if it does not exist. |
| client_id | integer | Linked client id. |
| unique_id | string | Idempotency key: reusing it returns the original expense instead of creating another. |
| supplier_id | integer | Linked supplier id. |
| treasury_id | integer | Treasury to withdraw from (see daftra_list_treasuries). |
| currency_code | string |
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 |
|---|---|---|
| no | string | Invoice number; generated when omitted. |
| date | string | Invoice date, yyyy-mm-dd; must fall in an open financial period (default today). |
| draft | boolean | true (default) saves a draft; false creates the final invoice. |
| items * | array | Invoice lines. |
| notes | string | Notes shown to the client. |
| discount | number | Percentage discount on the whole invoice. |
| client_id * | integer | Client id (daftra_list_clients). |
| po_number | string | Purchase order number. |
| currency_code | string | ISO 4217 code; defaults to the account currency. |
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 |
|---|---|---|
| id * | integer | Id of that record. |
| body * | string | Note text. |
| date | string | Note date, yyyy-mm-dd (default today, UTC). |
| type * | string | Kind of record (purchase_order = purchase invoice). |
| share_with_partner | boolean | true shares the note with the client or supplier (default private). |
{
"name": "daftra_add_note",
"title": "Add note",
"description": "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}.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"type",
"id",
"body"
],
"properties": {
"id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Id of that record.",
"exclusiveMinimum": 0
},
"body": {
"type": "string",
"maxLength": 10000,
"minLength": 1,
"description": "Note text."
},
"date": {
"type": "string",
"pattern": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"description": "Note date, yyyy-mm-dd (default today, UTC)."
},
"type": {
"enum": [
"client",
"invoice",
"estimate",
"purchase_order",
"staff",
"supplier",
"product",
"work_order"
],
"type": "string",
"description": "Kind of record (purchase_order = purchase invoice)."
},
"share_with_partner": {
"type": "boolean",
"description": "true shares the note with the client or supplier (default private)."
}
}
},
"annotations": {
"title": "Add note",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}Tools for Daftra, hosted by usefulapi.io. If the user is new or asks what this server can do, suggest requests such as: "Which invoices are overdue and who owes me the most?"; "Show the expenses I recorded this month by category."; "Create a client named Nile Trading with email accounts@niletrading.example.". Read-only tools never change data; ask the user before a tool that creates, changes or deletes Daftra data. Free plan: 50 tool calls per month. Run daftra_usage_status to see the calls used this month. If the user asks for something none of these tools can do, tell the user and, with their OK, run daftra_request_feature to record the request. Paid plans: Pro (10,000 tool calls a month, $9/month or $90/year, for normal use) and Pro+ (100,000 tool calls a month, $39/month or $390/year, for automations and heavy use). A plan can be cancelled at any time and then runs to the end of the paid period, so it also suits a one-time job. When the user wants more calls or reaches the limit, run daftra_upgrade without a plan: it returns both plans, each with a payment link for the user to open. daftra_cancel_subscription cancels Pro at the end of the paid period.
Names, descriptions and schemas were written by the server and are shown as data.
Pattern matches on what the server declares. They show what it says it can do, not what it does.
None yet. Changes appear after a server's second daily check.
| currency_code | string | Only invoices in this currency, e.g. USD. |
| due_date_from | string | Due date from, yyyy-mm-dd. |
| payment_status | integer | 0 unpaid, 1 partially paid, 2 paid, 4 overpaid, -1 draft, -2 due, -3 overdue, 3 subscriptions. |
| summary_total_to | number | Maximum invoice total. |
| summary_total_from | number | Minimum invoice total. |
{
"name": "daftra_list_invoices",
"title": "List invoices",
"description": "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.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"sort": {
"type": "string",
"pattern": "^[a-z_]{1,40}$",
"description": "Field to sort by (default invoice date)."
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"date_to": {
"type": "string",
"pattern": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"description": "Invoice date to, yyyy-mm-dd."
},
"keywords": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Search client name, client number, email, invoice number and order number."
},
"client_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only invoices of this client.",
"exclusiveMinimum": 0
},
"date_from": {
"type": "string",
"pattern": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"description": "Invoice date from, yyyy-mm-dd."
},
"direction": {
"enum": [
"ASC",
"DESC"
],
"type": "string",
"description": "Sort direction (default DESC)."
},
"recursive": {
"type": "integer",
"maximum": 1,
"minimum": -1,
"description": "-1 header only, 0 header + client (default), 1 also line items, payments, taxes."
},
"due_date_to": {
"type": "string",
"pattern": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"description": "Due date to, yyyy-mm-dd."
},
"currency_code": {
"type": "string",
"maxLength": 3,
"minLength": 3,
"description": "Only invoices in this currency, e.g. USD."
},
"due_date_from": {
"type": "string",
"pattern": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"description": "Due date from, yyyy-mm-dd."
},
"payment_status": {
"type": "integer",
"maximum": 4,
"minimum": -3,
"description": "0 unpaid, 1 partially paid, 2 paid, 4 overpaid, -1 draft, -2 due, -3 overdue, 3 subscriptions."
},
"summary_total_to": {
"type": "number",
"description": "Maximum invoice total."
},
"summary_total_from": {
"type": "number",
"description": "Minimum invoice total."
}
}
},
"annotations": {
"title": "List invoices",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}| number |
| Minimum amount. |
| payment_method | string | Payment method, e.g. cash, bank, cheque, client_credit. |
{
"name": "daftra_list_invoice_payments",
"title": "List invoice payments",
"description": "List payments recorded against invoices, most recent first. Opening-balance and client-credit payments are excluded. GET /invoice_payments.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"no": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "Only payments of the invoice with this number."
},
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"sort": {
"type": "string",
"pattern": "^[a-z_]{1,40}$",
"description": "Field to sort by, e.g. date, amount, id (default id)."
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"status": {
"type": "integer",
"maximum": 10,
"minimum": 0,
"description": "0 not completed, 1 completed (see Daftra for other values)."
},
"date_to": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Payment date to (account date format)."
},
"amount_to": {
"type": "number",
"description": "Maximum amount."
},
"client_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only payments of this client.",
"exclusiveMinimum": 0
},
"date_from": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Payment date from (account date format)."
},
"direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"description": "Sort direction (default desc)."
},
"amount_from": {
"type": "number",
"description": "Minimum amount."
},
"payment_method": {
"type": "string",
"maxLength": 60,
"minLength": 1,
"description": "Payment method, e.g. cash, bank, cheque, client_credit."
}
}
},
"annotations": {
"title": "List invoice payments",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}| number |
| Minimum amount. |
| payment_method | string | Payment method, e.g. cash, bank, cheque, client_credit. |
{
"name": "daftra_list_client_payments",
"title": "List client payments",
"description": "List payments received from clients, most recent first. Opening-balance and client-credit payments are excluded. GET /client_payments.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"no": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "Only payments of the invoice with this number."
},
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"sort": {
"type": "string",
"pattern": "^[a-z_]{1,40}$",
"description": "Field to sort by, e.g. date, amount, id (default id)."
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"status": {
"type": "integer",
"maximum": 10,
"minimum": 0,
"description": "0 not completed, 1 completed (see Daftra for other values)."
},
"date_to": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Payment date to (account date format)."
},
"amount_to": {
"type": "number",
"description": "Maximum amount."
},
"client_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only payments of this client.",
"exclusiveMinimum": 0
},
"date_from": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Payment date from (account date format)."
},
"direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"description": "Sort direction (default desc)."
},
"amount_from": {
"type": "number",
"description": "Minimum amount."
},
"payment_method": {
"type": "string",
"maxLength": 60,
"minLength": 1,
"description": "Payment method, e.g. cash, bank, cheque, client_credit."
}
}
},
"annotations": {
"title": "List client payments",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}| Minimum amount. |
| expense_category_id | integer | Only this category id. |
{
"name": "daftra_list_expenses",
"title": "List expenses",
"description": "List expenses (money out), most recent first, with amount, vendor, category and treasury. Filter by dates, amount, category, vendor or status. GET /expenses.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"note": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Words in the description (all must match)."
},
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"sort": {
"type": "string",
"pattern": "^[a-z_]{1,40}$",
"description": "Field to sort by, e.g. date, amount, id."
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"status": {
"enum": [
"issued",
"draft"
],
"type": "string",
"description": "issued (posted) or draft."
},
"vendor": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Exact vendor name."
},
"date_to": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Date to (account date format)."
},
"amount_to": {
"type": "number",
"description": "Maximum amount."
},
"date_from": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Date from (account date format)."
},
"direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"description": "Sort direction (default desc)."
},
"amount_from": {
"type": "number",
"description": "Minimum amount."
},
"expense_category_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only this category id.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "List expenses",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}| expense_category_id | integer | Only this category id. |
{
"name": "daftra_list_incomes",
"title": "List incomes",
"description": "List incomes (money in that is not an invoice payment), most recent first. Same filters as expenses. GET /incomes.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"note": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Words in the description (all must match)."
},
"page": {
"type": "integer",
"maximum": 100000,
"description": "Page number, from 1 (default 1). Pass the previous reply's next_page.",
"exclusiveMinimum": 0
},
"sort": {
"type": "string",
"pattern": "^[a-z_]{1,40}$",
"description": "Field to sort by, e.g. date, amount, id."
},
"limit": {
"type": "integer",
"maximum": 100,
"description": "Results per page, 1-100 (default 20).",
"exclusiveMinimum": 0
},
"status": {
"enum": [
"issued",
"draft"
],
"type": "string",
"description": "issued (posted) or draft."
},
"vendor": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Exact vendor name."
},
"date_to": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Date to (account date format)."
},
"amount_to": {
"type": "number",
"description": "Maximum amount."
},
"date_from": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Date from (account date format)."
},
"direction": {
"enum": [
"asc",
"desc"
],
"type": "string",
"description": "Sort direction (default desc)."
},
"amount_from": {
"type": "number",
"description": "Minimum amount."
},
"expense_category_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Only this category id.",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "List incomes",
"readOnlyHint": true,
"openWorldHint": true,
"destructiveHint": false
}
}| Postal code. |
| country_code | string | ISO 3166-1 alpha-2 country code, e.g. EG. |
| business_name * | string | The client's business or full name (required). |
| client_number | string | Own client code; generated when omitted. |
| default_currency_code | string | Default currency, ISO 4217, e.g. USD. |
{
"name": "daftra_create_client",
"title": "Create client",
"description": "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.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"business_name"
],
"properties": {
"city": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "City."
},
"type": {
"anyOf": [
{
"type": "number",
"const": 2
},
{
"type": "number",
"const": 3
}
],
"description": "2 individual, 3 business."
},
"email": {
"type": "string",
"format": "email",
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
"maxLength": 254,
"description": "Email address."
},
"notes": {
"type": "string",
"maxLength": 5000,
"minLength": 1,
"description": "Free-text notes."
},
"state": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "State / province."
},
"phone1": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "Primary phone number."
},
"phone2": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "Secondary / mobile phone number."
},
"address1": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Address line 1."
},
"address2": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Address line 2."
},
"last_name": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "Last name."
},
"first_name": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "First name."
},
"postal_code": {
"type": "string",
"maxLength": 20,
"minLength": 1,
"description": "Postal code."
},
"country_code": {
"type": "string",
"maxLength": 2,
"minLength": 2,
"description": "ISO 3166-1 alpha-2 country code, e.g. EG."
},
"business_name": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "The client's business or full name (required)."
},
"client_number": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "Own client code; generated when omitted."
},
"default_currency_code": {
"type": "string",
"maxLength": 3,
"minLength": 3,
"description": "Default currency, ISO 4217, e.g. USD."
}
}
},
"annotations": {
"title": "Create client",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}| first_name |
| string |
| First name. |
| postal_code | string | Postal code. |
| country_code | string | ISO 3166-1 alpha-2 country code, e.g. EG. |
| business_name | string | New business or full name. |
| default_currency_code | string | Default currency, ISO 4217, e.g. USD. |
{
"name": "daftra_update_client",
"title": "Update client",
"description": "WRITE: change fields of an existing client. Partial update: only the fields you pass change; business_name cannot be emptied. PUT /clients/{id}.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"client_id"
],
"properties": {
"city": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "City."
},
"type": {
"anyOf": [
{
"type": "number",
"const": 2
},
{
"type": "number",
"const": 3
}
],
"description": "2 individual, 3 business."
},
"email": {
"type": "string",
"format": "email",
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
"maxLength": 254,
"description": "Email address."
},
"notes": {
"type": "string",
"maxLength": 5000,
"minLength": 1,
"description": "Free-text notes."
},
"state": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "State / province."
},
"phone1": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "Primary phone number."
},
"phone2": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "Secondary / mobile phone number."
},
"address1": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Address line 1."
},
"address2": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Address line 2."
},
"client_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Daftra client id.",
"exclusiveMinimum": 0
},
"last_name": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "Last name."
},
"first_name": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "First name."
},
"postal_code": {
"type": "string",
"maxLength": 20,
"minLength": 1,
"description": "Postal code."
},
"country_code": {
"type": "string",
"maxLength": 2,
"minLength": 2,
"description": "ISO 3166-1 alpha-2 country code, e.g. EG."
},
"business_name": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "New business or full name."
},
"default_currency_code": {
"type": "string",
"maxLength": 3,
"minLength": 3,
"description": "Default currency, ISO 4217, e.g. USD."
}
}
},
"annotations": {
"title": "Update client",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": true,
"destructiveHint": true
}
}| Postal code. |
| country_code | string | ISO 3166-1 alpha-2 country code, e.g. EG. |
| business_name * | string | The supplier's business name (required). |
| default_currency_code | string | Default currency, ISO 4217, e.g. USD. |
{
"name": "daftra_create_supplier",
"title": "Create supplier",
"description": "WRITE: create a supplier. business_name is required; email is required unless is_offline is true. Returns the new supplier's id. POST /suppliers.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"business_name"
],
"properties": {
"city": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "City."
},
"email": {
"type": "string",
"format": "email",
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
"maxLength": 254,
"description": "Email address."
},
"notes": {
"type": "string",
"maxLength": 5000,
"minLength": 1,
"description": "Free-text notes."
},
"state": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "State / province."
},
"phone1": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "Primary phone number."
},
"phone2": {
"type": "string",
"maxLength": 40,
"minLength": 1,
"description": "Secondary / mobile phone number."
},
"address1": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Address line 1."
},
"address2": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Address line 2."
},
"last_name": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "Last name."
},
"first_name": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "First name."
},
"is_offline": {
"type": "boolean",
"description": "true for a supplier without an email address."
},
"postal_code": {
"type": "string",
"maxLength": 20,
"minLength": 1,
"description": "Postal code."
},
"country_code": {
"type": "string",
"maxLength": 2,
"minLength": 2,
"description": "ISO 3166-1 alpha-2 country code, e.g. EG."
},
"business_name": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "The supplier's business name (required)."
},
"default_currency_code": {
"type": "string",
"maxLength": 3,
"minLength": 3,
"description": "Default currency, ISO 4217, e.g. USD."
}
}
},
"annotations": {
"title": "Create supplier",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}| ISO 4217 code; defaults to the account currency. |
| expense_number | string | Own reference number; generated when omitted. |
| expense_category_id | integer | Existing category id (instead of category). |
{
"name": "daftra_create_expense",
"title": "Create expense",
"description": "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.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"amount",
"date"
],
"properties": {
"date": {
"type": "string",
"maxLength": 30,
"minLength": 6,
"description": "Expense date (account date format, usually yyyy-mm-dd); it must fall in an open financial period."
},
"note": {
"type": "string",
"maxLength": 5000,
"minLength": 1,
"description": "Description."
},
"amount": {
"type": "number",
"maximum": 1000000000000,
"description": "Gross amount, positive.",
"exclusiveMinimum": 0
},
"vendor": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Vendor name."
},
"category": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Category name; created if it does not exist."
},
"client_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Linked client id.",
"exclusiveMinimum": 0
},
"unique_id": {
"type": "string",
"maxLength": 100,
"minLength": 1,
"description": "Idempotency key: reusing it returns the original expense instead of creating another."
},
"supplier_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Linked supplier id.",
"exclusiveMinimum": 0
},
"treasury_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Treasury to withdraw from (see daftra_list_treasuries).",
"exclusiveMinimum": 0
},
"currency_code": {
"type": "string",
"maxLength": 3,
"minLength": 3,
"description": "ISO 4217 code; defaults to the account currency."
},
"expense_number": {
"type": "string",
"maxLength": 60,
"minLength": 1,
"description": "Own reference number; generated when omitted."
},
"expense_category_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Existing category id (instead of category).",
"exclusiveMinimum": 0
}
}
},
"annotations": {
"title": "Create expense",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}{
"name": "daftra_create_invoice",
"title": "Create invoice",
"description": "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.",
"inputSchema": {
"type": "object",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required": [
"client_id",
"items"
],
"properties": {
"no": {
"type": "string",
"maxLength": 60,
"minLength": 1,
"description": "Invoice number; generated when omitted."
},
"date": {
"type": "string",
"pattern": "^(\\d{4})-(\\d{2})-(\\d{2})$",
"description": "Invoice date, yyyy-mm-dd; must fall in an open financial period (default today)."
},
"draft": {
"type": "boolean",
"description": "true (default) saves a draft; false creates the final invoice."
},
"items": {
"type": "array",
"items": {
"type": "object",
"required": [
"unit_price",
"quantity"
],
"properties": {
"item": {
"type": "string",
"maxLength": 200,
"minLength": 1,
"description": "Line name."
},
"tax1": {
"anyOf": [
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
},
{
"type": "null"
}
],
"description": "First tax id from daftra_list_taxes; 0 or null = no tax; omit to inherit the product's tax."
},
"tax2": {
"anyOf": [
{
"type": "integer",
"maximum": 9007199254740991,
"minimum": 0
},
{
"type": "null"
}
],
"description": "Second tax id; 0 or null = no tax; omit to inherit the product's tax."
},
"discount": {
"type": "number",
"maximum": 1000000000000,
"minimum": 0,
"description": "Line discount (a percentage unless discount_type is 2)."
},
"quantity": {
"type": "number",
"maximum": 1000000000,
"description": "Quantity (decimals allowed).",
"exclusiveMinimum": 0
},
"product_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Product id from daftra_list_products.",
"exclusiveMinimum": 0
},
"unit_price": {
"type": "number",
"maximum": 1000000000000,
"description": "Unit price, number only."
},
"description": {
"type": "string",
"maxLength": 2000,
"minLength": 1,
"description": "Line description."
},
"discount_type": {
"anyOf": [
{
"type": "number",
"const": 1
},
{
"type": "number",
"const": 2
}
],
"description": "1 percentage, 2 fixed value."
}
}
},
"maxItems": 200,
"minItems": 1,
"description": "Invoice lines."
},
"notes": {
"type": "string",
"maxLength": 5000,
"minLength": 1,
"description": "Notes shown to the client."
},
"discount": {
"type": "number",
"maximum": 100,
"minimum": 0,
"description": "Percentage discount on the whole invoice."
},
"client_id": {
"type": "integer",
"maximum": 9007199254740991,
"description": "Client id (daftra_list_clients).",
"exclusiveMinimum": 0
},
"po_number": {
"type": "string",
"maxLength": 60,
"minLength": 1,
"description": "Purchase order number."
},
"currency_code": {
"type": "string",
"maxLength": 3,
"minLength": 3,
"description": "ISO 4217 code; defaults to the account currency."
}
}
},
"annotations": {
"title": "Create invoice",
"readOnlyHint": false,
"openWorldHint": true,
"idempotentHint": false,
"destructiveHint": false
}
}