# Senta

> Keep your accounting practice's clients in Senta up to date, add notes and follow their jobs.

App · 8 actions. Web page: https://docs.lodol.com/docs/integrations/senta

## Actions

### Create client

Add a client or prospect to Senta.

**Inputs**

- Client name (`title`, text, required): The client's name.
- State (`clientstate`, text): The client's state as your practice names it, such as Prospect or Client. Moving a prospect to Client starts its jobs, as it does in Senta.
- Client type (`clienttype`, text): Its type as your practice names it, such as Partnership.
- Business area (`businessarea`, text): Its business area, such as Veterinary.
- Phone (`telephone`, text): Its phone number.
- Website (`web`, text): Its website.
- Twitter (`twitter`, text): Its Twitter handle, without the @.
- Address line 1 (`address1`, text): The first line of its address.
- Address line 2 (`address2`, text): The second line of its address.
- Town (`town`, text): Its town.
- District (`district`, text): Its district or county.
- Postcode (`postcode`, text): Its postcode.
- Payment method (`paymentmethod`, text): How it pays, such as Monthly.
- VAT service (`vatservice`, true/false): Turn the VAT service on, which starts its jobs.
- Contacts (`contacts`, list): Contacts to add. On an update, a contact with an existing contact's name is changed, and a new one is added.

**Outputs**

- `data` (object): The response from Senta.

**Example output**

```json
{
  "data": {
    "doc": {
      "_id": "c260af21ede8f",
      "address1": "8 Somerset Hall Road",
      "address2": "Flat 2",
      "businessarea": "Veterinary",
      "clientstate": "Client",
      "clienttype": "Partnership",
      "contacts": [
        {
          "email": "tammy.bailey@example.com",
          "firstname": "Tammy",
          "lastname": "Bailey",
          "mobile": "07700 900898",
          "shareholding": 50
        }
      ],
      "district": "Dorset",
      "paymentmethod": "Monthly",
      "postcode": "DT9 3BV",
      "telephone": "01632 963561",
      "title": "Watchful Cobweb Ltd",
      "total": 0,
      "town": "Sherborne",
      "twitter": "watchfulcobweb",
      "vatservice": true,
      "web": "www.watchfulcobweb.co"
    }
  }
}
```

### Create note

Add a note to a client, and to one of its jobs if you choose.

**Inputs**

- Client (`cid`, text, required): The client the note is about.
- Text (`text`, text, required): The note. It can include HTML.
- Job ID (`jid`, text): The job the note is about, from List jobs.
- Note type (`notetype`, text): The kind of note, such as Phone call. Note if empty.
- Date (`date`, date and time): The date and time the note is about. Now if empty.

**Outputs**

- `data` (object): The response from Senta.

**Example output**

```json
{
  "data": {
    "_id": "n263ba3fa138b",
    "cid": "c260af21ede8f",
    "date": "2019-08-26T00:00:00.000Z",
    "jid": "jgede54650fde",
    "notetype": "Phone call",
    "text": "Here is some <b>text</b> for the note"
  }
}
```

### Delete client

Delete a client from Senta.

**Inputs**

- Client (`clientId`, text, required): The client's Senta ID, from Search clients.

**Outputs**

- `data` (object): Nothing: Senta answers 200 with no documented body.

**Example output**

```json
{
  "data": {}
}
```

### Get client

Get a client's details and contacts.

**Inputs**

- Client (`clientId`, text, required): The client's Senta ID, from Search clients.

**Outputs**

- `data` (object): The response from Senta.

**Example output**

```json
{
  "data": {
    "doc": {
      "_id": "c260af21ede8f",
      "address1": "8 Somerset Hall Road",
      "address2": "Flat 2",
      "businessarea": "Veterinary",
      "clientstate": "Client",
      "clienttype": "Partnership",
      "contacts": [
        {
          "email": "tammy.bailey@example.com",
          "firstname": "Tammy",
          "lastname": "Bailey",
          "mobile": "07700 900898",
          "shareholding": 50
        }
      ],
      "district": "Dorset",
      "paymentmethod": "Monthly",
      "postcode": "DT9 3BV",
      "telephone": "01632 963561",
      "title": "Watchful Cobweb Ltd",
      "total": 0,
      "town": "Sherborne",
      "twitter": "watchfulcobweb",
      "vatservice": true,
      "web": "www.watchfulcobweb.co"
    }
  }
}
```

### List clients in a list

Get the clients in one of your practice's saved client lists.

**Inputs**

- Client list ID (`clientViewId`, text, required): The list's ID: the last part of its address in Senta, such as v08a361263f4a in acme.senta.co/c/l/v08a361263f4a. The list must be publicly browsable.

**Outputs**

- `data` (object): The response from Senta.

**Example output**

```json
{
  "data": {
    "docs": [
      {
        "_id": "c260af21ede8f",
        "address1": "8 Somerset Hall Road",
        "address2": "Flat 2",
        "businessarea": "Veterinary",
        "clientstate": "Client",
        "clienttype": "Partnership",
        "contacts": [
          {
            "email": "tammy.bailey@example.com",
            "firstname": "Tammy",
            "lastname": "Bailey",
            "mobile": "07700 900898",
            "shareholding": 50
          }
        ],
        "district": "Dorset",
        "paymentmethod": "Monthly",
        "postcode": "DT9 3BV",
        "telephone": "01632 963561",
        "title": "Watchful Cobweb Ltd",
        "total": 0,
        "town": "Sherborne",
        "twitter": "watchfulcobweb",
        "vatservice": true,
        "web": "www.watchfulcobweb.co"
      }
    ]
  }
}
```

### List jobs

List jobs, filtered by client, job template or status.

**Inputs**

- Client (`cid`, text): Only jobs for this client.
- Job template ID (`wid`, text): Only jobs made from this job template.
- Status (`status`, text): Only jobs with this status. Every status if empty. One of: `pending`, `ready`, `overdue`, `completed`, `cancelled`.

**Outputs**

- `data` (object): The response from Senta.

**Example output**

```json
{
  "data": {
    "docs": [
      {
        "_id": "j78ecbe073def",
        "cid": "c260af21ede8f",
        "date": "2019-08-26T00:00:00.000Z",
        "title": "Accounts setup",
        "wid": "w263ba3fa138b"
      }
    ]
  }
}
```

### Search clients

Find clients whose details match some keywords.

**Inputs**

- Keywords (`keywords`, text, required): Words to match clients against, such as part of a name.

**Outputs**

- `data` (object): The response from Senta.

**Example output**

```json
{
  "data": {
    "docs": [
      {
        "_id": "c260af21ede8f",
        "title": "Watchful Cobweb"
      }
    ]
  }
}
```

### Update client

Change a client's details or add contacts. Only the fields you fill in change.

**Inputs**

- Client (`clientId`, text, required): The client's Senta ID, from Search clients.
- Client name (`title`, text): The client's name.
- State (`clientstate`, text): The client's state as your practice names it, such as Prospect or Client. Moving a prospect to Client starts its jobs, as it does in Senta.
- Client type (`clienttype`, text): Its type as your practice names it, such as Partnership.
- Business area (`businessarea`, text): Its business area, such as Veterinary.
- Phone (`telephone`, text): Its phone number.
- Website (`web`, text): Its website.
- Twitter (`twitter`, text): Its Twitter handle, without the @.
- Address line 1 (`address1`, text): The first line of its address.
- Address line 2 (`address2`, text): The second line of its address.
- Town (`town`, text): Its town.
- District (`district`, text): Its district or county.
- Postcode (`postcode`, text): Its postcode.
- Payment method (`paymentmethod`, text): How it pays, such as Monthly.
- VAT service (`vatservice`, true/false): Turn the VAT service on, which starts its jobs.
- Contacts (`contacts`, list): Contacts to add. On an update, a contact with an existing contact's name is changed, and a new one is added.

**Outputs**

- `data` (object): The response from Senta.

**Example output**

```json
{
  "data": {
    "doc": {
      "_id": "c260af21ede8f",
      "address1": "8 Somerset Hall Road",
      "address2": "Flat 2",
      "businessarea": "Veterinary",
      "clientstate": "Client",
      "clienttype": "Partnership",
      "contacts": [
        {
          "email": "tammy.bailey@example.com",
          "firstname": "Tammy",
          "lastname": "Bailey",
          "mobile": "07700 900898",
          "shareholding": 50
        }
      ],
      "district": "Dorset",
      "paymentmethod": "Monthly",
      "postcode": "DT9 3BV",
      "telephone": "01632 963561",
      "title": "Watchful Cobweb Ltd",
      "total": 0,
      "town": "Sherborne",
      "twitter": "watchfulcobweb",
      "vatservice": true,
      "web": "www.watchfulcobweb.co"
    }
  }
}
```
