# Invoices

## get_invoices

`TOOL get_invoices`

Get list of invoices for the authenticated user's organization

Authentication: no security requirement declared for this operation.

Parameters:

- `page` (argument, number, optional) - Page number for pagination
  Type: number
  
  Page number for pagination
  
  default: 1

- `limit` (argument, number, optional) - Number of items per page
  Type: number
  
  Number of items per page
  
  default: 10

- `search` (argument, string, optional) - Search term for invoice number or client name
  Type: string
  
  Search term for invoice number or client name

- `relations` (argument, array, optional) - Relations to include (e.g., ["organizationContact", "invoiceItems", "tags"])
  Type: array
  
  Relations to include (e.g., ["organizationContact", "invoiceItems", "tags"])
  
  Items:
    Type: string

- `status` (argument, string, optional) - Filter by invoice status
  Type: string
  
  Filter by invoice status
  
  enum: ["DRAFT","SENT","VIEWED","ACCEPTED","ACTIVE","FULLY_PAID","CANCELLED"]

- `invoiceType` (argument, string, optional) - Filter by invoice type
  Type: string
  
  Filter by invoice type
  
  enum: ["BY_EMPLOYEE_HOURS","BY_PROJECT_HOURS","BY_TASK_HOURS","BY_PRODUCTS","BY_FLAT_FEE","DETAILS_INVOICE_ITEMS"]

- `paid` (argument, boolean, optional) - Filter by payment status
  Type: boolean
  
  Filter by payment status

- `startDate` (argument, string, optional) - Filter invoices from this date (ISO format)
  Type: string
  
  Filter invoices from this date (ISO format)

- `endDate` (argument, string, optional) - Filter invoices until this date (ISO format)
  Type: string
  
  Filter invoices until this date (ISO format)

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_invoices",
    "arguments": {
        "page": 1,
        "limit": 10,
        "search": "string",
        "relations": [
          "string"
        ],
        "status": "DRAFT",
        "invoiceType": "BY_EMPLOYEE_HOURS",
        "paid": true,
        "startDate": "string",
        "endDate": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "get_invoices",
  "arguments": {
    "page": 1,
    "limit": 10,
    "search": "string",
    "relations": [
      "string"
    ],
    "status": "DRAFT",
    "invoiceType": "BY_EMPLOYEE_HOURS",
    "paid": true,
    "startDate": "string",
    "endDate": "string"
  }
});
```

### Python

```python
result = await session.call_tool("get_invoices", arguments={
  "page": 1,
  "limit": 10,
  "search": "string",
  "relations": [
    "string"
  ],
  "status": "DRAFT",
  "invoiceType": "BY_EMPLOYEE_HOURS",
  "paid": true,
  "startDate": "string",
  "endDate": "string"
})
```


## get_invoice_count

`TOOL get_invoice_count`

Get invoice count in the authenticated user's organization

Authentication: no security requirement declared for this operation.

Parameters:

- `status` (argument, string, optional) - Filter by invoice status
  Type: string
  
  Filter by invoice status
  
  enum: ["DRAFT","SENT","VIEWED","ACCEPTED","ACTIVE","FULLY_PAID","CANCELLED"]

- `paid` (argument, boolean, optional) - Filter by payment status
  Type: boolean
  
  Filter by payment status

- `startDate` (argument, string, optional) - Filter invoices from this date (ISO format)
  Type: string
  
  Filter invoices from this date (ISO format)

- `endDate` (argument, string, optional) - Filter invoices until this date (ISO format)
  Type: string
  
  Filter invoices until this date (ISO format)

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_invoice_count",
    "arguments": {
        "status": "DRAFT",
        "paid": true,
        "startDate": "string",
        "endDate": "string"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "get_invoice_count",
  "arguments": {
    "status": "DRAFT",
    "paid": true,
    "startDate": "string",
    "endDate": "string"
  }
});
```

### Python

```python
result = await session.call_tool("get_invoice_count", arguments={
  "status": "DRAFT",
  "paid": true,
  "startDate": "string",
  "endDate": "string"
})
```


## get_invoice

`TOOL get_invoice`

Get a specific invoice by ID

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (argument, string, uuid, required) - The invoice ID
  Type: string, uuid
  
  The invoice ID
  
  pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"

- `relations` (argument, array, optional) - Relations to include (e.g., ["organizationContact", "invoiceItems", "tags"])
  Type: array
  
  Relations to include (e.g., ["organizationContact", "invoiceItems", "tags"])
  
  Items:
    Type: string

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_invoice",
    "arguments": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "relations": [
          "string"
        ]
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "get_invoice",
  "arguments": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "relations": [
      "string"
    ]
  }
});
```

### Python

```python
result = await session.call_tool("get_invoice", arguments={
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "relations": [
    "string"
  ]
})
```


## create_invoice

`TOOL create_invoice`

Create a new invoice in the authenticated user's organization

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `invoice_data` (required)
  Type: object
  
  The data for creating the invoice
  
  - `invoiceNumber` (required)
    Type: string
    
    The invoice number (required)
  
  - `invoiceDate` (required)
    Type: string
    
    The invoice date (required)
  
  - `dueDate` (required)
    Type: string
    
    The due date (required)
  
  - `currency` (required)
    Type: string
    
    The currency (required)
  
  Additional properties: 
    Type: unknown

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "create_invoice",
    "arguments": {
        "invoice_data": {
          "invoiceNumber": "string",
          "invoiceDate": "string",
          "dueDate": "string",
          "currency": "string"
        }
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "create_invoice",
  "arguments": {
    "invoice_data": {
      "invoiceNumber": "string",
      "invoiceDate": "string",
      "dueDate": "string",
      "currency": "string"
    }
  }
});
```

### Python

```python
result = await session.call_tool("create_invoice", arguments={
  "invoice_data": {
    "invoiceNumber": "string",
    "invoiceDate": "string",
    "dueDate": "string",
    "currency": "string"
  }
})
```


## update_invoice

`TOOL update_invoice`

Update an existing invoice

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (argument, string, uuid, required) - The invoice ID
  Type: string, uuid
  
  The invoice ID
  
  pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"

- `invoice_data` (argument, object, required) - The data for updating the invoice
  Type: object
  
  The data for updating the invoice
  
  Additional properties: 
    Type: unknown

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_invoice",
    "arguments": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "invoice_data": {}
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "update_invoice",
  "arguments": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "invoice_data": {}
  }
});
```

### Python

```python
result = await session.call_tool("update_invoice", arguments={
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "invoice_data": {}
})
```


## update_invoice_action

`TOOL update_invoice_action`

Update the action/status of an invoice

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (argument, string, uuid, required) - The invoice ID
  Type: string, uuid
  
  The invoice ID
  
  pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"

- `status` (argument, string, optional) - The new status for the invoice
  Type: string
  
  The new status for the invoice
  
  enum: ["DRAFT","SENT","VIEWED","ACCEPTED","ACTIVE","FULLY_PAID","CANCELLED"]

- `isEstimate` (argument, boolean, optional) - Whether this is an estimate
  Type: boolean
  
  Whether this is an estimate

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_invoice_action",
    "arguments": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "status": "DRAFT",
        "isEstimate": true
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "update_invoice_action",
  "arguments": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "DRAFT",
    "isEstimate": true
  }
});
```

### Python

```python
result = await session.call_tool("update_invoice_action", arguments={
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "DRAFT",
  "isEstimate": true
})
```


## update_estimate_status

`TOOL update_estimate_status`

Update estimate status of an invoice

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `id` (required)
  Type: string, uuid
  
  The invoice ID
  
  pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"

- `data` (required)
  Type: object
  
  Data to update for the estimate
  
  - `isEstimate` (optional)
    Type: boolean
  
  - `status` (optional)
    Type: string
    
    enum: ["DRAFT","SENT","VIEWED","ACCEPTED","ACTIVE","FULLY_PAID","CANCELLED"]
  
  - `paid` (optional)
    Type: boolean

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_estimate_status",
    "arguments": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "data": {
          "isEstimate": true,
          "status": "DRAFT",
          "paid": true
        }
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "update_estimate_status",
  "arguments": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "data": {
      "isEstimate": true,
      "status": "DRAFT",
      "paid": true
    }
  }
});
```

### Python

```python
result = await session.call_tool("update_estimate_status", arguments={
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "data": {
    "isEstimate": true,
    "status": "DRAFT",
    "paid": true
  }
})
```


## delete_invoice

`TOOL delete_invoice`

Delete an invoice

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (argument, string, uuid, required) - The invoice ID
  Type: string, uuid
  
  The invoice ID
  
  pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "delete_invoice",
    "arguments": {
        "id": "550e8400-e29b-41d4-a716-446655440000"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "delete_invoice",
  "arguments": {
    "id": "550e8400-e29b-41d4-a716-446655440000"
  }
});
```

### Python

```python
result = await session.call_tool("delete_invoice", arguments={
  "id": "550e8400-e29b-41d4-a716-446655440000"
})
```


## get_invoice_items

`TOOL get_invoice_items`

Get items for a specific invoice

Authentication: no security requirement declared for this operation.

Parameters:

- `invoiceId` (argument, string, uuid, required) - The invoice ID
  Type: string, uuid
  
  The invoice ID
  
  pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"

- `relations` (argument, array, optional) - Relations to include (e.g., ["product", "project", "task"])
  Type: array
  
  Relations to include (e.g., ["product", "project", "task"])
  
  Items:
    Type: string

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_invoice_items",
    "arguments": {
        "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
        "relations": [
          "string"
        ]
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "get_invoice_items",
  "arguments": {
    "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
    "relations": [
      "string"
    ]
  }
});
```

### Python

```python
result = await session.call_tool("get_invoice_items", arguments={
  "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
  "relations": [
    "string"
  ]
})
```


## send_invoice_email

`TOOL send_invoice_email`

Send an invoice via email

Authentication: no security requirement declared for this operation.

Request body: application/json (required)

Type: object

- `email` (required)
  Type: string, email
  
  Email address to send the invoice to
  
  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,}$"

- `params` (required)
  Type: object
  
  Email parameters including invoice ID
  
  - `invoiceId` (required)
    Type: string, uuid
    
    pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  
  - `organizationId` (optional)
    Type: string, uuid
    
    pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  
  - `tenantId` (optional)
    Type: string, uuid
    
    pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "send_invoice_email",
    "arguments": {
        "email": "user@example.com",
        "params": {
          "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
          "organizationId": "550e8400-e29b-41d4-a716-446655440000",
          "tenantId": "550e8400-e29b-41d4-a716-446655440000"
        }
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "send_invoice_email",
  "arguments": {
    "email": "user@example.com",
    "params": {
      "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
      "organizationId": "550e8400-e29b-41d4-a716-446655440000",
      "tenantId": "550e8400-e29b-41d4-a716-446655440000"
    }
  }
});
```

### Python

```python
result = await session.call_tool("send_invoice_email", arguments={
  "email": "user@example.com",
  "params": {
    "invoiceId": "550e8400-e29b-41d4-a716-446655440000",
    "organizationId": "550e8400-e29b-41d4-a716-446655440000",
    "tenantId": "550e8400-e29b-41d4-a716-446655440000"
  }
})
```


## download_invoice_pdf

`TOOL download_invoice_pdf`

Download PDF for an invoice as binary data

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (argument, string, uuid, required) - The invoice ID
  Type: string, uuid
  
  The invoice ID
  
  pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "download_invoice_pdf",
    "arguments": {
        "id": "550e8400-e29b-41d4-a716-446655440000"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "download_invoice_pdf",
  "arguments": {
    "id": "550e8400-e29b-41d4-a716-446655440000"
  }
});
```

### Python

```python
result = await session.call_tool("download_invoice_pdf", arguments={
  "id": "550e8400-e29b-41d4-a716-446655440000"
})
```


## get_highest_invoice_number

`TOOL get_highest_invoice_number`

Get the highest invoice number in the organization

Authentication: no security requirement declared for this operation.

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_highest_invoice_number",
    "arguments": {}
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "get_highest_invoice_number",
  "arguments": {}
});
```

### Python

```python
result = await session.call_tool("get_highest_invoice_number", arguments={})
```


## generate_invoice_link

`TOOL generate_invoice_link`

Generate a public link for an invoice

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (argument, string, uuid, required) - The invoice ID
  Type: string, uuid
  
  The invoice ID
  
  pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "generate_invoice_link",
    "arguments": {
        "id": "550e8400-e29b-41d4-a716-446655440000"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "generate_invoice_link",
  "arguments": {
    "id": "550e8400-e29b-41d4-a716-446655440000"
  }
});
```

### Python

```python
result = await session.call_tool("generate_invoice_link", arguments={
  "id": "550e8400-e29b-41d4-a716-446655440000"
})
```


## download_invoice_payment_pdf

`TOOL download_invoice_payment_pdf`

Download payment PDF for an invoice

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (argument, string, uuid, required) - The invoice ID
  Type: string, uuid
  
  The invoice ID
  
  pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"

## Examples

### JSON-RPC

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "download_invoice_payment_pdf",
    "arguments": {
        "id": "550e8400-e29b-41d4-a716-446655440000"
      }
  }
}
```

### TypeScript

```typescript
const result = await client.callTool({
  "name": "download_invoice_payment_pdf",
  "arguments": {
    "id": "550e8400-e29b-41d4-a716-446655440000"
  }
});
```

### Python

```python
result = await session.call_tool("download_invoice_payment_pdf", arguments={
  "id": "550e8400-e29b-41d4-a716-446655440000"
})
```
