# ServiceTrade

> Manage ServiceTrade jobs, locations, companies and contacts, and read appointments, quotes and invoices.

App · 26 actions. Web page: https://docs.lodol.com/docs/integrations/servicetrade

## Actions

### Add a comment to a job

Add a comment to a job.

**Inputs**

- Job (`job_id`, number, required): The job to comment on.
- Content (`content`, text, required): The comment.
- Visibility (`visibility`, list): Who and where the comment shows. Private to your team when left empty. One or more of: `public`, `schedule`, `tech`, `billing`.
- Pinned (`pinned`, true/false): Pin the comment to the top.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "author": {
        "avatar": {},
        "email": "example",
        "id": 1,
        "isHelper": false,
        "isTech": false,
        "name": "example",
        "status": "active",
        "uri": "example"
      },
      "content": "example",
      "created": 1,
      "entity": {
        "id": 1,
        "type": 1,
        "uri": "example"
      },
      "id": 1,
      "pinned": false,
      "updated": 1,
      "uri": "example",
      "visibility": []
    }
  }
}
```

### Create a company

Create a company. New companies are customers unless you say otherwise.

**Inputs**

- Name (`name`, text, required): The company's name.
- Street (`street`, text, required): Street address.
- City (`city`, text, required): City.
- State (`state`, text, required): Two-letter US state or Canadian province code, such as `NC`.
- Postal code (`postal_code`, text): ZIP or postal code.
- Phone number (`phone_number`, text): The company's phone number.
- Reference number (`ref_number`, text): Your reference number. ServiceTrade makes one when left empty.
- Is a customer (`customer`, true/false): Whether the company is a customer. Yes when left empty.
- Is a vendor (`vendor`, true/false): Whether the company is a service vendor.
- Status (`status`, text): The company's status. New companies are active. One of: `active`, `pending`, `inactive`, `on_hold` (On hold).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "address": {
        "city": "example",
        "postalCode": "example",
        "state": "example",
        "street": "example"
      },
      "created": 1,
      "customer": false,
      "defaultBrand": {
        "displayName": "example",
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "externalIds": {},
      "id": 1,
      "logo": {
        "aspect": "tall",
        "contentUrl": "example",
        "id": 1,
        "uri": "example"
      },
      "managingAccount": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "name": "example",
      "partsVendor": false,
      "phoneNumber": "example",
      "primeContractor": false,
      "refNumber": "example",
      "serviceLinesProvided": [],
      "shareId": 1,
      "status": "active",
      "tags": [],
      "updated": 1,
      "uri": "example",
      "vendor": false
    }
  }
}
```

### Create a contact

Create a contact for companies or locations. Give a first or last name.

**Inputs**

- First name (`first_name`, text): First name. Needed when there's no last name.
- Last name (`last_name`, text): Last name. Needed when there's no first name.
- Email (`email`, text): Email address.
- Phone (`phone`, text): Phone number.
- Mobile (`mobile`, text): Mobile phone number.
- Contact types (`contact_types`, list): Contact types, such as `management` or `financial`.
- Companies (`company_ids`, list): Companies the contact belongs to.
- Locations (`location_ids`, list): Locations the contact belongs to.
- Status (`status`, text): Who can see the contact. New contacts are private. One of: `public`, `private`, `inactive`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "alternatePhone": "example",
      "companies": [],
      "company": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "created": 1,
      "email": "example",
      "externalIds": {},
      "firstName": "example",
      "id": 1,
      "lastName": "example",
      "location": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "locations": [],
      "mobile": "example",
      "phone": "example",
      "status": "public",
      "type": "example",
      "types": [],
      "updated": 1,
      "uri": "example"
    }
  }
}
```

### Create a job

Create a job at a location.

**Inputs**

- Location (`location_id`, number, required): The location where the work will be done.
- Job type (`job_type`, text, required): The kind of work. One of: `administrative`, `buildout`, `cleaning`, `construction`, `consultation`, `delivery`, `design`, `emergency_service_call` (Emergency service call), `exchange`, `hookup`, and 24 more.
- Status (`status`, text): The job's first status. One of: `new`, `scheduled`, `canceled`, `bidding`, `completed`, `pending_invoice` (Pending invoice), `sending_invoice` (Sending invoice), `closed`.
- Custom name (`custom_name`, text): A custom name for the job.
- Description (`description`, text): What the job is for.
- Customer PO (`customer_po`, text): The customer's purchase order number.
- Owner (`owner_id`, number): The user who owns the job.
- Primary contact (`primary_contact_id`, number): The job's primary contact. They must belong to the job's location or customer.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "assignedOffice": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "budgeted": false,
      "completedOn": 1,
      "contract": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "created": 1,
      "currentAppointment": {
        "id": 1,
        "name": "example",
        "released": false,
        "status": "scheduled",
        "techs": [],
        "uri": "example",
        "windowEnd": 1,
        "windowStart": 1
      },
      "customName": "example",
      "customer": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "customerPo": "example",
      "deficienciesFound": false,
      "description": "example",
      "displayStatus": "example",
      "displaySubstatus": "example",
      "dueAfter": 1,
      "dueBy": 1,
      "estimatedPrice": 1.0,
      "externalIds": {},
      "id": 1,
      "isProject": false,
      "ivrActivity": "example",
      "ivrOpen": false,
      "jobTypeWeight": 1,
      "latestClockIn": 1,
      "location": {
        "address": {},
        "distance": 1.0,
        "email": "example",
        "generalManager": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "name": "example",
      "notes": [],
      "number": 1,
      "offices": [],
      "otherTradeDeficienciesFound": false,
      "owner": {
        "avatar": {},
        "email": "example",
        "id": 1,
        "isHelper": false,
        "isTech": false,
        "name": "example",
        "status": "active",
        "uri": "example"
      },
      "percentComplete": 1,
      "primaryContact": {
        "alternatePhone": "example",
        "email": "example",
        "firstName": "example",
        "id": 1,
        "lastName": "example",
        "mobile": "example",
        "phone": "example",
        "type": "example",
        "types": [],
        "uri": "example"
      },
      "project": {
        "endDate": 1,
        "id": 1,
        "startDate": 1,
        "uri": "example"
      },
      "redTagsFound": false,
      "refNumber": "example",
      "sales": {
        "avatar": {},
        "email": "example",
        "id": 1,
        "isHelper": false,
        "isTech": false,
        "name": "example",
        "status": "active",
        "uri": "example"
      },
      "scheduledDate": 1,
      "schedulingComments": [],
      "sectionVisibilities": [],
      "serviceLine": "example",
      "serviceLinkAttachmentCategoryVisibility": [],
      "serviceLinkAttachmentVisibility": false,
      "serviceLinkCommentVisibility": false,
      "serviceRequests": [],
      "status": "new",
      "substatus": "example",
      "tags": [],
      "terms": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "type": "administrative",
      "updated": 1,
      "uri": "example",
      "vendor": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "visibility": []
    }
  }
}
```

### Create a location

Create a location for a company.

**Inputs**

- Name (`name`, text, required): The location's name.
- Company (`company_id`, number, required): The company the location belongs to.
- Street (`street`, text, required): Street address.
- City (`city`, text, required): City.
- State (`state`, text, required): Two-letter US state or Canadian province code, such as `NC`.
- Postal code (`postal_code`, text): ZIP or postal code.
- Phone number (`phone_number`, text): The location's phone number.
- Email (`email`, text): The location's email address.
- Reference number (`ref_number`, text): Your reference number. ServiceTrade makes one when left empty.
- Status (`status`, text): The location's status. New locations are active. One of: `active`, `inactive`, `pending`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "address": {
        "city": "example",
        "postalCode": "example",
        "state": "example",
        "street": "example"
      },
      "brand": {
        "displayName": "example",
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "company": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "created": 1,
      "email": "example",
      "externalIds": {},
      "generalManager": "example",
      "geocodeQuality": 1,
      "id": 1,
      "lat": 1.0,
      "lon": 1.0,
      "name": "example",
      "offices": [],
      "phoneNumber": "example",
      "primaryContact": {
        "alternatePhone": "example",
        "email": "example",
        "firstName": "example",
        "id": 1,
        "lastName": "example",
        "mobile": "example",
        "phone": "example",
        "type": "example",
        "types": [],
        "uri": "example"
      },
      "refNumber": "example",
      "remitToAddress": {
        "city": "example",
        "email": "example",
        "phone": "example",
        "postalCode": "example",
        "state": "example",
        "street": "example"
      },
      "remitToSource": "example",
      "status": "active",
      "storeNumber": "example",
      "tags": [],
      "taxGroup": {
        "code": "example",
        "combinedRate": 1.0,
        "combinedRateDetails": [],
        "id": 1,
        "name": "example",
        "state": "example",
        "uri": "example"
      },
      "taxable": false,
      "updated": 1,
      "uri": "example"
    }
  }
}
```

### Delete a company

Delete a company. ServiceTrade refuses when the company has locations, jobs or other records.

**Inputs**

- Company (`company_id`, number, required): The company.

**Outputs**

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

**Example output**

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

### Delete a location

Delete a location. ServiceTrade refuses when the location has jobs or other records.

**Inputs**

- Location (`location_id`, number, required): The location.

**Outputs**

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

**Example output**

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

### Get a company

Get one company with its address and status.

**Inputs**

- Company (`company_id`, number, required): The company.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "address": {
        "city": "example",
        "postalCode": "example",
        "state": "example",
        "street": "example"
      },
      "created": 1,
      "customer": false,
      "defaultBrand": {
        "displayName": "example",
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "externalIds": {},
      "id": 1,
      "logo": {
        "aspect": "tall",
        "contentUrl": "example",
        "id": 1,
        "uri": "example"
      },
      "managingAccount": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "name": "example",
      "partsVendor": false,
      "phoneNumber": "example",
      "primeContractor": false,
      "refNumber": "example",
      "serviceLinesProvided": [],
      "shareId": 1,
      "status": "active",
      "tags": [],
      "updated": 1,
      "uri": "example",
      "vendor": false
    }
  }
}
```

### Get a contact

Get one contact with their companies and locations.

**Inputs**

- Contact (`contact_id`, number, required): The contact.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "alternatePhone": "example",
      "companies": [],
      "company": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "created": 1,
      "email": "example",
      "externalIds": {},
      "firstName": "example",
      "id": 1,
      "lastName": "example",
      "location": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "locations": [],
      "mobile": "example",
      "phone": "example",
      "status": "public",
      "type": "example",
      "types": [],
      "updated": 1,
      "uri": "example"
    }
  }
}
```

### Get a job

Get one job with its location, customer, appointments and service requests.

**Inputs**

- Job (`job_id`, number, required): The job.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "assignedOffice": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "budgeted": false,
      "completedOn": 1,
      "contract": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "created": 1,
      "currentAppointment": {
        "id": 1,
        "name": "example",
        "released": false,
        "status": "scheduled",
        "techs": [],
        "uri": "example",
        "windowEnd": 1,
        "windowStart": 1
      },
      "customName": "example",
      "customer": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "customerPo": "example",
      "deficienciesFound": false,
      "description": "example",
      "displayStatus": "example",
      "displaySubstatus": "example",
      "dueAfter": 1,
      "dueBy": 1,
      "estimatedPrice": 1.0,
      "externalIds": {},
      "id": 1,
      "isProject": false,
      "ivrActivity": "example",
      "ivrOpen": false,
      "jobTypeWeight": 1,
      "latestClockIn": 1,
      "location": {
        "address": {},
        "distance": 1.0,
        "email": "example",
        "generalManager": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "name": "example",
      "notes": [],
      "number": 1,
      "offices": [],
      "otherTradeDeficienciesFound": false,
      "owner": {
        "avatar": {},
        "email": "example",
        "id": 1,
        "isHelper": false,
        "isTech": false,
        "name": "example",
        "status": "active",
        "uri": "example"
      },
      "percentComplete": 1,
      "primaryContact": {
        "alternatePhone": "example",
        "email": "example",
        "firstName": "example",
        "id": 1,
        "lastName": "example",
        "mobile": "example",
        "phone": "example",
        "type": "example",
        "types": [],
        "uri": "example"
      },
      "project": {
        "endDate": 1,
        "id": 1,
        "startDate": 1,
        "uri": "example"
      },
      "redTagsFound": false,
      "refNumber": "example",
      "sales": {
        "avatar": {},
        "email": "example",
        "id": 1,
        "isHelper": false,
        "isTech": false,
        "name": "example",
        "status": "active",
        "uri": "example"
      },
      "scheduledDate": 1,
      "schedulingComments": [],
      "sectionVisibilities": [],
      "serviceLine": "example",
      "serviceLinkAttachmentCategoryVisibility": [],
      "serviceLinkAttachmentVisibility": false,
      "serviceLinkCommentVisibility": false,
      "serviceRequests": [],
      "status": "new",
      "substatus": "example",
      "tags": [],
      "terms": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "type": "administrative",
      "updated": 1,
      "uri": "example",
      "vendor": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "visibility": []
    }
  }
}
```

### Get a location

Get one location with its address, company and contacts.

**Inputs**

- Location (`location_id`, number, required): The location.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "address": {
        "city": "example",
        "postalCode": "example",
        "state": "example",
        "street": "example"
      },
      "brand": {
        "displayName": "example",
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "company": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "created": 1,
      "email": "example",
      "externalIds": {},
      "generalManager": "example",
      "geocodeQuality": 1,
      "id": 1,
      "lat": 1.0,
      "lon": 1.0,
      "name": "example",
      "offices": [],
      "phoneNumber": "example",
      "primaryContact": {
        "alternatePhone": "example",
        "email": "example",
        "firstName": "example",
        "id": 1,
        "lastName": "example",
        "mobile": "example",
        "phone": "example",
        "type": "example",
        "types": [],
        "uri": "example"
      },
      "refNumber": "example",
      "remitToAddress": {
        "city": "example",
        "email": "example",
        "phone": "example",
        "postalCode": "example",
        "state": "example",
        "street": "example"
      },
      "remitToSource": "example",
      "status": "active",
      "storeNumber": "example",
      "tags": [],
      "taxGroup": {
        "code": "example",
        "combinedRate": 1.0,
        "combinedRateDetails": [],
        "id": 1,
        "name": "example",
        "state": "example",
        "uri": "example"
      },
      "taxable": false,
      "updated": 1,
      "uri": "example"
    }
  }
}
```

### Get a quote

Get one quote with its items and totals.

**Inputs**

- Quote (`quote_id`, number, required): The quote.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "assignedOffice": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "assignedTo": {},
      "contract": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "created": 1,
      "customer": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "customerPo": "example",
      "customerPoRequired": false,
      "deficiencyJobs": [],
      "deficiencySeverity": "example",
      "description": "example",
      "expiresOn": 1,
      "externalIds": {},
      "id": 1,
      "items": [],
      "jobType": "administrative",
      "jobs": [],
      "latestAccepted": 1,
      "latestSubmission": 1,
      "location": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "name": "example",
      "notes": "example",
      "owner": {},
      "quoteLinkAttachmentVisibility": false,
      "quoteLinkCommentVisibility": false,
      "quoteRequest": {
        "id": 1,
        "name": "example",
        "status": "canceled",
        "type": "simple",
        "uri": "example"
      },
      "refNumber": "example",
      "respondBy": 1,
      "sales": {
        "avatar": {},
        "email": "example",
        "id": 1,
        "isHelper": false,
        "isTech": false,
        "name": "example",
        "status": "active",
        "uri": "example"
      },
      "sectionVisibilities": [],
      "serviceLines": [],
      "serviceRequests": [],
      "status": "accepted",
      "substatus": "example",
      "subtotal": "example",
      "tags": [],
      "taskingDetailLevel": "detailed",
      "taxAmount": "example",
      "terms": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "totalPrice": "example",
      "updated": 1,
      "uri": "example",
      "vendor": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "visibility": []
    }
  }
}
```

### Get an appointment

Get one appointment with its window, job and technicians.

**Inputs**

- Appointment (`appointment_id`, number, required): The appointment.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "created": 1,
      "dueBy": 1,
      "id": 1,
      "job": {
        "customName": "example",
        "id": 1,
        "isProject": false,
        "name": "example",
        "number": 1,
        "primaryContact": {},
        "status": "new",
        "type": "administrative",
        "uri": "example"
      },
      "location": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "name": "example",
      "offices": [],
      "released": false,
      "serviceRequests": [],
      "status": "scheduled",
      "techs": [],
      "updated": 1,
      "uri": "example",
      "vendor": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "windowEnd": 1,
      "windowStart": 1
    }
  }
}
```

### Get an invoice

Get one invoice with its items, totals and payment state.

**Inputs**

- Invoice (`invoice_id`, number, required): The invoice.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "assignedOffice": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "assignedUser": {
        "avatar": {},
        "email": "example",
        "id": 1,
        "isHelper": false,
        "isTech": false,
        "name": "example",
        "status": "active",
        "uri": "example"
      },
      "contract": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "created": 1,
      "customer": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "customerPo": "example",
      "dueDate": 1,
      "id": 1,
      "invoiceNumber": "example",
      "items": [],
      "job": {
        "customName": "example",
        "id": 1,
        "isProject": false,
        "name": "example",
        "number": 1,
        "primaryContact": {},
        "status": "new",
        "type": "administrative",
        "uri": "example"
      },
      "location": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "name": "example",
      "notes": "example",
      "paid": false,
      "partial": false,
      "paymentTerms": {
        "id": 1,
        "name": "example",
        "orderIndex": 1,
        "uri": "example"
      },
      "refNumber": "example",
      "sent": false,
      "status": "ok",
      "substatus": "example",
      "subtotal": 1.0,
      "tags": [],
      "taxAmount": 1.0,
      "terms": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "totalPaidAmount": 1.0,
      "totalPrice": 1.0,
      "transactionDate": 1,
      "type": "invoice",
      "updated": 1,
      "uri": "example",
      "vendor": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "visibility": []
    }
  }
}
```

### List appointments

List appointments, filtered by job, status, technician or schedule window.

**Inputs**

- Job (`job_id`, number): Only appointments for this job.
- Status (`status`, list): Appointment statuses to include. Without one, every status except unscheduled. One or more of: `scheduled`, `unscheduled`, `canceled_by_vendor` (Canceled by vendor), `canceled_by_customer` (Canceled by customer), `completed`, `no_show` (No show).
- Technicians (`tech_ids`, list): Only appointments assigned to these technicians.
- Window begins after (`window_begins_after`, date and time): Only appointments whose window starts on or after this day.
- Window begins before (`window_begins_before`, date and time): Only appointments whose window starts on or before this day.
- Updated after (`updated_after`, date and time): Only appointments updated at or after this time.
- Page (`page`, number): Page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): Records per page, up to 2,000 (the default). From 1 to 2000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "appointments": [],
      "page": 1,
      "totalPages": 1
    }
  }
}
```

### List companies

List companies (customers, vendors and contractors), filtered by name, place, status or when they changed.

**Inputs**

- Name (`name`, text): Text the company's name contains.
- City (`city`, text): Text the company's city contains.
- State (`state`, text): Two-letter state code.
- Is customer (`is_customer`, true/false): Only companies listed as customers.
- Is vendor (`is_vendor`, true/false): Only companies listed as service vendors.
- Status (`status`, text): Only companies with this status. One of: `active`, `pending`, `inactive`, `on_hold` (On hold).
- Updated after (`updated_after`, date and time): Only companies updated at or after this time.
- Created after (`created_after`, date and time): Only companies created at or after this time.
- Page (`page`, number): Page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): Records per page, up to 2,000 (the default). From 1 to 2000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "companies": [],
      "page": 1,
      "totalPages": 1
    }
  }
}
```

### List contacts

List contacts, filtered by company, location, a search or when they changed.

**Inputs**

- Search (`search`, text): Text to find in a contact's name, phone numbers or email.
- Email (`email`, text): Only the contact with exactly this email address.
- Company (`company_id`, number): Only contacts of this company or its locations.
- Location (`location_id`, number): Only contacts of this location.
- Updated after (`updated_after`, date and time): Only contacts updated at or after this time.
- Created after (`created_after`, date and time): Only contacts created at or after this time.
- Page (`page`, number): Page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): Records per page, up to 2,000 (the default). From 1 to 2000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "contacts": [],
      "page": 1,
      "totalPages": 1
    }
  }
}
```

### List invoices

List invoices, filtered by job, customer, status, payment or when they changed.

**Inputs**

- Job (`job_id`, number): Only invoices for this job.
- Customer (`customer_id`, number): Only invoices for this customer company.
- Status (`status`, text): Only invoices with this status. One of: `ok`, `internal_review` (Internal review), `pending_accounting` (Pending accounting), `pending_sales_tax` (Pending sales tax), `processed`, `failed`, `void`.
- Payment state (`paid`, text): Only invoices in this payment state. One of: `paid`, `unpaid`, `partial`.
- Invoice number (`invoice_number`, text): Only the invoice with this number.
- Updated after (`updated_after`, date and time): Only invoices updated at or after this time.
- Created after (`created_after`, date and time): Only invoices created at or after this time.
- Page (`page`, number): Page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): Records per page, up to 2,000 (the default). From 1 to 2000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "invoices": [],
      "page": 1,
      "totalPages": 1
    }
  }
}
```

### List jobs

List jobs, filtered by status, type, location, customer or when they changed.

**Inputs**

- Status (`status`, list): Job statuses to include. `all` is every status except canceled, and `*` is every status. Without one, ServiceTrade lists scheduled jobs. One or more of: `*`, `all`, `new`, `scheduled`, `canceled`, `bidding`, `completed`, `pending_invoice` (Pending invoice), `sending_invoice` (Sending invoice), `invoiced`, `closed`.
- Job types (`job_type`, list): Job types to include. One or more of: `administrative`, `buildout`, `cleaning`, `construction`, `consultation`, `delivery`, `design`, `emergency_service_call` (Emergency service call), `exchange`, `hookup`, and 24 more.
- Locations (`location_ids`, list): Only jobs at these locations.
- Customers (`customer_ids`, list): Only jobs for these customer companies.
- Name (`name`, text): Text the job's custom name contains.
- Created after (`created_after`, date and time): Only jobs created at or after this time.
- Updated after (`updated_after`, date and time): Only jobs updated at or after this time.
- Sort (`sort`, text): Field to sort by. One of: `created`, `dueBy`, `dueAfter`, `name`, `number`, `scheduleStart`, `status`.
- Sort order (`sort_order`, text): Sort ascending or descending. One of: `ASC`, `DESC`.
- Page (`page`, number): Page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): Records per page, up to 2,000 (the default). From 1 to 2000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "jobs": [],
      "page": 1,
      "totalPages": 1
    }
  }
}
```

### List locations

List customer locations, filtered by name, company, status or when they changed.

**Inputs**

- Name (`name`, text): Text the location's name or store number contains.
- Companies (`company_ids`, list): Only locations that belong to these companies.
- Status (`status`, text): Only locations with this status. One of: `active`, `inactive`, `pending`.
- Updated after (`updated_after`, date and time): Only locations updated at or after this time.
- Created after (`created_after`, date and time): Only locations created at or after this time.
- Page (`page`, number): Page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): Records per page, up to 2,000 (the default). From 1 to 2000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "locations": [],
      "page": 1,
      "totalPages": 1
    }
  }
}
```

### List quotes

List quotes, filtered by status, customer, location or when they changed.

**Inputs**

- Status (`status`, list): Quote statuses to include. One or more of: `accepted`, `canceled`, `draft`, `new`, `rejected`, `submitted`, `pending_sales_tax` (Pending sales tax).
- Customer (`customer_id`, number): Only quotes for this customer company.
- Name (`name`, text): Text the quote's name contains.
- Updated after (`updated_after`, date and time): Only quotes updated at or after this time.
- Created after (`created_after`, date and time): Only quotes created at or after this time.
- Sort (`sort`, text): Field to sort by. By name when left empty. One of: `name`, `created`, `updated`, `status`.
- Sort order (`sort_order`, text): Sort ascending or descending. One of: `ASC`, `DESC`.
- Page (`page`, number): Page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): Records per page, up to 2,000 (the default). From 1 to 2000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "page": 1,
      "quotes": [],
      "totalPages": 1
    }
  }
}
```

### List users

List your company's users, such as technicians and salespeople.

**Inputs**

- Search (`search`, text): Text to find in a user's name, username or email.
- Is tech (`is_tech`, true/false): Only technicians.
- Status (`status`, list): User statuses to include. Active users when left empty. One or more of: `active`, `pending`, `inactive`.
- Page (`page`, number): Page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): Records per page, up to 2,000 (the default). From 1 to 2000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "page": 1,
      "totalPages": 1,
      "users": []
    }
  }
}
```

### Update a company

Change a company's name, address, phone or status. Fields left empty are unchanged; to change the address, fill in its street, city and state.

**Inputs**

- Company (`company_id`, number, required): The company.
- Name (`name`, text): The company's name.
- Street (`street`, text): Street address.
- City (`city`, text): City.
- State (`state`, text): Two-letter US state or Canadian province code, such as `NC`.
- Postal code (`postal_code`, text): ZIP or postal code.
- Phone number (`phone_number`, text): The company's phone number.
- Reference number (`ref_number`, text): Your reference number.
- Is a customer (`customer`, true/false): Whether the company is a customer.
- Is a vendor (`vendor`, true/false): Whether the company is a service vendor.
- Status (`status`, text): The company's status. One of: `active`, `pending`, `inactive`, `on_hold` (On hold).

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "address": {
        "city": "example",
        "postalCode": "example",
        "state": "example",
        "street": "example"
      },
      "created": 1,
      "customer": false,
      "defaultBrand": {
        "displayName": "example",
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "externalIds": {},
      "id": 1,
      "logo": {
        "aspect": "tall",
        "contentUrl": "example",
        "id": 1,
        "uri": "example"
      },
      "managingAccount": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "name": "example",
      "partsVendor": false,
      "phoneNumber": "example",
      "primeContractor": false,
      "refNumber": "example",
      "serviceLinesProvided": [],
      "shareId": 1,
      "status": "active",
      "tags": [],
      "updated": 1,
      "uri": "example",
      "vendor": false
    }
  }
}
```

### Update a contact

Change a contact's name, email, phone numbers, types or status. Companies and locations you give replace the current ones.

**Inputs**

- Contact (`contact_id`, number, required): The contact.
- First name (`first_name`, text): First name.
- Last name (`last_name`, text): Last name.
- Email (`email`, text): Email address.
- Phone (`phone`, text): Phone number.
- Mobile (`mobile`, text): Mobile phone number.
- Contact types (`contact_types`, list): Contact types, such as `management` or `financial`.
- Companies (`company_ids`, list): Companies the contact belongs to, replacing the current ones.
- Locations (`location_ids`, list): Locations the contact belongs to, replacing the current ones.
- Status (`status`, text): Who can see the contact. One of: `public`, `private`, `inactive`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "alternatePhone": "example",
      "companies": [],
      "company": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "created": 1,
      "email": "example",
      "externalIds": {},
      "firstName": "example",
      "id": 1,
      "lastName": "example",
      "location": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "locations": [],
      "mobile": "example",
      "phone": "example",
      "status": "public",
      "type": "example",
      "types": [],
      "updated": 1,
      "uri": "example"
    }
  }
}
```

### Update a job

Change a job's name, description, status, owner or other details. Fields left empty are unchanged.

**Inputs**

- Job (`job_id`, number, required): The job.
- Job type (`job_type`, text): The kind of work. One of: `administrative`, `buildout`, `cleaning`, `construction`, `consultation`, `delivery`, `design`, `emergency_service_call` (Emergency service call), `exchange`, `hookup`, and 24 more.
- Status (`status`, text): The job's new status. One of: `new`, `scheduled`, `canceled`, `bidding`, `completed`, `pending_invoice` (Pending invoice), `sending_invoice` (Sending invoice), `closed`.
- Substatus (`substatus`, text): The job's new substatus. One of: `pending_approval` (Pending approval), `po_hold` (Po hold), `construction_hold` (Construction hold), `awaiting_parts` (Awaiting parts), `rework_required` (Rework required), `needs_review_sales` (Needs review sales), `needs_review_ops` (Needs review ops), `sales_approved` (Sales approved), `ops_approved` (Ops approved).
- Cancellation reason (`cancellation_reason`, text): Why the job is canceled. Only used when the status is canceled.
- Custom name (`custom_name`, text): A custom name for the job.
- Description (`description`, text): What the job is for.
- Customer PO (`customer_po`, text): The customer's purchase order number.
- Owner (`owner_id`, number): The user who owns the job.
- Primary contact (`primary_contact_id`, number): The job's primary contact. They must belong to the job's location or customer.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "assignedOffice": {
        "address": {},
        "email": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "budgeted": false,
      "completedOn": 1,
      "contract": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "created": 1,
      "currentAppointment": {
        "id": 1,
        "name": "example",
        "released": false,
        "status": "scheduled",
        "techs": [],
        "uri": "example",
        "windowEnd": 1,
        "windowStart": 1
      },
      "customName": "example",
      "customer": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "customerPo": "example",
      "deficienciesFound": false,
      "description": "example",
      "displayStatus": "example",
      "displaySubstatus": "example",
      "dueAfter": 1,
      "dueBy": 1,
      "estimatedPrice": 1.0,
      "externalIds": {},
      "id": 1,
      "isProject": false,
      "ivrActivity": "example",
      "ivrOpen": false,
      "jobTypeWeight": 1,
      "latestClockIn": 1,
      "location": {
        "address": {},
        "distance": 1.0,
        "email": "example",
        "generalManager": "example",
        "id": 1,
        "lat": 1.0,
        "legacyId": 1,
        "lon": 1.0,
        "name": "example",
        "phoneNumber": "example",
        "primaryContact": {},
        "refNumber": "example",
        "status": "example",
        "taxable": false,
        "uri": "example"
      },
      "name": "example",
      "notes": [],
      "number": 1,
      "offices": [],
      "otherTradeDeficienciesFound": false,
      "owner": {
        "avatar": {},
        "email": "example",
        "id": 1,
        "isHelper": false,
        "isTech": false,
        "name": "example",
        "status": "active",
        "uri": "example"
      },
      "percentComplete": 1,
      "primaryContact": {
        "alternatePhone": "example",
        "email": "example",
        "firstName": "example",
        "id": 1,
        "lastName": "example",
        "mobile": "example",
        "phone": "example",
        "type": "example",
        "types": [],
        "uri": "example"
      },
      "project": {
        "endDate": 1,
        "id": 1,
        "startDate": 1,
        "uri": "example"
      },
      "redTagsFound": false,
      "refNumber": "example",
      "sales": {
        "avatar": {},
        "email": "example",
        "id": 1,
        "isHelper": false,
        "isTech": false,
        "name": "example",
        "status": "active",
        "uri": "example"
      },
      "scheduledDate": 1,
      "schedulingComments": [],
      "sectionVisibilities": [],
      "serviceLine": "example",
      "serviceLinkAttachmentCategoryVisibility": [],
      "serviceLinkAttachmentVisibility": false,
      "serviceLinkCommentVisibility": false,
      "serviceRequests": [],
      "status": "new",
      "substatus": "example",
      "tags": [],
      "terms": {
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "type": "administrative",
      "updated": 1,
      "uri": "example",
      "vendor": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "visibility": []
    }
  }
}
```

### Update a location

Change a location's name, address, phone, email or status. Fields left empty are unchanged; to change the address, fill in its street, city and state.

**Inputs**

- Location (`location_id`, number, required): The location.
- Name (`name`, text): The location's name.
- Street (`street`, text): Street address.
- City (`city`, text): City.
- State (`state`, text): Two-letter US state or Canadian province code, such as `NC`.
- Postal code (`postal_code`, text): ZIP or postal code.
- Phone number (`phone_number`, text): The location's phone number.
- Email (`email`, text): The location's email address.
- Reference number (`ref_number`, text): Your reference number.
- Status (`status`, text): The location's status. One of: `active`, `inactive`, `pending`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "data": {
      "address": {
        "city": "example",
        "postalCode": "example",
        "state": "example",
        "street": "example"
      },
      "brand": {
        "displayName": "example",
        "id": 1,
        "name": "example",
        "uri": "example"
      },
      "company": {
        "id": 1,
        "name": "example",
        "status": "example",
        "uri": "example"
      },
      "created": 1,
      "email": "example",
      "externalIds": {},
      "generalManager": "example",
      "geocodeQuality": 1,
      "id": 1,
      "lat": 1.0,
      "lon": 1.0,
      "name": "example",
      "offices": [],
      "phoneNumber": "example",
      "primaryContact": {
        "alternatePhone": "example",
        "email": "example",
        "firstName": "example",
        "id": 1,
        "lastName": "example",
        "mobile": "example",
        "phone": "example",
        "type": "example",
        "types": [],
        "uri": "example"
      },
      "refNumber": "example",
      "remitToAddress": {
        "city": "example",
        "email": "example",
        "phone": "example",
        "postalCode": "example",
        "state": "example",
        "street": "example"
      },
      "remitToSource": "example",
      "status": "active",
      "storeNumber": "example",
      "tags": [],
      "taxGroup": {
        "code": "example",
        "combinedRate": 1.0,
        "combinedRateDetails": [],
        "id": 1,
        "name": "example",
        "state": "example",
        "uri": "example"
      },
      "taxable": false,
      "updated": 1,
      "uri": "example"
    }
  }
}
```
