# PestPac

> Find customers' locations, add contacts, and follow service orders, invoices and leads in WorkWave PestPac.

App · 21 actions. Web page: https://docs.lodol.com/docs/integrations/pestpac

## Actions

### Add a contact

Add a contact to a service location.

**Inputs**

- Location ID (`location_id`, number, required): PestPac's ID for the location the contact belongs to.
- First name (`first_name`, text, required): The contact's first name.
- Last name (`last_name`, text, required): The contact's last name.
- Email (`email`, text): The contact's email address.
- Phone (`phone`, text): The contact's phone number.
- Mobile phone (`mobile_phone`, text): The contact's mobile number.
- Address (`address`, text): The street address.
- Address line 2 (`address2`, text): The second line of the address.
- City (`city`, text): The city.
- State (`state`, text): The state, as its two-letter code.
- ZIP code (`zip`, text): The ZIP code.
- Comment (`comment`, text): A comment about the contact.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "Address": "example",
    "City": "example",
    "Comment": "example",
    "ContactID": 1,
    "EMail": "example",
    "FirstName": "example",
    "LastName": "example",
    "LocationID": 1,
    "MobilePhone": "example",
    "Phone": "example",
    "State": "example",
    "Zip": "example"
  }
}
```

### Create a location

Create a service location (a customer's property) in a branch.

**Inputs**

- First name (`first_name`, text, required): The customer's first name.
- Last name (`last_name`, text, required): The customer's last name.
- Address (`address`, text, required): The street address.
- Address line 2 (`address2`, text): The second line of the address.
- City (`city`, text, required): The city.
- State (`state`, text, required): The state, as its two-letter code.
- ZIP code (`zip`, text, required): The ZIP code.
- Phone (`phone`, text, required): The customer's phone number.
- Email (`email`, text, required): The customer's email address.
- Branch (`branch`, text, required): The branch the location belongs to, as PestPac names it.
- Type (`location_type`, text, required): The location's type, such as Residential or Commercial, as PestPac names it.
- Tax code (`tax_code`, text, required): The location's tax code, as in Lookup list's TaxCodes.
- Mobile phone (`mobile_phone`, text): The customer's mobile number.
- County (`county`, text): The county.
- Comment (`comment`, text): A comment about the location.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "Active": true,
    "Address": "example",
    "Address2": "example",
    "BillToID": 1,
    "Branch": "example",
    "City": "example",
    "Company": "example",
    "EMail": "example",
    "FirstName": "example",
    "LastName": "example",
    "Latitude": 1,
    "LocationCode": "example",
    "LocationID": 1,
    "LocationInstructions": "example",
    "Longitude": 1,
    "MobilePhone": "example",
    "Phone": "example",
    "ServiceInstructions": "example",
    "State": "example",
    "Type": "example",
    "Zip": "example"
  }
}
```

### Find bill-to accounts

Find bill-to accounts (who pays) by a name, phone number or email address, or by their IDs.

**Inputs**

- Search (`q`, text): What to look for.
- Bill-to IDs (`ids`, text): Bill-to IDs to read, separated by commas.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "Address": "example",
        "Balance": 1,
        "BillToID": 1,
        "City": "example",
        "Company": "example",
        "EMail": "example",
        "FirstName": "example",
        "LastName": "example",
        "Phone": "example",
        "State": "example",
        "Zip": "example"
      }
    ]
  }
}
```

### Find contacts

Find contacts by a name, phone number or email address, or by their IDs.

**Inputs**

- Search (`q`, text): What to look for.
- Contact IDs (`ids`, text): Contact IDs to read, separated by commas.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "Address": "example",
        "City": "example",
        "Comment": "example",
        "ContactID": 1,
        "EMail": "example",
        "FirstName": "example",
        "LastName": "example",
        "LocationID": 1,
        "MobilePhone": "example",
        "Phone": "example",
        "State": "example",
        "Zip": "example"
      }
    ]
  }
}
```

### Find invoices

Find invoices by invoice number, order number or order ID.

**Inputs**

- Invoice number (`invoice_number`, text): The invoice number.
- Order number (`order_number`, text): The service order's number.
- Order ID (`order_id`, number): PestPac's ID for the service order.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "Balance": 1,
        "BillToID": 1,
        "InvoiceDate": "example",
        "InvoiceID": 1,
        "InvoiceNumber": "example",
        "LocationID": 1,
        "OrderID": 1,
        "Status": "example",
        "Total": 1
      }
    ]
  }
}
```

### Find locations

Find service locations by a name, address, phone number or email address.

**Inputs**

- Search (`q`, text): What to look for: a name, address, phone number or email address.
- Location IDs (`ids`, text): Location IDs to read, separated by commas.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "Active": true,
        "Address": "example",
        "Address2": "example",
        "BillToID": 1,
        "Branch": "example",
        "City": "example",
        "Company": "example",
        "EMail": "example",
        "FirstName": "example",
        "LastName": "example",
        "Latitude": 1,
        "LocationCode": "example",
        "LocationID": 1,
        "LocationInstructions": "example",
        "Longitude": 1,
        "MobilePhone": "example",
        "Phone": "example",
        "ServiceInstructions": "example",
        "State": "example",
        "Type": "example",
        "Zip": "example"
      }
    ]
  }
}
```

### Get a location

Get a service location's details.

**Inputs**

- Location ID (`location_id`, number, required): PestPac's ID for the location (its LocationID).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "Active": true,
    "Address": "example",
    "Address2": "example",
    "BillToID": 1,
    "Branch": "example",
    "City": "example",
    "Company": "example",
    "EMail": "example",
    "FirstName": "example",
    "LastName": "example",
    "Latitude": 1,
    "LocationCode": "example",
    "LocationID": 1,
    "LocationInstructions": "example",
    "Longitude": 1,
    "MobilePhone": "example",
    "Phone": "example",
    "ServiceInstructions": "example",
    "State": "example",
    "Type": "example",
    "Zip": "example"
  }
}
```

### Get a lookup list

Get one of PestPac's lists of choices, such as its employees, services, schedules or tax codes.

**Inputs**

- List (`lookup`, text, required): Which list. One of: `Employees`, `Schedules`, `Services`, `ServiceClasses` (Service classes), `Routes`, `TaxCodes` (Tax codes), `TaskTypes` (Task types), `TargetPests` (Target pests), `TechnicianRegions` (Technician regions).
- Branch ID (`branch_id`, text): Only choices for this branch.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {}
    ]
  }
}
```

### Get a service order

Get a service order's details.

**Inputs**

- Order ID (`order_id`, number, required): PestPac's ID for the service order (its OrderID).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "BillToID": 1,
    "LocationID": 1,
    "OrderID": 1,
    "OrderInstructions": "example",
    "OrderNumber": "example",
    "Posted": true,
    "RouteID": 1,
    "ServiceCode": "example",
    "ServiceType": "example",
    "Status": "example",
    "Technician": "example",
    "Total": 1,
    "WorkDate": "example"
  }
}
```

### Get a service setup

Get a recurring service setup: its service, schedule, route and price.

**Inputs**

- Setup ID (`setup_id`, number, required): PestPac's ID for the service setup.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "Active": true,
    "LocationID": 1,
    "Price": 1,
    "Route": "example",
    "Schedule": "example",
    "ServiceCode": "example",
    "SetupID": 1,
    "StartDate": "example"
  }
}
```

### Get an invoice

Get an invoice's details.

**Inputs**

- Invoice ID (`invoice_id`, number, required): PestPac's ID for the invoice.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "Balance": 1,
    "BillToID": 1,
    "InvoiceDate": "example",
    "InvoiceID": 1,
    "InvoiceNumber": "example",
    "LocationID": 1,
    "OrderID": 1,
    "Status": "example",
    "Total": 1
  }
}
```

### List a bill-to's payments

List the payments a bill-to account has made.

**Inputs**

- Bill-to ID (`bill_to_id`, number, required): PestPac's ID for the bill-to account.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "Amount": 1,
        "BillToID": 1,
        "MethodOfPayment": "example",
        "PaymentDate": "example",
        "PaymentID": 1,
        "PaymentType": "example"
      }
    ]
  }
}
```

### List a location's contacts

List the contacts at a service location.

**Inputs**

- Location ID (`location_id`, number, required): PestPac's ID for the location (its LocationID).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "Address": "example",
        "City": "example",
        "Comment": "example",
        "ContactID": 1,
        "EMail": "example",
        "FirstName": "example",
        "LastName": "example",
        "LocationID": 1,
        "MobilePhone": "example",
        "Phone": "example",
        "State": "example",
        "Zip": "example"
      }
    ]
  }
}
```

### List a location's documents

List the documents filed against a service location.

**Inputs**

- Location ID (`location_id`, number, required): PestPac's ID for the location (its LocationID).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "Date": "example",
        "DocumentID": 1,
        "LocationID": 1,
        "Name": "example",
        "Tags": "example",
        "URL": "example"
      }
    ]
  }
}
```

### List a location's service orders

List the service orders for a service location.

**Inputs**

- Location ID (`location_id`, number, required): PestPac's ID for the location (its LocationID).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "BillToID": 1,
        "LocationID": 1,
        "OrderID": 1,
        "OrderInstructions": "example",
        "OrderNumber": "example",
        "Posted": true,
        "RouteID": 1,
        "ServiceCode": "example",
        "ServiceType": "example",
        "Status": "example",
        "Technician": "example",
        "Total": 1,
        "WorkDate": "example"
      }
    ]
  }
}
```

### List a location's service setups

List the recurring service setups at a service location.

**Inputs**

- Location ID (`location_id`, number, required): PestPac's ID for the location (its LocationID).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "Active": true,
        "LocationID": 1,
        "Price": 1,
        "Route": "example",
        "Schedule": "example",
        "ServiceCode": "example",
        "SetupID": 1,
        "StartDate": "example"
      }
    ]
  }
}
```

### List a location's unpaid invoices

List the invoices still to be paid for a service location.

**Inputs**

- Location ID (`location_id`, number, required): PestPac's ID for the location (its LocationID).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "Balance": 1,
        "BillToID": 1,
        "InvoiceDate": "example",
        "InvoiceID": 1,
        "InvoiceNumber": "example",
        "LocationID": 1,
        "OrderID": 1,
        "Status": "example",
        "Total": 1
      }
    ]
  }
}
```

### List leads

List sales leads, optionally for one branch.

**Inputs**

- Branch (`branch`, text): Only leads in this branch.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "Branch": "example",
        "Company": "example",
        "EMail": "example",
        "EnteredDate": "example",
        "FirstName": "example",
        "LastName": "example",
        "LeadID": 1,
        "Phone": "example",
        "Source": "example",
        "Status": "example"
      }
    ]
  }
}
```

### List service orders

List service orders, optionally for a range of work dates, a branch or a type.

**Inputs**

- From work date (`start_date`, date): Only orders worked on or after this date.
- To work date (`end_date`, date): Only orders worked on or before this date.
- Posted (`posted`, true/false): On for only posted (completed) orders, off for only unposted ones.
- In progress (`in_progress`, true/false): On for only orders being worked now.
- Branch (`branch`, text): Only orders in this branch.
- Order type (`order_type`, text): Only orders of this type, as PestPac names it.
- Order number (`order_number`, text): Only the order with this number.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "BillToID": 1,
        "LocationID": 1,
        "OrderID": 1,
        "OrderInstructions": "example",
        "OrderNumber": "example",
        "Posted": true,
        "RouteID": 1,
        "ServiceCode": "example",
        "ServiceType": "example",
        "Status": "example",
        "Technician": "example",
        "Total": 1,
        "WorkDate": "example"
      }
    ]
  }
}
```

### List webhooks

List the webhooks set up for the company.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "records": [
      {
        "EntityType": "example",
        "action": "example",
        "id": "example",
        "includeEntityBody": true,
        "postToUrl": "example"
      }
    ]
  }
}
```

### Update a contact

Change a contact's details. Fields left empty keep what the contact has.

**Inputs**

- Contact ID (`contact_id`, number, required): PestPac's ID for the contact (its ContactID).
- First name (`first_name`, text): The contact's first name.
- Last name (`last_name`, text): The contact's last name.
- Email (`email`, text): The contact's email address.
- Phone (`phone`, text): The contact's phone number.
- Mobile phone (`mobile_phone`, text): The contact's mobile number.
- Address (`address`, text): The street address.
- Address line 2 (`address2`, text): The second line of the address.
- City (`city`, text): The city.
- State (`state`, text): The state, as its two-letter code.
- ZIP code (`zip`, text): The ZIP code.
- Comment (`comment`, text): A comment about the contact.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "Address": "example",
    "City": "example",
    "Comment": "example",
    "ContactID": 1,
    "EMail": "example",
    "FirstName": "example",
    "LastName": "example",
    "LocationID": 1,
    "MobilePhone": "example",
    "Phone": "example",
    "State": "example",
    "Zip": "example"
  }
}
```
